Having an irreducible faction a/b (1 <= a,b <= 1000, integers), write the
faction
under the shape of a decimal faction, mentioning, if necessary, its period.
The input file is "in", with the following structure:
a b
where a and b are the numerator and the denominator of the faction.
The output file if "out", containing on each line the decimal faction (using the mathematical notations) corresponding to the faction read from the file "in".
Example:
1 1 1 4 1 3 113 102
1 0,25 0,(3) 1,1(0784313725490196)Maximum time for test: 30" /test.
The matriculation exam at the Faculty takes place in a square room,
in which, on each point having integer coordonates there is placed a chair,
excepting
a passage which surrounds the room and allows the placement of chairs for
supervisors
(also in points of integer coordonates). A supervisor sits on a chair, and on
each
straight line which passes through his position, he sees one candidate at the
most.
Write a program which reads from the keyboard a positive integer n( n between 3 and 50) which represents the size of the exam room and prints in the "contest.out" file, on the first line, the minimum number of supervisors necessary so that every candidate to be supevised by at least one person.Write on the next lines the indices of the line and respectively of the columns, separated by space, for each supervisor.
for example, for n=10, the file "contest.out" may be:
3 1 1 1 2 2 1Time for test: 30"/test.