0 views

Uploaded by ashishtrivediscr

- Problem 8
- Problem 7
- Problem 5
- Problem 4
- Problem 3
- Problem 2
- Bitwise Solutions 2010
- Problem 1: Help the Tree of Souls
- ASPHand Book
- The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
- Sapiens: A Brief History of Humankind
- Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
- Shoe Dog: A Memoir by the Creator of Nike
- The Library Book
- The Unwinding: An Inner History of the New America
- Never Split the Difference: Negotiating As If Your Life Depended On It
- Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
- Yes Please
- A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
- Grit: The Power of Passion and Perseverance

You are on page 1of 2

(150 points)

Colonel Miles Quaritch is about to attack Pandora to drive away the colony

of the Na’vi from the region near the Unobtanium mines. And it is upto our

hero Jake Sully to devise a strategy to save the Na’vi. Now, it is known that

the Pandoran ecology forms a vast neural network spanning the entire plane-

tary surface into which the Na’vi and other creatures can connect. There is a

collection of special points in this neural network, which, if destroyed, would

kill the Tree of Souls, thus spelling disaster for the Na’vi. It is upto Jake Sully

and co. to find out these special points and protect them at all cost.

Some points in the neural network have a collection of neural whips. Let N

be the number of whips at a point. First, we find out in how many ways N can

be written as a sum of integers such that each integer is of the form 3k + 2. This

value is known as the strength of the point. However, the sums are ordered,

that is N = a1 + a2 is not the same as N = a2 + a1 . If the strength of the point

exceeds a certain threshold, then the point is a special point. Jake and Neytiri

have listed a set of points which can possibly be special points, and wish to

compute the strength of the points. Being lousy at mathematics and program-

ming, they have asked you, an ace coder, to solve this problem for them. Can

you help our heroes save the Tree of Souls?

Input format:

First line contains a positive integer with the number of possible special points

(P).

The next P lines contain one integer N denoting the number of neural whips at

a point.

Output format:

For each point, output one line containing the strength of the point modulo

10000.

Sample Input:

2

4

1

7

Sample Output:

1

2

- Problem 8Uploaded byashishtrivediscr
- Problem 7Uploaded byashishtrivediscr
- Problem 5Uploaded byashishtrivediscr
- Problem 4Uploaded byashishtrivediscr
- Problem 3Uploaded byashishtrivediscr
- Problem 2Uploaded byashishtrivediscr
- Bitwise Solutions 2010Uploaded byashishtrivediscr
- Problem 1: Help the Tree of SoulsUploaded byashishtrivediscr
- ASPHand BookUploaded byarchana_chary16