Friday, June 1, 2018

UVA - 12918 .cpp file

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long key, door,t;
    cin>>t;
    while(t--)
    {
        cin>>key>>door;
        printf( "%lld\n", ( door-1 + door-key ) * key / 2 );
    }
}

No comments:

Post a Comment