output
stringlengths
52
181k
instruction
stringlengths
296
182k
#include <bits/stdc++.h> using namespace std; int a[18257 + 5] = {0, 1, 13, 37, 73}, n; int main() { cin >> n; for (int i = 5; i <= n; i++) { a[i] = a[i - 1] + (a[i - 1] - a[i - 2] + 12); } cout << a[n]; }
### Prompt Please create a solution in cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int a[18257 + 5] = {0, 1, 13, 37, 73}, n; int main() { cin >> n; for (int i = 5; i <= n; i++) { a[i] = a[i - 1] + (a[i - 1] - a[i - 2] + 12); } cout << a[n]; } ```
#include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; cout << 6 * (n * (n - 1)) + 1 << endl; return 0; }
### Prompt Develop a solution in cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; cout << 6 * (n * (n - 1)) + 1 << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; cout << 6 * a * (a - 1) + 1 << endl; return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; cout << 6 * a * (a - 1) + 1 << endl; return 0; } ```
#include <bits/stdc++.h> int main() { int n, t(0), r(1); std::cin >> n; for (int i(0); i < n; ++i) { r += t; t += 12; } std::cout << r << std::endl; return 0; }
### Prompt Develop a solution in cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n, t(0), r(1); std::cin >> n; for (int i(0); i < n; ++i) { r += t; t += 12; } std::cout << r << std::endl; return 0; } ```
#include <bits/stdc++.h> #pragma comment(linker, "/STACK:260108864") using namespace std; int main() { int n; scanf("%d", &n); int res(1); int temp(1); while (--n) { res += temp * 12; ++temp; } printf("%d\n", res); return 0; }
### Prompt Please create a solution in cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> #pragma comment(linker, "/STACK:260108864") using namespace std; int main() { int n; scanf("%d", &n); int res(1); int temp(1); while (--n) { res += temp * 12; ++temp; } printf("%d\n", res); return 0; } ```
#include <bits/stdc++.h> int main() { int x; scanf("%d", &x); printf("%d\n", 6 * x * (x - 1) + 1); return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int x; scanf("%d", &x); printf("%d\n", 6 * x * (x - 1) + 1); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (n * (n - 1) * 6 + 1); return 0; }
### Prompt Construct a cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (n * (n - 1) * 6 + 1); return 0; } ```
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; cout << 6 * (n * (n - 1)) + 1 << endl; return 0; }
### Prompt Please create a solution in cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; cout << 6 * (n * (n - 1)) + 1 << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; const double EPS = 1e-9; const double INC_EPS = 1e-7; const int N = 1e5 + 5; int main() { int n; long long ans = 0, k = 2; cin >> n; for (int i = 2; i <= n; i++) { ans += k * 6; k += 2; } cout << ans + 1; return 0; }
### Prompt Generate a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; const double EPS = 1e-9; const double INC_EPS = 1e-7; const int N = 1e5 + 5; int main() { int n; long long ans = 0, k = 2; cin >> n; for (int i = 2; i <= n; i++) { ans += k * 6; k += 2; } cout << ans + 1; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (2 * n - 1) * (2 * n - 1) + 4 * (n - 1) * n / 2; return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (2 * n - 1) * (2 * n - 1) + 4 * (n - 1) * n / 2; return 0; } ```
#include <bits/stdc++.h> long long factorial(long long n) { if (n == 1) return 1; return n * factorial(n - 1); } long long max(long long a, long long b) { return (a > b ? a : b); } long long min(long long a, long long b) { return (a < b ? a : b); } using namespace std; void impossible() { long long n; cin >> n; long long p = 12, i = 0; long long ans = 1; if (n == 1) { cout << "1"; return; } while (n--) { ans += 12 * i++; } cout << ans; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long t = 1; while (t--) impossible(); return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> long long factorial(long long n) { if (n == 1) return 1; return n * factorial(n - 1); } long long max(long long a, long long b) { return (a > b ? a : b); } long long min(long long a, long long b) { return (a < b ? a : b); } using namespace std; void impossible() { long long n; cin >> n; long long p = 12, i = 0; long long ans = 1; if (n == 1) { cout << "1"; return; } while (n--) { ans += 12 * i++; } cout << ans; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long t = 1; while (t--) impossible(); return 0; } ```
#include <bits/stdc++.h> using namespace std; long long n, ans = 1; int main() { cin >> n; for (int i = 2; i <= n; i++) { ans += ((i - 1) * 12); } cout << ans; return 0; }
### Prompt Create a solution in CPP for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long n, ans = 1; int main() { cin >> n; for (int i = 2; i <= n; i++) { ans += ((i - 1) * 12); } cout << ans; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long int n, i, t(1); cin >> n; for (int i = 0; i < (int)n; i++) t += (12 * i); cout << t; }
### Prompt Develop a solution in cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long int n, i, t(1); cin >> n; for (int i = 0; i < (int)n; i++) t += (12 * i); cout << t; } ```
#include <bits/stdc++.h> #pragma comment(linker, "/stack:64000000") using namespace std; int main() { long long out = 0, a, b; cin >> a; if (a == 1) out = 1; else { out = 1; b = 12; for (int i = 1; i < a; i++) { out += b; b += 12; } } cout << out; return 0; }
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> #pragma comment(linker, "/stack:64000000") using namespace std; int main() { long long out = 0, a, b; cin >> a; if (a == 1) out = 1; else { out = 1; b = 12; for (int i = 1; i < a; i++) { out += b; b += 12; } } cout << out; return 0; } ```
#include <bits/stdc++.h> using namespace std; long long star[18528]; int main() { long long i; long long k = 1, z = 4; long long a; star[1] = 1; for (i = 2; i <= 18527; i++) { star[i] = (z * (z + 1)) / 2 + 3 * k; k = k + i; z = z + 3; } cin >> a; cout << star[a] << endl; return 0; }
### Prompt Please formulate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long star[18528]; int main() { long long i; long long k = 1, z = 4; long long a; star[1] = 1; for (i = 2; i <= 18527; i++) { star[i] = (z * (z + 1)) / 2 + 3 * k; k = k + i; z = z + 3; } cin >> a; cout << star[a] << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; long long MOD = 1000000007; long long pw(long long a, long long b) { long long r = 1; while (b > 0) { if (b & 1) { r = (r * a) % MOD; } b = b >> 1; a = (a * a) % MOD; } return (r) % MOD; } int f[18259]; int main() { f[0] = 0; f[1] = 1; for (int i = 2; i < 18258; i++) { f[i] = (12 * (i - 1)) + f[i - 1]; } int a; scanf("%d", &a); printf("%d", f[a]); printf("\n"); return 0; }
### Prompt Please provide a cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long MOD = 1000000007; long long pw(long long a, long long b) { long long r = 1; while (b > 0) { if (b & 1) { r = (r * a) % MOD; } b = b >> 1; a = (a * a) % MOD; } return (r) % MOD; } int f[18259]; int main() { f[0] = 0; f[1] = 1; for (int i = 2; i < 18258; i++) { f[i] = (12 * (i - 1)) + f[i - 1]; } int a; scanf("%d", &a); printf("%d", f[a]); printf("\n"); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << n * (n - 1) * 6 + 1; return 0; }
### Prompt Your task is to create a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << n * (n - 1) * 6 + 1; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int a; cin >> a; cout << 6 * a * (a - 1) + 1 << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int a; cin >> a; cout << 6 * a * (a - 1) + 1 << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; long long t; int main() { scanf("%d", &t); printf("%d", 6 * t * (t - 1) + 1); return 0; }
### Prompt Please formulate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long t; int main() { scanf("%d", &t); printf("%d", 6 * t * (t - 1) + 1); return 0; } ```
#include <bits/stdc++.h> using namespace std; template <typename T, typename U> std::pair<T, U> operator+(const std::pair<T, U>& l, const std::pair<T, U>& r) { return {l.first + r.first, l.second + r.second}; } typedef void (*callback_function)(void); const long long ZERO = 0LL; const long long INF64 = 1e18; const long long INF32 = 1e9; const long long MOD = 1e9 + 7; const long double PI = acos(-1.0L); const long double EPS = static_cast<long double>(1e-9); long long inv(long long a, long long b) { if (a != 1) { return b - (inv(b % a, a) * b) / a; } return 1; } inline long long Pow(long long a, long long k) { long long s = 1; for (; k; k >>= 1) { k& 1 ? s = 1LL * s * a % MOD : 0; a = 1LL * a * a % MOD; } return s; } const long long N = 1e6 + 7; void input() {} void output() {} void preprocess() {} void debug() { if (true) { } } void solve() { preprocess(); long long n; cin >> n; long long res = 1; for (long long i = (1); i < (n); i++) { res += i * 12; } cout << res << endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(); { input(); solve(); output(); } return 0; }
### Prompt Generate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; template <typename T, typename U> std::pair<T, U> operator+(const std::pair<T, U>& l, const std::pair<T, U>& r) { return {l.first + r.first, l.second + r.second}; } typedef void (*callback_function)(void); const long long ZERO = 0LL; const long long INF64 = 1e18; const long long INF32 = 1e9; const long long MOD = 1e9 + 7; const long double PI = acos(-1.0L); const long double EPS = static_cast<long double>(1e-9); long long inv(long long a, long long b) { if (a != 1) { return b - (inv(b % a, a) * b) / a; } return 1; } inline long long Pow(long long a, long long k) { long long s = 1; for (; k; k >>= 1) { k& 1 ? s = 1LL * s * a % MOD : 0; a = 1LL * a * a % MOD; } return s; } const long long N = 1e6 + 7; void input() {} void output() {} void preprocess() {} void debug() { if (true) { } } void solve() { preprocess(); long long n; cin >> n; long long res = 1; for (long long i = (1); i < (n); i++) { res += i * 12; } cout << res << endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(); { input(); solve(); output(); } return 0; } ```
#include <bits/stdc++.h> long long estella(int n); using namespace std; long long b, a; int main() { cin >> a; cout << estella(a); return 0; } long long estella(int n) { if (n == 1) { b = 1; } else { b = 2 * (n - 1) * (n - 1) + 2 * n * n + 2 * n * n - 2 * n - 1; } return b; }
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> long long estella(int n); using namespace std; long long b, a; int main() { cin >> a; cout << estella(a); return 0; } long long estella(int n) { if (n == 1) { b = 1; } else { b = 2 * (n - 1) * (n - 1) + 2 * n * n + 2 * n * n - 2 * n - 1; } return b; } ```
#include <bits/stdc++.h> using namespace std; long long n; int sum = 1; int main() { cin >> n; for (int i = 1; i < n; i++) sum += i * 12; cout << sum; return 0; }
### Prompt In cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long n; int sum = 1; int main() { cin >> n; for (int i = 1; i < n; i++) sum += i * 12; cout << sum; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); printf("%d", 6 * n * (n - 1) + 1); }
### Prompt Please formulate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); printf("%d", 6 * n * (n - 1) + 1); } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 6 * n * (n - 1) + 1; }
### Prompt Your challenge is to write a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 6 * n * (n - 1) + 1; } ```
#include <bits/stdc++.h> using namespace std; int work(string s) { reverse((s).begin(), (s).end()); int ans = 0, p = 1; for (int i = s.length() - 1; i >= 0; i--) { ans += (s[i] - '0') * p; p *= 10; } return ans; } int main() { int a; cin >> a; long long ans = 1; for (int i = 2; i <= a; i++) { ans += (i - 1) * 2 * 6; } cout << ans << endl; }
### Prompt Generate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int work(string s) { reverse((s).begin(), (s).end()); int ans = 0, p = 1; for (int i = s.length() - 1; i >= 0; i--) { ans += (s[i] - '0') * p; p *= 10; } return ans; } int main() { int a; cin >> a; long long ans = 1; for (int i = 2; i <= a; i++) { ans += (i - 1) * 2 * 6; } cout << ans << endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << 6 * n * (n - 1) + 1; return 0; }
### Prompt Develop a solution in Cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << 6 * n * (n - 1) + 1; return 0; } ```
#include <bits/stdc++.h> using namespace std; const long long n = 2000000000; int main() { long long a; cin >> a; long long res = 1, deg = 2; for (long long i = 1; i < a; ++i) { res = (res + 6 * deg) % n; deg = (deg + 2) % n; } cout << res << endl; return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; const long long n = 2000000000; int main() { long long a; cin >> a; long long res = 1, deg = 2; for (long long i = 1; i < a; ++i) { res = (res + 6 * deg) % n; deg = (deg + 2) % n; } cout << res << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int n; long long f[100005]; int main() { scanf("%d", &n); f[1] = 1; for (int i = 2; i <= n; i++) f[i] = (i * 2 - 1) * 6 + f[i - 1] - 6; printf("%lld\n", f[n]); return 0; }
### Prompt Generate a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int n; long long f[100005]; int main() { scanf("%d", &n); f[1] = 1; for (int i = 2; i <= n; i++) f[i] = (i * 2 - 1) * 6 + f[i - 1] - 6; printf("%lld\n", f[n]); return 0; } ```
#include <bits/stdc++.h> using namespace std; int n, m, k, a[18257 + 7]; int main() { cin >> n; a[1] = 1; k = 12; for (int i = 2; i <= n; i++, k += 12) a[i] = a[i - 1] + k; cout << a[n]; return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int n, m, k, a[18257 + 7]; int main() { cin >> n; a[1] = 1; k = 12; for (int i = 2; i <= n; i++, k += 12) a[i] = a[i - 1] + k; cout << a[n]; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a, s = 1; cin >> a; for (int i = 1; i < a; i++) s += i * 12; cout << s; }
### Prompt Please formulate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a, s = 1; cin >> a; for (int i = 1; i < a; i++) s += i * 12; cout << s; } ```
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long num, x = 1, i; cin >> num; for (i = 1; i < num; i++) x = x + (12 * i); cout << x << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { unsigned long long num, x = 1, i; cin >> num; for (i = 1; i < num; i++) x = x + (12 * i); cout << x << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; cout << 6 * n * (n - 1) + 1; return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; cout << 6 * n * (n - 1) + 1; return 0; } ```
#include <bits/stdc++.h> using namespace std; long long mod(long long x) { return ((x % 1000000009 + 1000000009) % 1000000009); } long long add(long long a, long long b) { return mod(mod(a) + mod(b)); } long long mult(long long a, long long b) { return mod(mod(a) * mod(b)); } long long modPow(long long a, long long b) { if (b == 0) return 1LL; if (b == 1) return a % 1000000009; long long res = 1; while (b) { if (b % 2 == 1) res = mult(res, a); a = mult(a, a); b = b / 2; } return res; } vector<long long> v(1000000); int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; long long n; cin >> n; v[1] = 1; long long count = 1; for (long long i = 2; i <= n; i++) { v[i] = v[i - 1] + 6 + 6 * count; count += 2; } cout << v[n] << "\n"; return 0; }
### Prompt In cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long mod(long long x) { return ((x % 1000000009 + 1000000009) % 1000000009); } long long add(long long a, long long b) { return mod(mod(a) + mod(b)); } long long mult(long long a, long long b) { return mod(mod(a) * mod(b)); } long long modPow(long long a, long long b) { if (b == 0) return 1LL; if (b == 1) return a % 1000000009; long long res = 1; while (b) { if (b % 2 == 1) res = mult(res, a); a = mult(a, a); b = b / 2; } return res; } vector<long long> v(1000000); int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; long long n; cin >> n; v[1] = 1; long long count = 1; for (long long i = 2; i <= n; i++) { v[i] = v[i - 1] + 6 + 6 * count; count += 2; } cout << v[n] << "\n"; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n, a = 12, b = 1; cin >> n; for (int i = 1; i < n; i++) { b += a; a += 12; } cout << b << endl; }
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n, a = 12, b = 1; cin >> n; for (int i = 1; i < n; i++) { b += a; a += 12; } cout << b << endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int a, ans = 1, p = 0; cin >> a; if (a == 1) ans = 1; for (int i = 1; i < a; ++i) { p += 12; ans += p; } cout << ans << '\n'; return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int a, ans = 1, p = 0; cin >> a; if (a == 1) ans = 1; for (int i = 1; i < a; ++i) { p += 12; ans += p; } cout << ans << '\n'; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; cout << 6 * a * (a - 1) + 1; }
### Prompt Construct a cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; cout << 6 * a * (a - 1) + 1; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << 6 * n * (n - 1) + 1 << endl; }
### Prompt Generate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << 6 * n * (n - 1) + 1 << endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; cout << 6 * a * (a - 1) + 1; }
### Prompt In Cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; cout << 6 * a * (a - 1) + 1; } ```
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; cout << 6 * n * (n - 1) + 1; return 0; }
### Prompt In Cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; cout << 6 * n * (n - 1) + 1; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << (1ll + ((n - 1ll) * n * 6ll)) << endl; return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << (1ll + ((n - 1ll) * n * 6ll)) << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int a[200000]; int main() { int n, m, i; a[1] = 1; for (i = 2; i <= 18257; i++) a[i] = a[i - 1] + 12 * (i - 1); while (~scanf("%d", &n)) { printf("%d\n", a[n]); } return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int a[200000]; int main() { int n, m, i; a[1] = 1; for (i = 2; i <= 18257; i++) a[i] = a[i - 1] + 12 * (i - 1); while (~scanf("%d", &n)) { printf("%d\n", a[n]); } return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int res = 0; for (int i = 1; i < n; i++) res += i; int x = 2 * n - 1; for (int i = 1; i < n; i++) res += x + i; res *= 2; res += x; cout << res; return 0; }
### Prompt Develop a solution in cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int res = 0; for (int i = 1; i < n; i++) res += i; int x = 2 * n - 1; for (int i = 1; i < n; i++) res += x + i; res *= 2; res += x; cout << res; return 0; } ```
#include <bits/stdc++.h> using namespace std; int n, ans = 1; int main() { cin >> n; for (int i = 2; i <= n; ++i) ans += (i - 1) * 12; cout << ans; return 0; }
### Prompt Please formulate a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int n, ans = 1; int main() { cin >> n; for (int i = 2; i <= n; ++i) ans += (i - 1) * 12; cout << ans; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long int number = 0; cin >> number; long long int answer = 1; for (int i = 2; i <= number; i++) answer = answer + 12 * (i - 1); cout << answer << endl; return 0; }
### Prompt In cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long int number = 0; cin >> number; long long int answer = 1; for (int i = 2; i <= number; i++) answer = answer + 12 * (i - 1); cout << answer << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); long long int i, n, sum = 1; cin >> n; for (i = 1; i < n; i++) sum += 12 * i; cout << sum << endl; return 0; }
### Prompt Construct a CPP code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); long long int i, n, sum = 1; cin >> n; for (i = 1; i < n; i++) sum += 12 * i; cout << sum << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; void solve(void) { int N; long int s = 0; cin >> N; for (int i = 2; i <= N; i++) s += i - 1; cout << s * 6 * 2 + 1 << endl; } int main(int argc, char const *argv[]) { solve(); return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; void solve(void) { int N; long int s = 0; cin >> N; for (int i = 2; i <= N; i++) s += i - 1; cout << s * 6 * 2 + 1 << endl; } int main(int argc, char const *argv[]) { solve(); return 0; } ```
#include <bits/stdc++.h> int in() { int r = 0, c; for (c = getchar(); c <= 32; c = getchar()) ; if (c == '-') return -in(); for (; c > 32; r = (r << 1) + (r << 3) + c - '0', c = getchar()) ; return r; } int main() { int N = in(); long long res = 1; for (int i = 2; i <= N; i++) { res = res + ((i * 2 - 1) * 6) - 6; if (res > 2000000000) { res = 2000000000; break; } } printf("%d\n", res); }
### Prompt Generate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int in() { int r = 0, c; for (c = getchar(); c <= 32; c = getchar()) ; if (c == '-') return -in(); for (; c > 32; r = (r << 1) + (r << 3) + c - '0', c = getchar()) ; return r; } int main() { int N = in(); long long res = 1; for (int i = 2; i <= N; i++) { res = res + ((i * 2 - 1) * 6) - 6; if (res > 2000000000) { res = 2000000000; break; } } printf("%d\n", res); } ```
#include <bits/stdc++.h> int main() { unsigned long long n, star_n; scanf("%I64u", &n); star_n = 6LL * n * (n - 1) + 1; printf("%I64u", star_n); return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { unsigned long long n, star_n; scanf("%I64u", &n); star_n = 6LL * n * (n - 1) + 1; printf("%I64u", star_n); return 0; } ```
#include <bits/stdc++.h> using namespace std; static const double EPS = 1e-5; int num = 0; void star(int n) { if (n == 1) num++; if (n > 1) { num += 12 * (n - 1); star(n - 1); } } int main(int argc, const char* argv[]) { int a; cin >> a; star(a); cout << num; return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; static const double EPS = 1e-5; int num = 0; void star(int n) { if (n == 1) num++; if (n > 1) { num += 12 * (n - 1); star(n - 1); } } int main(int argc, const char* argv[]) { int a; cin >> a; star(a); cout << num; return 0; } ```
#include <bits/stdc++.h> using namespace std; int N; int main(void) { scanf("%d", &N); printf("%d\n", 6 * N * (N - 1) + 1); return 0; }
### Prompt Generate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int N; int main(void) { scanf("%d", &N); printf("%d\n", 6 * N * (N - 1) + 1); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long a, b = 1, x = 0; cin >> a; a--; for (int k = 1; k <= a; k++) { x += 2; b += 6 * x; } cout << b; return 0; }
### Prompt Please create a solution in Cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long a, b = 1, x = 0; cin >> a; a--; for (int k = 1; k <= a; k++) { x += 2; b += 6 * x; } cout << b; return 0; } ```
#include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int a, res = 1, s = 0; cin >> a; for (int i = 1; i < a; i++) { s += 12; res += s; } cout << res; return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int a, res = 1, s = 0; cin >> a; for (int i = 1; i < a; i++) { s += 12; res += s; } cout << res; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n, m = 1; cin >> n; for (int i = 1; i < n; i++) { m += (12 * i); } cout << m << endl; }
### Prompt Please formulate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n, m = 1; cin >> n; for (int i = 1; i < n; i++) { m += (12 * i); } cout << m << endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n, output = 1; cin >> n; if (n == 1) { cout << n; return 0; } else while (n > 1) { output += (n - 1) * 12; n--; } cout << output << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n, output = 1; cin >> n; if (n == 1) { cout << n; return 0; } else while (n > 1) { output += (n - 1) * 12; n--; } cout << output << endl; return 0; } ```
#include <bits/stdc++.h> int main() { long long a, b, c, sum; while (scanf("%I64d", &a) != EOF) { sum = 1; c = 12; for (b = 1; b < a; b++) { sum += c; c = c + 12; } printf("%I64d\n", sum); } }
### Prompt Create a solution in CPP for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { long long a, b, c, sum; while (scanf("%I64d", &a) != EOF) { sum = 1; c = 12; for (b = 1; b < a; b++) { sum += c; c = c + 12; } printf("%I64d\n", sum); } } ```
#include <bits/stdc++.h> int main() { int a; scanf("%d", &a); printf("%d", 1 + 6 * (a - 1) * a); return 0; }
### Prompt Please create a solution in Cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int a; scanf("%d", &a); printf("%d", 1 + 6 * (a - 1) * a); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long int a, s = 0, i; cin >> a; for (i = 1; i <= a; i++) { s = s + i - 1; } cout << s * 12 + 1 << endl; ; return 0; }
### Prompt Construct a cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { unsigned long long int a, s = 0, i; cin >> a; for (i = 1; i <= a; i++) { s = s + i - 1; } cout << s * 12 + 1 << endl; ; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a; scanf("%d", &a); printf("%I64d\n", 1 + (long long)a * (long long)(a - 1) * 6); return 0; }
### Prompt Construct a cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a; scanf("%d", &a); printf("%I64d\n", 1 + (long long)a * (long long)(a - 1) * 6); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; long long int ans = 6 * a * (a - 1) + 1; cout << ans << endl; return 0; }
### Prompt Construct a cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; long long int ans = 6 * a * (a - 1) + 1; cout << ans << endl; return 0; } ```
#include <bits/stdc++.h> #pragma comment(linker, "/STACK:64000000") using namespace std; int a; int main() { cin >> a; int ans = 1; for (int i = 2; i <= a; i++) { ans += (2 * i - 2) * 6; } cout << ans << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> #pragma comment(linker, "/STACK:64000000") using namespace std; int a; int main() { cin >> a; int ans = 1; for (int i = 2; i <= a; i++) { ans += (2 * i - 2) * 6; } cout << ans << endl; return 0; } ```
#include <bits/stdc++.h> inline int getInt() { int s; scanf("%d", &s); return s; } using namespace std; int main() { int ans = 1; int n = getInt(); for (int i = 0; i < (int)(n - 1); i++) { ans += ((i + 1) * 2 + 1) * 3; ans += ((i + 1) * 2 - 1) * 3; } printf("%d\n", ans); return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> inline int getInt() { int s; scanf("%d", &s); return s; } using namespace std; int main() { int ans = 1; int n = getInt(); for (int i = 0; i < (int)(n - 1); i++) { ans += ((i + 1) * 2 + 1) * 3; ans += ((i + 1) * 2 - 1) * 3; } printf("%d\n", ans); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long i, j, k, l, n, m, p; while (cin >> n) { k = 0; for (i = 1; i <= n - 1; i++) { k += 12 * i; } k++; printf("%lld\n", k); } }
### Prompt Please create a solution in Cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long i, j, k, l, n, m, p; while (cin >> n) { k = 0; for (i = 1; i <= n - 1; i++) { k += 12 * i; } k++; printf("%lld\n", k); } } ```
#include <bits/stdc++.h> using namespace std; long long res = 1; int main() { int n; cin >> n; for (int i = 1; i < n; ++i) { res += i * 12; } cout << res; return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long res = 1; int main() { int n; cin >> n; for (int i = 1; i < n; ++i) { res += i * 12; } cout << res; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int A; cin >> A; cout << 6 * A * (A - 1) + 1 << endl; return 0; }
### Prompt Create a solution in CPP for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int A; cin >> A; cout << 6 * A * (A - 1) + 1 << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n, s, i; cin >> n; s = 1; for (i = 2; i <= n; i++) s += (2 * i - 1) * 6 - 6; cout << s; cin.get(); cin.get(); }
### Prompt Develop a solution in cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n, s, i; cin >> n; s = 1; for (i = 2; i <= n; i++) s += (2 * i - 1) * 6 - 6; cout << s; cin.get(); cin.get(); } ```
#include <bits/stdc++.h> using namespace std; int main() { long long int a = 0; cin >> a; cout << 6 * a * (a - 1) + 1 << "\n"; }
### Prompt Your challenge is to write a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long int a = 0; cin >> a; cout << 6 * a * (a - 1) + 1 << "\n"; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; n--; int sum = 1; for (int i = 1; i <= n; i++) sum += 12 * i; cout << sum; return 0; }
### Prompt Generate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; n--; int sum = 1; for (int i = 1; i <= n; i++) sum += 12 * i; cout << sum; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long int n, ans = 1, k; cin >> n; ans = 3 * n - 2; ans = (ans * (ans + 1)) / 2; k = 3 * (n * (n - 1)) / 2; cout << k + ans; }
### Prompt Your task is to create a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long int n, ans = 1, k; cin >> n; ans = 3 * n - 2; ans = (ans * (ans + 1)) / 2; k = 3 * (n * (n - 1)) / 2; cout << k + ans; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << 1 + 6 * n * (n - 1); }
### Prompt Your challenge is to write a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << 1 + 6 * n * (n - 1); } ```
#include <bits/stdc++.h> using namespace std; int main() { int a; int x; cin >> a; x = 6 * a * (a - 1) + 1; cout << x << endl; return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a; int x; cin >> a; x = 6 * a * (a - 1) + 1; cout << x << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; int output = 0; int an = 12 * (a - 1); output = an / 2 * a; cout << output + 1; return 0; }
### Prompt Your task is to create a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; int output = 0; int an = 12 * (a - 1); output = an / 2 * a; cout << output + 1; return 0; } ```
#include <bits/stdc++.h> int main() { int n; while (scanf("%d", &n) != EOF) { printf("%d\n", 6 * n * (n - 1) + 1); } }
### Prompt Please provide a cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n; while (scanf("%d", &n) != EOF) { printf("%d\n", 6 * n * (n - 1) + 1); } } ```
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << (long long)(6 * n * (n - 1) + 1); return 0; }
### Prompt Please create a solution in Cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << (long long)(6 * n * (n - 1) + 1); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n, res = 0; cin >> n; for (int i = n; i >= 2; i--) res += (12 * (i - 1)); res += 1; cout << res << endl; return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n, res = 0; cin >> n; for (int i = n; i >= 2; i--) res += (12 * (i - 1)); res += 1; cout << res << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; long long int ans = ((n - 1) * (n)) / 2; ans *= 12; ans++; cout << ans << endl; return 0; }
### Prompt Your task is to create a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; long long int ans = ((n - 1) * (n)) / 2; ans *= 12; ans++; cout << ans << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a, ans = 1; cin >> a; for (int i = 0; i < a; i++) { ans += i * 12; } cout << ans; return 0; }
### Prompt Please formulate a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a, ans = 1; cin >> a; for (int i = 0; i < a; i++) { ans += i * 12; } cout << ans; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a, i, sum = 0; cin >> a; for (i = 1; i <= a; i++) { if (i == 1) sum = sum + 1; else sum = sum + 12 * (i - 1); } cout << sum; return 0; }
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a, i, sum = 0; cin >> a; for (i = 1; i <= a; i++) { if (i == 1) sum = sum + 1; else sum = sum + 12 * (i - 1); } cout << sum; return 0; } ```
#include <bits/stdc++.h> using namespace std; inline bool ascending(int i, int j) { return (i < j); } inline bool descending(int i, int j) { return (i > j); } const int MN = (1e5) + 10; int comp(const void *a, const void *b) { return (*(int *)a - *(int *)b); } bool cmp(int a, int b) { return a > b; } int main() { int n; int64_t res, temp; cin >> n; temp = 3 * (n - 1) + 1; cout << (temp * (temp + 1) / 2) + (3 * n * (n - 1) / 2); return 0; }
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; inline bool ascending(int i, int j) { return (i < j); } inline bool descending(int i, int j) { return (i > j); } const int MN = (1e5) + 10; int comp(const void *a, const void *b) { return (*(int *)a - *(int *)b); } bool cmp(int a, int b) { return a > b; } int main() { int n; int64_t res, temp; cin >> n; temp = 3 * (n - 1) + 1; cout << (temp * (temp + 1) / 2) + (3 * n * (n - 1) / 2); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); printf("%d\n", 6 * n * (n - 1) + 1); return 0; }
### Prompt Please create a solution in Cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); printf("%d\n", 6 * n * (n - 1) + 1); return 0; } ```
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; cout << 6 * n * (n - 1) + 1 << "\n"; } int main() { ios::sync_with_stdio(0); cin.tie(0); solve(); return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; cout << 6 * n * (n - 1) + 1 << "\n"; } int main() { ios::sync_with_stdio(0); cin.tie(0); solve(); return 0; } ```
#include <bits/stdc++.h> int main() { int a, n = 1; scanf("%d", &a); for (int i = 1; i < a; i++) n += 12 * i; printf("%d", n); return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int a, n = 1; scanf("%d", &a); for (int i = 1; i < a; i++) n += 12 * i; printf("%d", n); return 0; } ```
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 1 + 4; map<string, string> maap; vector<int> circle; bool vis[N]; int parent[N]; int chk[N]; int color[N]; int tim[2][N]; int dis[N]; int position[N]; vector<int> adj[N]; vector<int> adj1[N]; vector<int> graph[N]; bool has_cycle; int maxdis, maxnode, Totnode, depth = 1; bool ok; queue<int> q; stack<int> stk; vector<int> solution; int indegree[N]; int go[N]; int to[N]; map<int, int> mp1; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; int t; int cas = 0; int n, m, i, j, cnt1 = 0, cnt2 = 0, cnt = 0, even = 0, odd = 0, len, k, r, l, z = 0, x = 0, y = 0, flag = 0, sum = 0; int a = 0, b = 0, c = 0, d = 0, ans = 0LL, rem, quot, zero = 0, fst = 0, null = 0, snd = 0, lst = 0, rone = 0, one = 0, pos = 0, neg = 0, mn = INT_MAX, mx = INT_MIN; char ch; int h1, h2, m1, m2, h; int velo1, velo2, ac1, ac2, time; int node, edge, u, v, cost; int best, worst; double nd, ad, bd, xd; string str, str1 = "", str2 = "", str3 = "", strstore1 = "", strstore2 = ""; cin >> n; for (int i = 1; i <= n; i++) { x += (i - 1) * 12; } cout << x + 1 << endl; return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 1 + 4; map<string, string> maap; vector<int> circle; bool vis[N]; int parent[N]; int chk[N]; int color[N]; int tim[2][N]; int dis[N]; int position[N]; vector<int> adj[N]; vector<int> adj1[N]; vector<int> graph[N]; bool has_cycle; int maxdis, maxnode, Totnode, depth = 1; bool ok; queue<int> q; stack<int> stk; vector<int> solution; int indegree[N]; int go[N]; int to[N]; map<int, int> mp1; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; int t; int cas = 0; int n, m, i, j, cnt1 = 0, cnt2 = 0, cnt = 0, even = 0, odd = 0, len, k, r, l, z = 0, x = 0, y = 0, flag = 0, sum = 0; int a = 0, b = 0, c = 0, d = 0, ans = 0LL, rem, quot, zero = 0, fst = 0, null = 0, snd = 0, lst = 0, rone = 0, one = 0, pos = 0, neg = 0, mn = INT_MAX, mx = INT_MIN; char ch; int h1, h2, m1, m2, h; int velo1, velo2, ac1, ac2, time; int node, edge, u, v, cost; int best, worst; double nd, ad, bd, xd; string str, str1 = "", str2 = "", str3 = "", strstore1 = "", strstore2 = ""; cin >> n; for (int i = 1; i <= n; i++) { x += (i - 1) * 12; } cout << x + 1 << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { string a, b; long long s, d, i, n, t; cin >> n; t = 1; d = 12; if (n == 1) { cout << 1; return 0; } for (i = 0; i < n - 1; i++) { t = t + d; d = d + 12; } cout << t; return 0; }
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { string a, b; long long s, d, i, n, t; cin >> n; t = 1; d = 12; if (n == 1) { cout << 1; return 0; } for (i = 0; i < n - 1; i++) { t = t + d; d = d + 12; } cout << t; return 0; } ```
#include <bits/stdc++.h> using namespace std; int sky(int n) { int count = 1, acount = 12; if (n == 1) return 1; if (n >= 2) { count += acount; for (int i = 2; i < n; i++) { count += (acount * i); } } return count; } int main() { int n; cin >> n; cout << sky(n) << endl; }
### Prompt Construct a cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int sky(int n) { int count = 1, acount = 12; if (n == 1) return 1; if (n >= 2) { count += acount; for (int i = 2; i < n; i++) { count += (acount * i); } } return count; } int main() { int n; cin >> n; cout << sky(n) << endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; int ans = a * (a - 1) / 2; cout << ans * 12 + 1; }
### Prompt Please provide a CPP coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; int ans = a * (a - 1) / 2; cout << ans * 12 + 1; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1) { cout << 1 << endl; return 0; } int ans = 13; for (int i = 3; i <= n; i++) { ans += (2 * (i - 1) - 1) * 6 + 6; } cout << ans << endl; }
### Prompt Please formulate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1) { cout << 1 << endl; return 0; } int ans = 13; for (int i = 3; i <= n; i++) { ans += (2 * (i - 1) - 1) * 6 + 6; } cout << ans << endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 6 * n * (n - 1) + 1; }
### Prompt Please create a solution in cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 6 * n * (n - 1) + 1; } ```
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long a, b = 1; cin >> a; if (a > 1) { for (int i = 1; i < a; i++) { b += (2 * i - 1) * 6 + 6; } } cout << b << endl; }
### Prompt Develop a solution in cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { unsigned long long a, b = 1; cin >> a; if (a > 1) { for (int i = 1; i < a; i++) { b += (2 * i - 1) * 6 + 6; } } cout << b << endl; } ```
#include <bits/stdc++.h> using LL = long long; using ULL = unsigned long long; using LLL = __int128; using ULLL = unsigned __int128; namespace std { void swap(int& x, int& y) { x ^= (y ^= (x ^= y)); } void swap(LL& x, LL& y) { x ^= (y ^= (x ^= y)); } }; // namespace std using std::swap; template <typename T, typename P> inline auto max(const T& x, const P& y) -> decltype(x < y ? y : x) { return x < y ? y : x; } template <typename T, typename P> inline auto min(const T& x, const P& y) -> decltype(x < y ? x : y) { return x < y ? x : y; } template <typename T, typename... Args> inline auto max(const T& x, const Args&... args) -> decltype(max(x, max(args...))) { return max(x, max(args...)); } template <typename T, typename... Args> inline auto min(const T& x, const Args&... args) -> decltype(min(x, min(args...))) { return min(x, min(args...)); } template <typename T> inline T max(const T& x) { return x; } template <typename T> inline T min(const T& x) { return x; } template <typename T, typename... Args> inline void chkmax(T& d, const Args&... args) { d = max(d, args...); } template <typename T, typename... Args> inline void chkmin(T& d, const Args&... args) { d = min(d, args...); } class IO { static const int MAXSIZE = 1 << 20; char buf[MAXSIZE], *p1, *p2; char pbuf[MAXSIZE], *pp; long double eps = 1e-8L; LLL pow10 = 1000000; int precision; FILE *infile, *outfile; public: IO(FILE* in = nullptr, FILE* out = nullptr) : precision(6), infile(in), outfile(out) { p1 = p2 = buf; pp = pbuf; } ~IO() { fwrite(pbuf, 1, pp - pbuf, outfile); } inline static bool blank(char ch); inline void flush(); inline void input(const char* str); inline void output(const char* str); inline void input(FILE* f); inline void output(FILE* f); inline int getch(); template <typename T, typename... Args> bool read(T& x, Args&... args); inline bool read(); template <typename T> typename std::enable_if< std::is_integral<T>::value || std::is_floating_point<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, bool>::type read(T& x); bool read(char& ch); bool read(char* s); bool readline(char* s); inline void putch(const char c); inline void putback(const char c); inline void setprecision(int n = 6); template <typename T, typename... Args> void write(const T& x, const Args&... args); inline void write(); template <typename T> typename std::enable_if<std::is_integral<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, void>::type write(T x); inline void write(char c); template <typename T> typename std::enable_if<std::is_floating_point<T>::value, void>::type write( T x); inline void write(bool x); void write(char* s); void write(const char* s); template <typename... Args> void writeln(Args... x) { write(x...), putch('\n'); } } io(stdin, stdout), err(nullptr, stderr); template <typename... Args> inline void writeln(Args... x) { io.write(x...), io.putch('\n'); } int main() { int n; io.read(n); writeln(6 * n * (n - 1) + 1); return 0; } inline bool IO::blank(char ch) { return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; } inline void IO::flush() { fwrite(pbuf, 1, pp - pbuf, outfile), pp = pbuf; fflush(outfile); } inline void IO::input(const char* str) { FILE* file = fopen(str, "rb"); infile = file; } inline void IO::output(const char* str) { FILE* file = fopen(str, "wb"); outfile = file; } inline void IO::input(FILE* f) { infile = f; } inline void IO::output(FILE* f) { outfile = f; } inline int IO::getch() { return (p1 == p2 ? (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, infile)) : 0), (p1 == p2) ? EOF : *p1++; } inline void IO::putback(const char c) { *(--p1) = c; } template <typename T, typename... Args> bool IO::read(T& x, Args&... args) { return read(x) && read(args...); } inline bool IO::read() { return true; } template <typename T> typename std::enable_if< std::is_integral<T>::value || std::is_floating_point<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, bool>::type IO::read(T& x) { T tmp = 1; bool sign = false; x = 0; int ch = getch(); for (; !(ch >= '0' && ch <= '9') && ~ch; ch = getch()) if (ch == '-') sign = true; if (!(~ch)) return false; for (; (ch >= '0' && ch <= '9'); ch = getch()) x = x * 10 + (ch - '0'); if (ch == '.' && std::is_floating_point<T>::value) for (ch = getch(); (ch >= '0' && ch <= '9'); ch = getch()) tmp /= 10.0, x += tmp * (ch - '0'); if (~ch) putback(ch); if (sign) x = -x; return true; } bool IO::read(char& ch) { for (ch = getch(); blank(ch) && ~ch; ch = getch()) ; return ~ch; } bool IO::read(char* s) { int ch = getch(); while (blank(ch)) ch = getch(); if (!(~ch)) return false; while (!blank(ch) && ~ch) *s++ = ch, ch = getch(); *s = 0; if (~ch) putback(ch); return true; } bool IO::readline(char* s) { int ch = getch(); while (blank(ch) && ch != '\n') ch = getch(); if (!(~ch)) return false; while (ch != '\n' && ~ch) *s++ = ch, ch = getch(); *s = 0; if (~ch) putback(ch); return true; } inline void IO::putch(const char c) { ((pp - pbuf == MAXSIZE) ? fwrite(pbuf, 1, MAXSIZE, outfile), pp = pbuf : 0), *pp++ = c; } inline void IO::setprecision(int n) { precision = n; eps = powl(10.0L, -precision - 2); pow10 = powl(10.0L, precision) + eps; } template <typename T, typename... Args> void IO::write(const T& x, const Args&... args) { write(x); write(args...); } inline void IO::write() {} template <typename T> typename std::enable_if<std::is_integral<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, void>::type IO::write(T x) { if (x < 0) x = ~x + 1, putch('-'); static T sta[100]; int top = 0; do sta[top++] = x % 10, x /= 10; while (x); while (top) putch(sta[--top] + '0'); } inline void IO::write(bool x) { putch(x ^ 48); } inline void IO::write(char c) { putch(c); } template <typename T> typename std::enable_if<std::is_floating_point<T>::value>::type IO::write(T x) { if (x == 0) { putch('0'), putch('.'); for (int i = 1; i <= precision; i++) putch('0'); return; } if (x < 0) putch('-'), x = -x; T res = (LLL)(x * pow10 + 0.5) / (pow10 * 1.0); LLL y = LLL(res * pow10 + eps) % pow10; write(LLL(res + eps)); if (precision) { putch('.'); static int sta[100], p = 0; for (; p < precision; y /= 10) sta[++p] = y % 10; for (int i = p; i >= 1; i--) putch(sta[i] ^ 48); } } void IO::write(char* s) { while (*s) putch(*s++); } void IO::write(const char* s) { while (*s) putch(*s++); }
### Prompt Create a solution in cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using LL = long long; using ULL = unsigned long long; using LLL = __int128; using ULLL = unsigned __int128; namespace std { void swap(int& x, int& y) { x ^= (y ^= (x ^= y)); } void swap(LL& x, LL& y) { x ^= (y ^= (x ^= y)); } }; // namespace std using std::swap; template <typename T, typename P> inline auto max(const T& x, const P& y) -> decltype(x < y ? y : x) { return x < y ? y : x; } template <typename T, typename P> inline auto min(const T& x, const P& y) -> decltype(x < y ? x : y) { return x < y ? x : y; } template <typename T, typename... Args> inline auto max(const T& x, const Args&... args) -> decltype(max(x, max(args...))) { return max(x, max(args...)); } template <typename T, typename... Args> inline auto min(const T& x, const Args&... args) -> decltype(min(x, min(args...))) { return min(x, min(args...)); } template <typename T> inline T max(const T& x) { return x; } template <typename T> inline T min(const T& x) { return x; } template <typename T, typename... Args> inline void chkmax(T& d, const Args&... args) { d = max(d, args...); } template <typename T, typename... Args> inline void chkmin(T& d, const Args&... args) { d = min(d, args...); } class IO { static const int MAXSIZE = 1 << 20; char buf[MAXSIZE], *p1, *p2; char pbuf[MAXSIZE], *pp; long double eps = 1e-8L; LLL pow10 = 1000000; int precision; FILE *infile, *outfile; public: IO(FILE* in = nullptr, FILE* out = nullptr) : precision(6), infile(in), outfile(out) { p1 = p2 = buf; pp = pbuf; } ~IO() { fwrite(pbuf, 1, pp - pbuf, outfile); } inline static bool blank(char ch); inline void flush(); inline void input(const char* str); inline void output(const char* str); inline void input(FILE* f); inline void output(FILE* f); inline int getch(); template <typename T, typename... Args> bool read(T& x, Args&... args); inline bool read(); template <typename T> typename std::enable_if< std::is_integral<T>::value || std::is_floating_point<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, bool>::type read(T& x); bool read(char& ch); bool read(char* s); bool readline(char* s); inline void putch(const char c); inline void putback(const char c); inline void setprecision(int n = 6); template <typename T, typename... Args> void write(const T& x, const Args&... args); inline void write(); template <typename T> typename std::enable_if<std::is_integral<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, void>::type write(T x); inline void write(char c); template <typename T> typename std::enable_if<std::is_floating_point<T>::value, void>::type write( T x); inline void write(bool x); void write(char* s); void write(const char* s); template <typename... Args> void writeln(Args... x) { write(x...), putch('\n'); } } io(stdin, stdout), err(nullptr, stderr); template <typename... Args> inline void writeln(Args... x) { io.write(x...), io.putch('\n'); } int main() { int n; io.read(n); writeln(6 * n * (n - 1) + 1); return 0; } inline bool IO::blank(char ch) { return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; } inline void IO::flush() { fwrite(pbuf, 1, pp - pbuf, outfile), pp = pbuf; fflush(outfile); } inline void IO::input(const char* str) { FILE* file = fopen(str, "rb"); infile = file; } inline void IO::output(const char* str) { FILE* file = fopen(str, "wb"); outfile = file; } inline void IO::input(FILE* f) { infile = f; } inline void IO::output(FILE* f) { outfile = f; } inline int IO::getch() { return (p1 == p2 ? (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, infile)) : 0), (p1 == p2) ? EOF : *p1++; } inline void IO::putback(const char c) { *(--p1) = c; } template <typename T, typename... Args> bool IO::read(T& x, Args&... args) { return read(x) && read(args...); } inline bool IO::read() { return true; } template <typename T> typename std::enable_if< std::is_integral<T>::value || std::is_floating_point<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, bool>::type IO::read(T& x) { T tmp = 1; bool sign = false; x = 0; int ch = getch(); for (; !(ch >= '0' && ch <= '9') && ~ch; ch = getch()) if (ch == '-') sign = true; if (!(~ch)) return false; for (; (ch >= '0' && ch <= '9'); ch = getch()) x = x * 10 + (ch - '0'); if (ch == '.' && std::is_floating_point<T>::value) for (ch = getch(); (ch >= '0' && ch <= '9'); ch = getch()) tmp /= 10.0, x += tmp * (ch - '0'); if (~ch) putback(ch); if (sign) x = -x; return true; } bool IO::read(char& ch) { for (ch = getch(); blank(ch) && ~ch; ch = getch()) ; return ~ch; } bool IO::read(char* s) { int ch = getch(); while (blank(ch)) ch = getch(); if (!(~ch)) return false; while (!blank(ch) && ~ch) *s++ = ch, ch = getch(); *s = 0; if (~ch) putback(ch); return true; } bool IO::readline(char* s) { int ch = getch(); while (blank(ch) && ch != '\n') ch = getch(); if (!(~ch)) return false; while (ch != '\n' && ~ch) *s++ = ch, ch = getch(); *s = 0; if (~ch) putback(ch); return true; } inline void IO::putch(const char c) { ((pp - pbuf == MAXSIZE) ? fwrite(pbuf, 1, MAXSIZE, outfile), pp = pbuf : 0), *pp++ = c; } inline void IO::setprecision(int n) { precision = n; eps = powl(10.0L, -precision - 2); pow10 = powl(10.0L, precision) + eps; } template <typename T, typename... Args> void IO::write(const T& x, const Args&... args) { write(x); write(args...); } inline void IO::write() {} template <typename T> typename std::enable_if<std::is_integral<T>::value || std::is_same<T, LLL>::value || std::is_same<T, ULLL>::value, void>::type IO::write(T x) { if (x < 0) x = ~x + 1, putch('-'); static T sta[100]; int top = 0; do sta[top++] = x % 10, x /= 10; while (x); while (top) putch(sta[--top] + '0'); } inline void IO::write(bool x) { putch(x ^ 48); } inline void IO::write(char c) { putch(c); } template <typename T> typename std::enable_if<std::is_floating_point<T>::value>::type IO::write(T x) { if (x == 0) { putch('0'), putch('.'); for (int i = 1; i <= precision; i++) putch('0'); return; } if (x < 0) putch('-'), x = -x; T res = (LLL)(x * pow10 + 0.5) / (pow10 * 1.0); LLL y = LLL(res * pow10 + eps) % pow10; write(LLL(res + eps)); if (precision) { putch('.'); static int sta[100], p = 0; for (; p < precision; y /= 10) sta[++p] = y % 10; for (int i = p; i >= 1; i--) putch(sta[i] ^ 48); } } void IO::write(char* s) { while (*s) putch(*s++); } void IO::write(const char* s) { while (*s) putch(*s++); } ```
#include <bits/stdc++.h> using namespace std; int ret[20000]; int main() { int a; ret[1] = 1; ret[2] = 13; for (int i = 3; i <= 18257; i++) ret[i] = ret[i - 1] + 6 * ((i - 1) * 2); scanf("%d", &a); printf("%d\n", ret[a]); return 0; }
### Prompt Please formulate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int ret[20000]; int main() { int a; ret[1] = 1; ret[2] = 13; for (int i = 3; i <= 18257; i++) ret[i] = ret[i - 1] + 6 * ((i - 1) * 2); scanf("%d", &a); printf("%d\n", ret[a]); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; long long s = 1; int i; for (i = 1; i <= a; ++i) s += (12 * i - 12); cout << s; return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; long long s = 1; int i; for (i = 1; i <= a; ++i) s += (12 * i - 12); cout << s; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long int m; while (cin >> m) cout << ((m * 3 - 1) * (m * 3 - 2) + 3 * m * (m - 1)) / 2 << endl; return 0; }
### Prompt Please provide a CPP coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long int m; while (cin >> m) cout << ((m * 3 - 1) * (m * 3 - 2) + 3 * m * (m - 1)) / 2 << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n; cin >> n; cout << 6 * n * (n - 1) + 1 << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n; cin >> n; cout << 6 * n * (n - 1) + 1 << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; template <class T> inline void smn(T &a, const T &b) { if (b < a) a = b; } template <class T> inline void smx(T &a, const T &b) { if (b > a) a = b; } template <class T> inline T rev(const T &a) { T _ = a; reverse(_.begin(), _.end()); return _; } const double eps = 1e-9; const long double leps = 1e-14; long long res, n, t; int main(int argc, char *argv[]) { ios_base::sync_with_stdio(false); cin >> n; t = 1 + (n - 1) * 3; res = t * (t + 1); for (int i = 0; i < n; i++) if (i == n - 1) res -= n + i; else res -= 2 * (n + i); cout << res << '\n'; return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; template <class T> inline void smn(T &a, const T &b) { if (b < a) a = b; } template <class T> inline void smx(T &a, const T &b) { if (b > a) a = b; } template <class T> inline T rev(const T &a) { T _ = a; reverse(_.begin(), _.end()); return _; } const double eps = 1e-9; const long double leps = 1e-14; long long res, n, t; int main(int argc, char *argv[]) { ios_base::sync_with_stdio(false); cin >> n; t = 1 + (n - 1) * 3; res = t * (t + 1); for (int i = 0; i < n; i++) if (i == n - 1) res -= n + i; else res -= 2 * (n + i); cout << res << '\n'; return 0; } ```
#include <bits/stdc++.h> int main() { int n, y; scanf("%d", &n); y = 6 * n * n - 6 * n + 1; printf("%d", y); }
### Prompt In Cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n, y; scanf("%d", &n); y = 6 * n * n - 6 * n + 1; printf("%d", y); } ```
#include <bits/stdc++.h> using namespace std; long long tri(long long n) { return n * (n + 1) / 2; } int main() { long long n; cin >> n; cout << tri(3 * n - 2) + 3 * tri(n - 1) << endl; return 0; }
### Prompt Generate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long tri(long long n) { return n * (n + 1) / 2; } int main() { long long n; cin >> n; cout << tri(3 * n - 2) + 3 * tri(n - 1) << endl; return 0; } ```
#include <bits/stdc++.h> const long long inf = 1000000000; const long long inf64 = inf * inf; const double pi = acos(-1.0); long long Abs(long long x) { return (x >= 0 ? x : -x); } using namespace std; bool solve() { long long a; cin >> a; vector<long long> dp(a + 2); dp[1] = 1; dp[2] = 13; for (int i(3); i <= a; i++) dp[i] = (2 * i - 1) * 3 + (2 * (i - 1) - 1) * 3 + dp[i - 1]; cout << dp[a] << '\n'; return true; } int main() { solve(); return 0; }
### Prompt Please formulate a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> const long long inf = 1000000000; const long long inf64 = inf * inf; const double pi = acos(-1.0); long long Abs(long long x) { return (x >= 0 ? x : -x); } using namespace std; bool solve() { long long a; cin >> a; vector<long long> dp(a + 2); dp[1] = 1; dp[2] = 13; for (int i(3); i <= a; i++) dp[i] = (2 * i - 1) * 3 + (2 * (i - 1) - 1) * 3 + dp[i - 1]; cout << dp[a] << '\n'; return true; } int main() { solve(); return 0; } ```
#include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; inline int read() { char c = getchar(); int x = 0; bool f = 0; for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45); for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48); if (f) x = -x; return x; } int n; int main() { n = read(); cout << ((n << 1) - 1) * ((n << 1) - 1) + (n - 1) * n * 2; return 0; }
### Prompt In cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; inline int read() { char c = getchar(); int x = 0; bool f = 0; for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45); for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48); if (f) x = -x; return x; } int n; int main() { n = read(); cout << ((n << 1) - 1) * ((n << 1) - 1) + (n - 1) * n * 2; return 0; } ```
#include <bits/stdc++.h> int main() { long long int a, i, ans = 1; scanf("%lld", &a); for (i = 2; i <= a; i++) { ans += 12 * (i - 1); } printf("%lld\n", ans); return 0; }
### Prompt Develop a solution in cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { long long int a, i, ans = 1; scanf("%lld", &a); for (i = 2; i <= a; i++) { ans += 12 * (i - 1); } printf("%lld\n", ans); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 6 * n * (n - 1) + 1; return 0; }
### Prompt Please formulate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 6 * n * (n - 1) + 1; return 0; } ```