eolymp
bolt
Try our new interface for solving problems
Problems

Pen Counts

Pen Counts

Chicken farmer Xiaoyan is getting three new chickens, Lucy, Charlie and CC. She wants to build a chicken pen so that each chicken has its own, unobstructed view of the countryside. The pen will have three straight sides; this will give each chicken its own side so it can pace back and forth without interfering with the other chickens. Xiaoyan finds a roll of chicken wire (fencing) in the barn that is exactly p feet long. She wants to figure out how many different ways she can make a three sided chicken pen such that each side is an integral number of feet, and she uses the entire roll of fence. Different rotations of the same pen are the same, however, reflections of a pen may be different (see below).

prb5125.gif

Input

The first line contains the number of data sets t (1t1000) that follow. Each data set should be processed identically and independently.

Each data set consists of a single line of input. It contains the data set number and the length of the roll of fence n (3n10000).

Output

For each data set there is a single line of output. It contains the data set number, followed by a single space which is then followed by an integer which is the total number of different three-sided chicken pen configurations that can be made using the entire roll of fence.

Time limit 1 second
Memory limit 64 MiB
Input example #1
5
1 3
2 11
3 12
4 100
5 9999
Output example #1
1 1
2 5
3 4
4 392
5 4165834
Source 2012 ACM Greater New York Region, October 28