Hdoj 1248 ice throne "full backpack"

Source: Internet
Author: User

Ice ThroneTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 13257 Accepted Submission (s): 6774


Problem description The undead Lich King, the Death Knight got an n-dollar bill (remember, only a note), in order to prevent his frequent death in the battle, he decided to buy himself some props, so he came to the Goblin store before.

Death Knight: "I want to buy props!"

Goblin businessman: "We have three kinds of props here, 150 pieces of blood bottle, a magic medicine 200 pieces of one, invincible potion 350 pieces of one."

Death Knight: "All Right, give me a blood bottle."

He took out the N-dollar bill and handed it to the Goblin merchant.

Goblin businessman: "I forgot to remind you that we do not have the habit of looking for guests money here, more money we all when the tip received, hey."

Death Knight: "..."

Death Knight thought, rather than the money as a tip to send him as much as he bought a little props, anyway, after all to buy, early bought to put in the home, but to try to make him less to earn tips.

Now the Death Knight wants you to help him figure out how much he should tip the Goblin merchant at least.
The first line of input data is an integer T (1<=t<=100), which represents the number of test data. Then the T-line test data, each test data contains only a positive integer n (1<=n<=10000), n represents the face value of the money in the Death Knight's hand.

Note: The Goblin store has only three items described in the title.

Output for each set of test data, please export the Death Knight at least how much money to waste to the goblin businessman as a tip.

Sample Input
2900250

Sample Output
050

Code:


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Hdoj 1248 ice throne "full backpack"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.