Codeforces 617A Elephant
来源:互联网 发布:史丹利快报的淘宝店 编辑:程序博客网 时间:2024/04/26 15:41
An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at point x(x > 0) of the coordinate line. In one step the elephant can move 1, 2, 3, 4 or 5 positions forward. Determine, what is the minimum number of steps he need to make in order to get to his friend's house.
The first line of the input contains an integer x (1 ≤ x ≤ 1 000 000) — The coordinate of the friend's house.
Print the minimum number of steps that elephant needs to make to get from point 0 to point x.
5
1
12
3
In the first sample the elephant needs to make one step of length 5 to reach the point x.
In the second sample the elephant can get to point x if he moves by 3, 5 and 4. There are other ways to get the optimal answer but the elephant cannot reach x in less than three moves.
#include <iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<stack>#include<queue>using namespace std;int main(){ int g; while(~scanf("%d",&g)) { int sum=g/5; if(g%5!=0) sum++; printf("%d\n",sum); } return 0;}
- Codeforces 617A Elephant
- CodeForces 617A Elephant
- CodeForces 617A Elephant
- Codeforces 617A-Elephant
- 【CodeForces】[617A]Elephant
- CodeForces 617A Elephant
- codeforces 617A Elephant
- Codeforces 617A Elephant 【水题】
- Problem--617A--Codeforces-- A. Elephant
- CodeForces 617 A. Elephant(水~)
- CodeForces 15A Elephant
- <codeforces>A. Little Elephant and Rozdil
- CodeForces 220A Little Elephant and Problem
- codeforces 204A Little Elephant and Interval
- CodeForces 204A Little Elephant and Interval
- CodeForces 204A Little Elephant and Interval
- Codeforces Round #340 (Div. 2):A. Elephant
- Codeforces Elephant
- Python-装饰器以及对带有参数的装饰器的理解
- AFNetworking 原作者都无法解决的问题: 如何使用ip直接访问https网站?
- Codeforces 617C Watering Flowers 【暴力 数据范围】
- Java 包
- c中定义变量的内存分配顺序问题(极易错!!!)
- Codeforces 617A Elephant
- Codeforces 617B Chocolate
- Codeforces D Polyline
- C++链表
- HDOJ 5611 Baby Ming and phone number
- 咱码农为啥会(珍爱生命)远离企业应用开发
- HDOJ 5610 Baby Ming and Weight lifting
- UVa 489 Hangman Judge
- 领导喜欢什么样的人