Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- #include <ext/pb_ds/assoc_container.hpp>
- using namespace __gnu_pbds;
- typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
- #define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- #define endl "\n"
- #define mn int main()
- #define frac() cout.unsetf(ios::floatfield);cout.precision(6);cout.setf(ios::fixed,ios::floatfield);
- mn
- {
- suni;
- int n,s,ans=0;
- cin>>n>>s;
- for(int i=0;i<=n;i++){
- for(int j=0;j<=n;j++){
- for(int k=0;k<=n;k++){
- if((i+j+k)==s) ans++;
- }
- }
- }
- cout<<ans<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment