Created
January 6, 2016 09:57
-
-
Save abrarShariar/b50d2efa67caa4d0fc84 to your computer and use it in GitHub Desktop.
Ecstatic Super Mario (SPOJ) -Programming Problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PROBLEM STATEMENT: http://www.spoj.com/problems/ECSTATIC/ | |
//ACCEPTED | |
#include<iostream> | |
#include<cmath> | |
int main(){ | |
int testCase; | |
std::cin>>testCase; | |
for(int i=0;i<testCase;i++){ | |
int times; | |
int n1,n2; | |
int length=0; | |
std::cin>>times; | |
for(int j=0;j<times;j++){ | |
std::cin>>n1>>n2; | |
int sub=std::abs(n2-n1); | |
if(sub>length){ | |
length=sub; | |
} | |
} | |
std::cout<<"Case "<<i+1<<": "<<length<<std::endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment