From 492f20d1e05db29fbcd37fe85e16df25a8baae60 Mon Sep 17 00:00:00 2001 From: Vikash Kumar Date: Fri, 8 Nov 2024 18:20:55 +0530 Subject: [PATCH] Create 639_Police_and_Thief.cpp --- .../639_Police_and_Thief.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 500 to 1000 difficulty rating/639_Police_and_Thief.cpp 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; + } + } + +}