Advertisement
esraa_syam

Untitled

Oct 30th, 2022
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define nl "\n"
  3. #define fi first
  4. #define se second
  5. #define pi 3.14159
  6. #define ll long long
  7. #define odd(a) (a&1)
  8. #define even(a) !(a&1)
  9. #define Mod 1'000'000'007
  10. #define INF 2'000'000'000
  11. #define sz(x) int(x.size())
  12. #define charToInt(s) (s - '0')
  13. #define ull unsigned long long
  14. #define number_line iota(all(vec) , 1)
  15. #define all(s) s.begin(), s.end()
  16. #define rall(v) v.rbegin() , v.rend()
  17. #define fixed(n) fixed << setprecision(n)
  18. #define Num_of_Digits(n) ((int)log10(n) + 1)
  19. #define to_decimal(bin) stoll(bin, nullptr, 2)
  20. #define Ceil(n, m) (((n) / (m)) + ((n) % (m) ? 1 : 0))
  21. #define Floor(n, m) (((n) / (m)) - ((n) % (m) ? 0 : 1))
  22. #define Upper(s) transform(all(s), s.begin(), ::toupper);
  23. #define Lower(s) transform(all(s), s.begin(), ::tolower);
  24. #define cout_map(mp) for(auto& [f, s] : mp) cout << f << " " << s << "\n";
  25. // ----- bits-------
  26. #define pcnt(n) __builtin_popcount(n)
  27. #define pcntll(n) __builtin_popcountll(n)
  28. #define clz(n) __builtin_clz(n) // <---100
  29. #define clzll(n) __builtin_clzll(n)
  30. #define ctz(n) __builtin_ctz(n) // 0001---->
  31. #define ctzll(n) __builtin_ctzll(n)
  32.  
  33. using namespace std;
  34.  
  35. template < typename T = int > istream& operator >> (istream &in, vector < T > & v){
  36. for(auto & x : v) in >> x;
  37. return in;
  38. }
  39.  
  40. template < typename T = int > ostream& operator << (ostream &out, const vector < T > & v){
  41. for(const T & x : v) out << x << " ";
  42. return out;
  43. }
  44.  
  45. void esraa()
  46. {
  47. ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  48. #ifndef ONLINE_JUDGE
  49. freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  50. #endif
  51. }
  52. void solve(){
  53. int n;
  54. cin >> n;
  55. int a1 = 0 , a2 = 0 , a3 = 0 , a4 = 0 ;
  56. if(n >= 5){
  57. a1 = n / 5;
  58. n %= 5;
  59. }
  60. if(n >= 4){
  61. a2 = n / 4;
  62. n %= 4;
  63. }
  64. if(n >= 3){
  65. a3 = n / 3;
  66. n %= 3;
  67. }
  68. if(n >= 2){
  69. a4 = n / 2;
  70. n %= 2;
  71. }
  72. cout << a1 + a2 + a3 + a4 + (n > 0) << nl;
  73. }
  74. int main()
  75. {
  76. esraa();
  77. int t = 1;
  78. //cin >> t;
  79. while(t--)
  80. solve();
  81. return 0;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement