Josif_tepe

Untitled

Apr 22nd, 2026
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int t, strana;
  5.     cin >> t >> strana;
  6.    
  7.     int S = 1, E = 4 * t;
  8.    
  9.     for(int i = 0; i < t; i++) {
  10.        
  11.         if(strana == S) {
  12.             cout << S + 1 << " " << E - 1 << " " << E << endl;
  13.         }
  14.         if(strana == S + 1) {
  15.             cout << S << " " << E - 1 << " " << E << endl;
  16.         }
  17.         if(strana == E - 1) {
  18.             cout << S << " " << S + 1 << " " << E << endl;
  19.         }
  20.         if(strana == E) {
  21.             cout << S << " " << S + 1 << " " << E - 1 << endl;
  22.         }
  23.         S += 2;
  24.         E -= 2;
  25.     }
  26.  
  27.     return 0;
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment