Skip to content

Commit

Permalink
Create 639_Police_and_Thief.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
rajvikash18113 committed Nov 8, 2024
1 parent b77c440 commit 492f20d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 500 to 1000 difficulty rating/639_Police_and_Thief.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/POLTHIEF?tab=statement
#include <bits/stdc++.h>
using namespace std;

int main() {
// your code goes here
int t;
cin >> t;
while(t--)
{
int x, y;
cin >> x >> y;
if(x == y || x > y)
{
cout << x - y << endl;
}
else
{
cout << y - x << endl;
}
}

}

0 comments on commit 492f20d

Please sign in to comment.