Mourning the 512 Wenchuan earthquake--Be sure to remember I love youTime
limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 9572 Accepted Submission (s): 5819
Problem description When rescuers found her, she was dead, was crushed down the house to die, through the ruins of the gap can see her death posture, knees, the entire upper body creeping forward, the hands of the ground to support the bodies, some like the ancients to kneel down the ceremony, It's just the body being crushed. Rescue workers from the ruins of the gap reached to confirm that she has died, and in the ruins shouted a few, with a crowbar on the bricks knocked a few, there is no response.
When the crowd walked to the next building, the rescue captain suddenly ran back and ran and shouted "come over." Before he came to her corpse, straining her hand into the woman's body, he touched a few loud shouts, "Someone, a child, still alive."
After some effort, people carefully to block her ruins, lying under her children, wrapped in a red yellow flower quilt, about 3, 4 months old, because the mother of the body sheltered, he was unharmed, hug out of time, he was still asleep, his sleeping face so that all the presence of people feel very warm.
Accompanying the doctor came to untie the quilt ready to do some inspection, found a cell phone stuffed in the quilt, the doctor subconsciously looked at the phone screen, found on the screen is a written text message "Dear Baby, if you can live, must remember I love you", see Accustomed to death doctor but in this moment tears, mobile phone transmission, Everyone who saw the text was crying ...
In front of a true story, although only a short more than 10 words, but we each can feel the love of the great. Fortunately, the baby is saved, and this is the best thing to inspire the rescue workers.
After the disaster relief needs a lot of personnel, and now just arrived a group of volunteers, they have a total of n (10<=n<=1000) people, according to the instructions of the command, they will be divided into emergency, medical and communications, such as 3 teams, and stipulated that Rescue teams need to account for half of the total number (if there is a decimal, then give up), medical teams need to occupy 2/3 of the remaining number (if there are decimals, then give up), the rest of the composition of the communications team. For example, a total of 55 people, then rescue teams for the 55/2=27, minus the rescue squad for 27 people left 28 people, the medical team for 28*2/3 = 18 people, communications teams for 55-27-18=10 people.
In order to ensure the smooth operation of the rescue work, the headquarters decided to assign each team a number of local guides, the principle is to assign a guide for each of the 10 volunteers (if there are less than 10 cases, also assigned a), now ask: How many guides will be assigned to this group of volunteers?
Input data first contains a positive integer c, which indicates a C set of test cases, followed by a C row of data, each line containing a positive integer n (10<=n<=1000), representing the total number of volunteers.
Output for each set of test data, export the required number of wizards, one row per output.
Sample Input
21455
Sample Output
36
#include <iostream> #include <stdlib.h> #include <stdio.h> #include <cmath> #include < Algorithm>using namespace Std;int Main () { int c; cin>>c; while (c--) { int n; cin>>n; int A=N/2; int b= (n-a) *2/3; int c=n-a-b; cout<< (a+9)/10+ (b+9)/10+ (c+9)/10<<endl; } return 0;}
Mourning the 512 Wenchuan earthquake--Be sure to remember I love you