Codeforces 1589B. Coloring Rectangles Solution
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,m,n;
- cin>>t;
- while(t--)
- {
- cin>>m>>n;
- if((m*n)%3==0)
- cout<<(m*n)/3<<endl;
- else
- cout<<((m*n)/3)+1<<endl;
- }
- }
No comments