Codeforces 682A. Alyona and Numbers Solution

 Click :Hints

 Solution in C++:

///**********ALLAH IS ALMIGHTY************///

///AH Tonmoy

///Department of CSE,23rd batch

///Islamic University,Bangladesh  

  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. ll findCountOfPairs(ll a, ll b,ll n)
  5. {
  6. ll ans = 0;
  7. for (ll i = 1; i <= a; i++) {
  8. ans += b / n;
  9. ans += (i % n + b % n) >= n ? 1 : 0;
  10.  
  11. }
  12. return ans;
  13. }
  14. int main()
  15. {
  16. ll a , b , n = 5;
  17. cin>>a>>b;
  18. cout << findCountOfPairs(a, b, n)<<endl;
  19. return 0;
  20. }

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.