Spiral#6060

Spiral

1 sekunt
64 megabaýt
Ýeňil

Consider all positive integers written in the following manner (you can imagine an infinite spiral).

Your task is to determine the position (row,column) of a given number , assuming that the center (number ) has position . Rows are numbered from top to bottom, columns are numbered from left to right (for example, number is at ). Your program should output a string containing the position of in the form (R,C) where is the row and is the column. and must not contain any leading zeroes.

Giriş

The first line of the input gives an integer , which is the number of test cases. Each test case contains an integer (1 \le N < 2^{31}).

Çykyş

For each test case, output the position as described above. See sample output for further clarification.

Mysallar

1-nji mysal

Loading
Loading