Anik_Akash

1010 - Knights in Chessboard

Oct 27th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. //thanks God For Every Thing!
  2. //contest link: http://www.lightoj.com/volume_showproblem.php?problem=1010
  3.  
  4. //#include<bits/stdc++.h>
  5. #include <iostream>
  6. #include <fstream>
  7. #include <string>
  8. #include <algorithm>
  9. #include <cmath>
  10. #include <cstdio>
  11.  
  12. /*
  13.  
  14.            
  15.  
  16. */
  17. #define pi           acose(-1)
  18. #define flush        cin.ignore(numeric_limits<streamsize>::max(),'\n');
  19. #define wow          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  20. #define NL           printf("\n")
  21. #define fin          freopen("int.txt","r",stdin);
  22. #define fout         freopen("out.txt","w",stdout);
  23.  
  24.  
  25. using namespace std;
  26.  
  27. typedef long long int ll;
  28. typedef double dl;
  29.  
  30. // ---------------------- slove---------------------------//
  31.  
  32.  
  33. int main()
  34. {
  35.     //fin
  36.     //fout
  37.    
  38.    int t, n, c1, c2, to=0, fix_ans;
  39.    dl ans;
  40.    scanf("%d",&t);
  41.  
  42.    for(int i=1; i<=t; i++)
  43.    {
  44.        scanf("%d %d",&c1,&c2);
  45.        to = c1*c2;
  46.        ans = (to*1.0)/2;
  47.        fix_ans = ceil(ans);
  48.        printf("Case %d: %d\n", i, fix_ans);
  49.    }
  50.    
  51.     return 0;
  52. }
  53. //author anikaksh;
Add Comment
Please, Sign In to add comment