fork download
  1.  
  2. //Author : Ujjawal Dixit , ABV-IIITM
  3. //Task : test
  4.  
  5. #include <bits/stdc++.h>
  6. #define MOD 1000000007
  7. #define MAX 1e9
  8. #define MIN -1e9
  9. using namespace std;
  10. typedef double ld;
  11. typedef long long ll;
  12. typedef vector<int> vi;
  13. typedef vector<vi> vvi;
  14. typedef pair<int,int> ii;
  15. #define FOR(i,n,m) for(int i=0;i<n;i+=m)
  16. #define For(i,n,m) for(int i=1;i<=n;i+=m)
  17. #define max(a,b) (a>=b?a:b)
  18. #define min(a,b) (a<b?a:b)
  19. #define countbits(num) __builtin_popcount(num)
  20. #define countbitsll(num) __builtin_popcountll(num)
  21. #define s(a) scanf("%d",&a)
  22. #define sll(a) scanf("%lld",&a)
  23. #define p(a) printf("%d",a)
  24. #define pll(a) printf("%lld",a)
  25. #define pln() printf("\n")
  26. #define getstr(in) getline(cin,in)
  27. #define getc() getchar()
  28. #define uj() int t; scanf("%d",&t); while(t--)
  29. ll mpow(ll a, ll n)
  30. {ll ret=1;ll b=a;while(n) {if(n&1)
  31. ret=(ret*b)%MOD;b=(b*b)%MOD;n>>=1;}
  32. return (ll)ret;}
  33. template<typename T> T gcd(T a, T b) {
  34. if(!b) return a;
  35. return gcd(b, a % b);
  36. }
  37. template<typename T> T lcm(T a, T b) {
  38. return a * b / gcd(a, b);
  39. }
  40. int main()
  41. {
  42. int t, r, c, w;
  43. cin >> t;
  44. for (int i = 0; i<t; i++)
  45. {
  46. int res = 0;
  47. cin >> r >> c >> w;
  48.  
  49.  
  50. res = c / w *r;
  51.  
  52. res += w - 1;
  53. if (c%w != 0)
  54. res++;
  55. cout << "Case #" << i + 1 << ": " << res << endl;
  56. }
  57.  
  58. return 0;
  59. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
Standard output is empty