Friday, May 27, 2016

uva problem 10963 - The Swallowing Ground - solution

Unknown
#include<iostream>
using namespace std;

int main()
{
    int t,w;
    cin>>t;
    while (t--)
    {
        cin>>w;
        int y1,y2,y[w],flag=1;
        for (int i=0;i<w;i++)
        {
            cin>>y1>>y2;
            y[i]=y1-y2;
            if (y[0]!=y[i]) flag=0;
        }
        if (flag) cout<<"yes"<<endl;
        else cout<<"no"<<endl;
        if (t) cout<<endl;
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,