diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-11-10 16:05:26 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-11-10 16:05:26 +0200 |
| commit | 95422138588572e08a1ee78e654741874f11cfa0 (patch) | |
| tree | 1a03ad9c57788546e804724ed4507f46c385263d /codeforces/BanBan | |
| parent | 42e25addbbce62e8bb43ab587b21c5bccb495bfb (diff) | |
| download | competitive-programming-95422138588572e08a1ee78e654741874f11cfa0.tar.xz competitive-programming-95422138588572e08a1ee78e654741874f11cfa0.zip | |
Added some new problems
Diffstat (limited to 'codeforces/BanBan')
| -rwxr-xr-x | codeforces/BanBan/main | bin | 0 -> 26952 bytes | |||
| -rw-r--r-- | codeforces/BanBan/main.cpp | 32 | ||||
| -rw-r--r-- | codeforces/BanBan/main_input0.txt | 3 | ||||
| -rw-r--r-- | codeforces/BanBan/main_input1.txt | 101 | ||||
| -rw-r--r-- | codeforces/BanBan/main_output0.txt | 4 | ||||
| -rw-r--r-- | codeforces/BanBan/main_output1.txt | 2 |
6 files changed, 142 insertions, 0 deletions
diff --git a/codeforces/BanBan/main b/codeforces/BanBan/main Binary files differnew file mode 100755 index 0000000..2102f9d --- /dev/null +++ b/codeforces/BanBan/main diff --git a/codeforces/BanBan/main.cpp b/codeforces/BanBan/main.cpp new file mode 100644 index 0000000..abe1f05 --- /dev/null +++ b/codeforces/BanBan/main.cpp @@ -0,0 +1,32 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + if (n == 1) { + cout << n << '\n' << 1 << " " << 2 << '\n'; + } else { + cout << n - 1 << '\n'; + vector<int> v(n); + int cnt = 0; + for (int i = 0; cnt != n - 1 && i < n; i++) { + if((3 * n - 1 - i) % 3 != 0) { + cerr << (3 * n - 1 - i) << endl; + v[i] = (3 * n - 1 - i); + cnt++; + } + } + // cerr << "n - 1 " << n - 1 << endl; + for (int i = 0; i < n - 1; i++) { + cout << i * 3 + 1 << " " << v[i] + 1 << endl; + } + } + } +} diff --git a/codeforces/BanBan/main_input0.txt b/codeforces/BanBan/main_input0.txt new file mode 100644 index 0000000..5357a4a --- /dev/null +++ b/codeforces/BanBan/main_input0.txt @@ -0,0 +1,3 @@ +2 +1 +2 diff --git a/codeforces/BanBan/main_input1.txt b/codeforces/BanBan/main_input1.txt new file mode 100644 index 0000000..bf3f482 --- /dev/null +++ b/codeforces/BanBan/main_input1.txt @@ -0,0 +1,101 @@ +100 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100
\ No newline at end of file diff --git a/codeforces/BanBan/main_output0.txt b/codeforces/BanBan/main_output0.txt new file mode 100644 index 0000000..3edf315 --- /dev/null +++ b/codeforces/BanBan/main_output0.txt @@ -0,0 +1,4 @@ +1 +1 2 +1 +2 6 diff --git a/codeforces/BanBan/main_output1.txt b/codeforces/BanBan/main_output1.txt new file mode 100644 index 0000000..95bce4d --- /dev/null +++ b/codeforces/BanBan/main_output1.txt @@ -0,0 +1,2 @@ +1 +1 2
\ No newline at end of file |
