Advertisement
Robert_JR

Hasan Fib Soln

Jul 6th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <math.h>
  5. #include <string>
  6. #include <cstdlib>
  7. #include <cstring>
  8. #include <stack>
  9. #include <queue>
  10. #include <vector>
  11. #define IN freopen("f:\\in.txt", "rt", stdin);
  12. #define OUT freopen("f:\\out.txt", "wt", stdout);
  13. #define FOR(n) for(int i = 0; i < n; i++)
  14. #define LL long long int
  15. #define STESTCASE int t;scanf("%d", &t);getchar();for(int tc = 1; tc <= t; tc++)
  16. #define TESTCASE int t;scanf("%d", &t);for(int tc = 1; tc <= t; tc++)
  17. #define PF printf
  18. #define SF scanf
  19. #define EP 0.000000001
  20. #define MAX 1000
  21. using namespace std;
  22.  
  23. int main()
  24. {
  25.     //IN OUT
  26.     long long m , n;
  27.  
  28.     TESTCASE
  29.     {
  30.         int even = 0, odd = 0;
  31.  
  32.         cin >> m >> n;
  33.         for(long long i = m; i <= n; i++)
  34.         {
  35.             if((i-1) % 3 == 0) even++;
  36.             else odd++;
  37.         }
  38.  
  39.         PF("Case %d:\nOdd = %d\nEven = %d\n\n", tc, odd, even);
  40.     }
  41.  
  42.  
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement