Advertisement
K_Y_M_bl_C

Untitled

May 5th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.47 KB | None | 0 0
  1. #define TASK "fire"
  2. #define _CRT_SECURE_NO_WARNINGS
  3.  
  4. #pragma comment(linker, "/STACK:66777216")
  5. #include <iostream>
  6. #include <cstdio>
  7. #include <cmath>
  8. #include <vector>
  9. #include <ctime>
  10. #include <map>
  11. #include <set>
  12. #include <string>
  13. #include <queue>
  14. #include <deque>
  15. #include <cassert>
  16. #include <cstdlib>
  17. #include <bitset>
  18. #include <algorithm>
  19. #include <string>
  20. #include <list>
  21. #include <fstream>
  22. #include <cstring>
  23. #include <climits>
  24. #include <stack>
  25. #include <random>
  26.  
  27. using namespace std;
  28.  
  29. typedef unsigned long long ull;
  30. typedef long long ll;
  31. typedef pair<int, int> pii;
  32. typedef vector<int> vi;
  33. typedef pair<string, int> psi;
  34. typedef vector<string> vs;
  35. typedef pair<ll, ll> pll;
  36. typedef vector<ll> vll;
  37. typedef vector<char> vc;
  38. typedef vector<pii> vpii;
  39. typedef vector<pair<ll, ll> > vpll;
  40. typedef long double ld;
  41.  
  42. #define forn(i, n) for (int i = 0; i < (int)n; i++)
  43. #define for1(i, n) for (int i = 1; i <= (int)n; i++)
  44. #define forq(i, s, t) for (int i = s; i <= t; i++)
  45. #define ford(i, s, t) for (int i = s; i >= t; i--)
  46. #define mk make_pair
  47. #define inb push_back
  48. #define outb pop_back
  49. #define ump unordered_map
  50. #define all(v) v.begin(), v.end()
  51. #define X first
  52. #define Y second
  53. #define TIME clock() * 1.0 / CLOCKS_PER_SEC
  54. #define randint(x,y)
  55. #define randlong(x, y)
  56. #define double long double
  57. #define sqr(x) (x) * (x)
  58. #define y1 amdknkgsdaasdwapgnpikn
  59. //
  60. #define mp make_pair
  61. #define pb push_back
  62. #define XX first
  63. #define YY second
  64. //
  65.  
  66. const ld EPS = 1e-9;
  67. const ld pi = acos(-1.0);
  68.  
  69. const int MAXN = (int)1e5 + 7;
  70. const ll INF = (ll)2147483647;
  71. const ll LINF = (ll)8e18;
  72. const int MOD = (ll)1e9 + 7;
  73. const int CHASH = (ll)239017;
  74. const ld DINF = (ld)1000000000000000.0;
  75.  
  76. void gen();
  77. int solve();
  78.  
  79. int main()
  80. {
  81.     ios::sync_with_stdio(false);
  82.     cin.tie(0);
  83. #ifdef _DEBUG
  84.     gen();
  85.     freopen("input.txt", "r", stdin);
  86.     freopen("output.txt", "w", stdout);
  87.     freopen("test.txt", "w", stderr);
  88.     ld tstart = TIME;
  89. #else
  90.     //freopen(TASK".in", "r", stdin), freopen(TASK".out", "w", stdout);
  91.     //freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout), freopen("test.txt", "w", stderr);
  92.     srand(228);
  93. #endif
  94.     solve();
  95. #ifdef _DEBUG
  96.     ld tend = TIME;
  97.     cerr << tend - tstart << " s.\n";
  98. #endif
  99.     return 0;
  100. }
  101.  
  102. void gen()
  103. {
  104.     freopen("input.txt", "a+", stdout);
  105.     srand(time(0));
  106.     return;
  107. }
  108.  
  109. bool equal(double a, double b) { return abs(a - b) < EPS; }
  110.  
  111. struct Point
  112. {// vector
  113.     double x, y;
  114.     Point() {};
  115.     Point(double x, double y) : x(x), y(y) {};
  116.     //point mul by double
  117.     Point operator*(double d) { return Point(x * d, y * d); }
  118.     //point + vector
  119.     Point operator+(Point p) { return Point(x + p.x, y + p.y); }
  120.     Point operator-(Point p) { return Point(x - p.x, y - p.y); }
  121.     //dotProduct
  122.     double operator%(Point p) { return x * p.x + y * p.y; }
  123.     // crossProduct
  124.     double operator*(Point p) { return x * p.y - y * p.x; }
  125.     // rasstoyanie
  126.     double distancetoPoint(Point p)
  127.     {
  128.         return sqrt((x - p.x) * (x - p.x) + (y - p.y) * (y - p.y));
  129.     }
  130.     // vector length \ distance from zero to Point
  131.     double len() { return sqrt(x * x + y * y); }
  132.     double angle(Point p) { return atan2((*this) * p, (*this) % p); }
  133.     // turnByAngle
  134.     Point turnByAngle(double a) {
  135.         double cosa = cos(a); double sina = sin(a);
  136.         return Point(x * cosa - y * sina, x * sina + y * cosa);
  137.     }
  138. };
  139.  
  140. Point makeV(Point a, Point b) { return a - b; }
  141. const Point NULLP = Point(-239239, 1488228);
  142. const Point SOVP = Point(13888, 888283);
  143.  
  144. struct Line {
  145.     double a, b, c;
  146.  
  147.     Line(Point p, Point t) {
  148.         a = t.y - p.y; // -n.y
  149.         b = p.x - t.x; // n.x
  150.         c = -a * p.x - b * p.y;
  151.     }
  152.  
  153.     // oriented!!!
  154.     double distanceFromPoint(Point p) {
  155.         return (a * p.x + b * p.y + c) / Point(a, b).len();
  156.     }
  157.  
  158.     bool operator||(Line l) {
  159.         return equal(Point(a, b) * Point(l.a, l.b), 0);
  160.     }
  161.  
  162.     Point operator^(Line l) {
  163.         if (equal(l.a, a) && equal(l.b, b) && equal(l.c, c))
  164.             return SOVP;
  165.         double d = Point(a, b) * Point(l.a, l.b);
  166.         if (equal(d, 0)) return NULLP;
  167.         double x = (b * l.c - l.b * c) / d;
  168.         double y = (c * l.a - l.c * a) / d;
  169.         return Point(x, y);
  170.     }
  171. };
  172.  
  173. int n;
  174.  
  175. int solve()
  176. {
  177.     cin >> n;
  178.     int ans1 = 0, ans2 = 0;
  179.     {
  180.         int wknd = 1;
  181.         while (wknd <= n)
  182.         {
  183.             if (wknd <= n)
  184.                 ++wknd, ++ans1;
  185.             if (wknd <= n)
  186.                 ++wknd, ++ans1;
  187.             wknd += 5;
  188.         }
  189.     }
  190.     {
  191.         int wknd = 6;
  192.         while (wknd <= n)
  193.         {
  194.             if (wknd <= n)
  195.                 ++wknd, ++ans2;
  196.             if (wknd <= n)
  197.                 ++wknd, ++ans2;
  198.             wknd += 5;
  199.         }
  200.     }
  201.     cout << ans2 << " " << ans1;
  202.     return 0;
  203. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement