Saleh127

CF Z contest

Jul 8th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9.  
  10. ll a,c,d=0,e,f,i,j,k,l;
  11. cin>>a>>c;
  12. for(i=0;i<=a;i++)
  13. {
  14. for(j=0;j<=a;j++)
  15. {
  16. e=c-i-j;
  17. if(e>=0 && e<=a && i+j+e==c)
  18. {
  19. d++;
  20. }
  21. }
  22. }
  23. cout<<d<<endl;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment