“How to arrange 10 soldiers in 5 rows of 4 soldiers each?”
Although this problem looks impossible, this is a solution:
(16,16)
(8,8)8
(8,16)0.40(8,16) (0.3915,10.4721)0.41(0.3915,10.4721) (15.6085,10.4721)0.42(15.6085,10.4721) (3.2977,1.5279)0.43(3.2977,1.5279) (12.7023,1.5279)0.44(12.7023,1.5279)
(8,4.95)0.45(8,4.95) (10.9,7.05)0.46(10.9,7.05) (5.1,7.05)0.47(5.1,7.05) (9.8,10.45)0.48(9.8,10.45) (6.2,10.45)0.49(6.2,10.45)
Input consists of several cases, each with a natural number between 2 and .
For every case, we must arrange soldiers in rows, as follows: In a circumference, we choose different points, where is odd and at least 3. Then, we draw straight segments between different pairs of those points. At the end, we can place one soldier on every resulting intersection, those produced at the ends of the segments included.
For every given , print the minimum that allows arranging at least soldiers.
Input
10 11 2 99976869 99976870 99976871
Output
5 7 3 14141 14141 14143