https://www.codechef.com/LRNDSA02/problems/ZCO15004

Why is my Answer Wrong in the Question Rectangle?
Here’s my Code:
#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(ll i=a; i<b; ++i)
#define BOOST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(v) v.begin(),v.end()
#define ld double
#define pie 3.1415926536
#define hell 1000000007
#define b 100000
#define l 500
using namespace std;
void solve()
{
ll n,x,y; cin>>n>>x>>y;
vector vec;
ll ans=1;
rep(i,0,n)
{
cin>>x>>y;
vec.pb(x);
}sort(all(vec));
rep(i,0,n-1)
{
ans=max(ans,(vec[i+1]-vec[i])*l);
}cout<<max(ans,(b-vec[n-1])*l);
}
int main()
{
BOOST
int T=1;// cin>>T;
while(T–) solve();
return 0;
}

Please Check my Logic… I think it’s correct but I am getting Wrong Answer. Please Tell any Example Test Case Where my Logic fails ??