WPC5A - Structures
In the Galactical Wars happens the great event of designing a structure to honour the current generation of participants. (It is another matter that inevitably the monument is destroyed at the end of the Galactical Wars).
The organizers this year do not believe that this is a good event, and have reduced the event to building a right structure: a right-angled triangle that represents the geometry of the universe. Further they have given a specific odd integer n, which they want one of the shorter sides of the triangle to be.
The organizers in the galaxy H2 are infuriated with this high-handedness. To demonstrate their prowess in this event, they have decided to build all possible right structures. Calculate how many different right structures they can possibly build.
Input
First line contains a single integer T, denoting the number of test cases.
T lines follow, each containing an odd integer ’n’ denoting the given size of a side.
Output
T lines, each containing a single integer denoting the number of ways to form a right angled triangle with one of the smaller sides as ’n’.
Constraints
1 ≤ T ≤ 10
1 ≤ n ≤ 1012
n is odd.
Example
Input: 1 3 Output: 1
Explanation
There exists only 1 right angled triangle with sides 3, 4, 5.
hide comments
Francky:
2015-02-22 02:38:17
The number of psolver is very curious : here higher than CATHETEN which is easier !!! So we can't rely on number of AC ; it's only an indication.
|
|
wisfaq:
2015-02-21 21:46:13
Francky,
|
|
numerix:
2015-02-21 13:03:44
As the problemsetter of that "new" problem PTC I want to explain my position:
|
|
wisfaq:
2015-02-20 21:30:21
I don't agree with moving problems that have been around for a long time to tutorial just because of the fact that a new one has been published with "much better constraints".
|
|
Francky:
2015-02-20 15:45:19
@mehmetin : Yes, CATHETEN.
|
|
mehmetin:
2014-05-07 16:10:51
Wasn't there a similar problem? |
|
[Rampage] Blue.Mary:
2014-05-07 08:37:18
The problem means "n is not the longest side of the triangle", doesn't mean "n is the shortest side of the triangle". |
|
Bhavik:
2014-04-01 15:19:57
@triveni: thank you for answering my previous query , i will try again:)
|
|
Bhavik:
2014-04-01 11:07:16
@triveni:can you look at my id:11369529 and tell if i need to optimize or need better complexity than what i have implemented..though i am not sure why it gives tle on first thought!!
|
Added by: | triveni |
Date: | 2014-03-29 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | ACA judge IITK, WPC5 |