├── README.md ├── input.txt ├── main.cpp └── output.txt /README.md: -------------------------------------------------------------------------------- 1 | # C-plusplus-compitative-Programming-Template 2 | 3 | ## Tech We Used 4 | 5 | - C++ 6 | 7 | ## Features 8 | 9 | - Easy to compile 10 | - Easy debug facility 11 | - Analysised and optimized base template 12 | 13 | ## Steps to run in your machine 14 | 15 | Clone the rep and code in solve() in main.cpp file 16 | 17 | #### Run the following commands 18 | ``` 19 | gcc main.cpp 20 | ``` 21 | 22 | 23 | 24 | 25 | #### Hope you liked this project, dont forget to ⭐ the repo. 26 | -------------------------------------------------------------------------------- /input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 2 3 1 1 3 | 4 4 1 2 4 | 3 5 2 2 5 | 5 1 2 1 6 | 3 1 3 1 7 | 1 1 1 1 8 | 1000000000 1000000000 1000000000 50 9 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | template ostream& operator<<(ostream &os, const pair &p) { return os << '(' << p.first << ", " << p.second << ')'; } 6 | void dbg_out() { cerr << endl; } 7 | #ifndef ONLINE_JUDGE 8 | #define dbg(x) cerr << #x<< " = " < v; 49 | cin>>m>>n>>pos>>pos1; 50 | if(pos ==1 && pos1 >= 1){ 51 | x1 = n; 52 | y1 = 1; 53 | x2 = n; 54 | y2 = n; 55 | } 56 | if(pos ==m && pos1 >= 1){ 57 | x1 = 1; 58 | y1 = 1; 59 | x2 = n; 60 | y2 = n; 61 | } 62 | if(pos1 ==1 && pos >= 1){ 63 | x1 = 1; 64 | y1 = n; 65 | x2 = n; 66 | y2 = n; 67 | } 68 | if(pos1 ==m && pos >= 1){ 69 | x1 = 1; 70 | y1 = 1; 71 | x2 = n; 72 | y2 = 1; 73 | } 74 | if(pos >1 && pos1 > 2){ 75 | x1 = 1; 76 | y1 = 1; 77 | x2 = n; 78 | y2 = 1; 79 | } 80 | 81 | 82 | cout<>tc; 93 | while (tc--) { 94 | solve(); 95 | } 96 | 97 | //solve(); 98 | } 99 | -------------------------------------------------------------------------------- /output.txt: -------------------------------------------------------------------------------- 1 | 1 3 3 3 2 | 4 1 4 4 3 | 4 1 4 4 4 | 1 1 1 1 5 | 1 1 1 1 6 | 1 1 1 1 7 | 1 1 1000000000 1000000000 8 | --------------------------------------------------------------------------------