1168 -- 奋斗的小蜗牛

来源:互联网 发布:linux netcat反向shell 编辑:程序博客网 时间:2024/06/14 13:53

奋斗的小蜗牛

Time Limit:1000MS  Memory Limit:65536K
Total Submit:139 Accepted:89

Description

传说中能站在金字塔顶的只有两种动物,一种是鹰,一种是蜗牛。一只小蜗牛听了这个传说后,大受鼓舞,立志要爬上金字塔。为了实现自己的梦想,蜗牛找到了老鹰,老鹰告诉它金字塔高H米,小蜗牛知道一个白天自己能向上爬10米,但由于晚上要休息,自己会下滑5米。它想知道自己在第几天能站在金字塔顶,它想让你帮他写个程序帮助它。

Input

第一行有一个整数t,表示t组测试数据。
第二行一个整数H(0 < H < 10^9)代表金字塔的高度。

Output

输出一个整数n表示小蜗牛第n天站在金字塔顶上

Sample Input

215

Sample Output

11

Source

    using System;    using System.Collections.Generic;    using System.Linq;    using System.Text;    namespace AK1168 {        class Program {            static void Main(string[] args) {                int n = int.Parse(Console.ReadLine());                while (n-- > 0) {                    int h = int.Parse(Console.ReadLine());                    if (h <= 10) Console.WriteLine("1");                    else {                        if (h % 5 == 0)                            Console.WriteLine(h / 5 - 1);                        else                            Console.WriteLine(h / 5);                    }                }            }        }    }


0 0
原创粉丝点击