Codeforces 682A. Alyona and Numbers Solution
Click :Hints
Solution in C++:
///**********ALLAH IS ALMIGHTY************///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- ll findCountOfPairs(ll a, ll b,ll n)
- {
- ll ans = 0;
- for (ll i = 1; i <= a; i++) {
- ans += b / n;
- ans += (i % n + b % n) >= n ? 1 : 0;
- }
- return ans;
- }
- int main()
- {
- ll a , b , n = 5;
- cin>>a>>b;
- cout << findCountOfPairs(a, b, n)<<endl;
- return 0;
- }
No comments