Skip to content

Instantly share code, notes, and snippets.

@abrarShariar
Created January 6, 2016 09:57
Show Gist options
  • Save abrarShariar/b50d2efa67caa4d0fc84 to your computer and use it in GitHub Desktop.
Save abrarShariar/b50d2efa67caa4d0fc84 to your computer and use it in GitHub Desktop.
Ecstatic Super Mario (SPOJ) -Programming Problem
//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