Elephant

简介: Elephant

文章目录

一、Elephant

总结


一、Elephant

本题链接:Elephant


题目:

A. Elephant

time limit per test1 second

memory limit per test256 megabytes

inputstandard input

outputstandard output

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.


Input

The first line of the input contains an integer x (1 ≤ x ≤ 1 000 000) — The coordinate of the friend’s house.


Output

Print the minimum number of steps that elephant needs to make to get from point 0 to point x.


Examples


input

5

output

1


input

12

output

3


Note

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.


本博客给出本题截图:

image.png

题意:每次可以走1,2,3,4,5步,问走到n最少需要几步

AC代码

#include <iostream>
using namespace std;
int main()
{
  int n, i = 0;
  cin >> n;
  for (i = 0; n > 0; i ++ )
    n -= 5;
  cout << i << endl;
  return 0;
}

总结

水题,不解释


目录
相关文章
|
存储 关系型数据库 Java
数据COOL谈第3期
本文整理自阿里巴巴大淘宝技术部双12队长朱成(锡泽),阿里巴巴业务平台双11队长徐培德(裴度),阿里巴巴数据库双11队长陈锦赋(智盛),InfoQ主编王一鹏,在数据COOL谈第3期的分享。
|
C# C++
Cool说丨力扣237、206与21
237. 删除链表中的节点 206. 反转链表 21. 合并两个有序链表
81 0
|
C# C++
Cool说丨717与674
717. 1比特与2比特字符 674. 最长连续递增序列
74 0
|
人工智能 BI C#
Cool说丨884与1207
[884. 两句话中的不常见单词](https://leetcode-cn.com/problems/uncommon-words-from-two-sentences/) [1207. 独一无二的出现次数](https://leetcode-cn.com/problems/unique-number-of-occurrences/)
94 0
|
C# C++
Cool说丨819
819. 最常见的单词
95 0
|
自然语言处理 C# C++
Cool说丨970与720
970. 强整数 720. 词典中最长的单词
104 0
|
C# C++
Cool说丨力扣290与645
[290. 单词规律](https://leetcode-cn.com/problems/word-pattern/) [645. 错误的集合](https://leetcode-cn.com/problems/set-mismatch/)
68 0
|
C# C++
Cool说丨力扣5461
[5461. 仅含 1 的子串数](https://leetcode-cn.com/problems/number-of-substrings-with-only-1s/)
52 0
|
C# C++
Cool说丨力扣13
[13. 罗马数字转整数](https://leetcode-cn.com/problems/roman-to-integer/)
65 0
|
C# C++
Cool说丨力扣287/792/378
关注博主,获取更多知识
104 0