2 solutions

  • 0
    @ 2025-12-6 11:32:28
    #include<bits/stdc++.h>
    using namespace std;
    #define FAST_IO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
    #define int long long
    int x,y; 
    signed main()
    {
    	FAST_IO;
    	while(1)
    	{
    		cin>>x>>y;
    		if(x==-1&&y==-1) break;
    		cout<<(x+y)*(y-x+1)/2<<'\n';
    	}
    	return 0;
    }
    

    Information

    ID
    73
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By