Alfred is a researcher and he also likes to give people the largest gift with smallest possible budget. Being busy in research all the time he cannot go and deliver his gifts in most cases. Now that his closest friend John is getting married, so he plans to send him the largest gift box just to surprise John and others as usual. Alfred has spent 7 long days to buy gifts for his friend and packed all the gifts in nine circular boxes of equal radius. He now plans to put all of them in a large square shaped box. He can put them in smallest possible box as shown in Figure 1 but in that case his gift box would not be as large as he would like it to be. But he cannot put them in an arbitrary large box because then the circular boxes will move freely and be damaged while in transport. So now Alfred tries to discover a way to put nine circular boxes in a largest Possible Square shaped box so that none of the boxes can move (all are in rigid position). He comes to know from his researcher friend Erich the way to put nine circular boxes in largest possible square shaped box so that none of the circular boxes can move. This is shown in figure 3. Figure 1: Nine circles of equal radius in rigid packing in smallest possible square shaped box. Figure 2: Seven circles of equal radius in non-rigid packing in smallest possible square shaped box. Figure 3: Nine circles of equal radius in rigid packing in largest possible square shaped box. Now given the radius of the circular boxes your job is to find out the length of the sides of the square shaped box. But it is still not as simple as you think because of his other requirements. Being a researcher Alfred has also discovered that if the if the radius of the circular boxes is an integer then the length of the sides L can be expressed in a expression like: √√√ p+ q+ r+ s+sqrtt 2 where p, q, r, s, t are all integer values and q < r. But as he is busy doing his other research so you have to help him solving this problem. So given the radius R of the circular boxes your job is to find out such integer value of p, q, r, s and t such that Input L= p+ q+ r+ s+sqrtt 2 √√√ The input file contains around 1000 lines of input. Each line contains an integer R (0 < R < 1501) that denotes the radius of all the circular boxes. A line containing a single zero terminates input. This line should not be processed.
2/2 Output For each line of input produce one line of output. This line contains the serial of output followed by 5 integer numbers. These five numbers denote the value of p, q, r, s and t respectively (Here q < r). You can safely assume that values of p, q, r, s and t will safely fit in a 64-bit signed integer. Note that the values shown in the sample output is not correct. The values are there just to show the correct output formatting. Sample Input 1 2 0 Sample Output Case 1: 78 456 1100 356 233456 Case 2: 89 2134 3800 8765 18374621