diff --git a/500 to 1000 difficulty rating/639_Police_and_Thief.cpp b/500 to 1000 difficulty rating/639_Police_and_Thief.cpp new file mode 100644 index 0000000..92e56e7 --- /dev/null +++ b/500 to 1000 difficulty rating/639_Police_and_Thief.cpp @@ -0,0 +1,23 @@ +// https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/POLTHIEF?tab=statement +#include +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; + } + } + +}