Codeforces 1476A - K-divisible Sum Solution
Solution in C++:
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- long long int t;
- cin>>t;
- while(t--)
- {
- long long int n,k,r;
- cin>>n>>k;
- if(n%k==0)
- cout<<"1"<<endl;
- else if(k%n==0)
- cout<<k/n<<endl;
- else if(n>k)
- cout<<"2"<<endl;
- else
- cout<<(k/n)+1<<endl;
- }
- }
No comments