ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

USU Junior Contest October'2004

About     Problems     Submit solution     Judge status     Standings
Contest is over

I. White Thesis

Time limit: 0.5 second
Memory limit: 64 MB
"At this point, the baccalaureate of black magic, Magnus Feodorovich Redkin, brought in his keys, looking obese, customarily preoccupied, and hurt. He obtained his baccalaureate three hundred years ago for inventing the invisibility socks. Since then, he has been improving them over and over. The socks became culottes, and then pants, and now they are referred to as trousers. Still, he remained unable to make them work properly. At the last session of the seminar on black magic, when he made his serial presentation "On Certain Novel Aspects of the Redkin Invisibility Trousers," he was once more overtaken by disaster. During the demonstration of the updated model, something in its inner workings stuck, and the trousers, with a bell-like click, became invisible themselves, instead of their wearer. It was most embarrassing. However, Magnus Feodorovich worked mostly on a dissertation whose subject sounded something like "The Materialization and Linear Naturalization of the White Thesis, as an Argument of the Sufficiently Stochastic Function E Representing the Not Quite Imaginable Human Happiness."
Here he had achieved significant and important results, from which it followed that humanity would be literally swimming in not quite imaginable happiness, if only the White Thesis itself could be found, and most importantly if we could understand what it is and where it could be found."
According to Redkin's last hypothesis, the White Thesis is a positive integer triplet (A, B, C) satisfying the following property: A2 + B2 is divisible by C. The hypothesis also states that all three White Thesis components lie between the squares of two consecutive integers N and N+1.


contains one integer N (2 ≤ N ≤ 30000).


Output three different integers A, B and C, that (A2 + B2) is a multiple of C and N2 ≤ A, B, C ≤ (N+1)2. If two or more such triplets exist, output any one. If there are no such triplets, then output "No solution".


8 6 4
1000000 1000756 1000976
Problem Author: Den Raskovalov
Problem Source: The 10th Collegiate Programming Contest of the High School Pupils of the Sverdlovsk Region (October 16, 2004)
To submit the solution for this problem go to the Problem set: 1335. White Thesis