#P7933. [COCI 2007/2008 #5] PASCAL

[COCI 2007/2008 #5] PASCAL

Problem Description

Little Frane is already in the 10th grade, but he still finds learning Pascal in computer class very difficult. The teacher wrote the following Pascal program as homework. Given the input integer NN, he needs to determine the program’s output.

readln(N);
counter := 0;
for i := N-1 downto 1 do begin
	counter := counter + 1;
	if N mod i = 0 then break;
end;
writeln(counter); 

Please write a program to solve this problem.

Input Format

One line, an integer NN.

Output Format

One line, the output produced by the program above.

1
0
10
5
27
18

Hint

For 100%100\% of the testdata, 1N1091 \le N \le 10^9.

The score of this problem follows the original contest settings, with a full score of 3030 points.

Translated by ChatGPT 5