The struggling little snail

Source: Internet
Author: User

* * Legends can stand at the top of the pyramid only two kinds of animals, one is an eagle, a snail. A little snail listened to this legend, greatly encouraged, determined to climb the pyramid. In order to realize their dream, the snail found the eagle, the Eagle
Tell it pyramid high h meter, small snail know one day oneself can climb up 10 meters, but because the night to rest, oneself will fall 5 meters. It wants to know that he can stand at the top of the pyramid for the first few days, and it wants you to help him write a program to help it.
Input
The first line has an integer t that represents the test data for the T Group.
The second line, an integer H (0Output
Output an integer n means the little snail standing on top of the pyramid
Sample input
2
1
5 Sample output
1
1
*/

#include <stdio.h>
int main ()
{
int t,h;
scanf ("%d", &t);
while (t--)
{
scanf ("%d", &h);
if (h<=10)
printf ("1\n");
else if (h%5==0)
printf ("%d\n", (h/5-1));
else printf ("%d\n", H/5);
}
System ("pause");
return 0;
}

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.