From a7d9d1fa853cdac8504b166fd162e8d4167be2b6 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Sun, 18 Jun 2023 22:42:31 +0600 Subject: [PATCH] initial commit --- 1721B Deadly Laser/1721B.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 1721B Deadly Laser/1721B.cpp diff --git a/1721B Deadly Laser/1721B.cpp b/1721B Deadly Laser/1721B.cpp new file mode 100644 index 0000000..2e8c472 --- /dev/null +++ b/1721B Deadly Laser/1721B.cpp @@ -0,0 +1,27 @@ +#include +using namespace std; + +void solve() +{ + int n, m, s1, s2, d; + cin >> n >> m >> s1 >> s2 >> d; + bool pass=true; + if (s1+d>=n && s2+d>=m) pass=false; + else if (s1-d<=1 && s2-d<=1) pass=false; + else if (s1+d>=n && s1-d<=1) pass=false; + else if(s2+d>=m && s2-d<=1) pass=false; + if(pass) cout<> TC; + cin.ignore(); + while (TC--) + solve(); +} \ No newline at end of file