Search is not available for this dataset
name stringlengths 2 112 | description stringlengths 29 13k | source int64 1 7 | difficulty int64 0 25 | solution stringlengths 7 983k | language stringclasses 4
values |
|---|---|---|---|---|---|
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
printf("%d", 6 * x * (x - 1) + 1);
}
| CPP |
171_B. Star | <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 | 2 | 8 | n = int(input())
o = n * (n - 1) * 6 + 1
print(o) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
long long ans = 1;
long long tambah = 3;
for (int i = 1; i < n; i++) {
ans += (tambah * 6);
ans -= 6;
tambah += 2;
}
cout << ans << endl;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
int r = 0;
for (int i = 1; i < a; i++) {
r += i;
}
cout << 1 + r * 12 << endl;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
void solve() {
int a, ans = 1;
cin >> a;
for (int i = 1; i <= a; ++i) ans += (i - 1) * 12;
cout << ans << "\n";
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
while (t--) solve();
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
int main() {
int n, count = 1;
scanf("%d", &n);
if (n >= 2) count += 12;
for (int i = 3; i <= n; i++) {
count += 12 * (i - 2) + 12;
}
printf("%d", count);
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Locale;
import java.util.StringTokenizer;
public class B {
private vo... | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int a[19000];
int main() {
int ans = 1;
int n;
cin >> n;
int cur = 12;
for (int i = 1; i < n; i++) {
ans += cur;
cur += 12;
}
cout << ans;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
public class B {
private StreamTokenizer in;
private PrintWriter out;
public static void main (String[] args... | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
const double eps = 1e-10;
using namespace std;
int dblcmp(double x) {
if (fabs(x) < eps) return 0;
return x > 0 ? 1 : -1;
}
int main() {
int i, j, k, n;
int a, b;
string s;
while (cin >> a) {
k = 1;
for (i = 1; i < a; ++i) k += 12 * i;
cout << k << endl;
}
return 0;
... | CPP |
171_B. Star | <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 | 2 | 8 | import java.io.*;
import java.util.*;
public class b{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int s = 1;
for(int i = 2; i <= n; i++){
s += 12 * (i-1);
}
System.out.println(s);
}
}
//n** {{1}}
//n** {{2}}
//n** {{3}}
| JAVA |
171_B. Star | <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 | 2 | 8 |
# Author : raj1307 - Raj Singh
# Date : 01.02.2020
from __future__ import division, print_function
import os,sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
from __builtin__ import xrange as range
from future_builtins import ascii, filter, hex, map, oct, zip
def ii(): return int(input())
... | PYTHON |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
cout << 6 * n * (n - 1) + 1 << endl;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | def triangle(n):
return n*(n+1)//2
def hexagon(n):
return 6*triangle(n) - 6*n + 1
n = int(input())
print(2*triangle(3*n - 2) - hexagon(n)) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
public class Task171B {
public static void main(String... args) throws NumberFormatException,
IOException {
Solution... | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << n * 6 * (n - 1) + 1 << endl;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
int main() {
long long a, x = 1;
scanf("%lld", &a);
for (long long int i = 1; i <= a; i++) x += 9 * (i - 1) + 3 * (i - 1);
printf("%lld\n", x);
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
int main() {
int i, n, sum = 13;
scanf("%d", &n);
if (n == 1) {
printf("%d", 1);
return 0;
}
if (n == 2) {
printf("%d", 13);
return 0;
}
for (i = 3; i <= n; i++) {
sum = sum + (2 * i - 2) * 6;
}
printf("%d", sum);
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.util.Scanner;
public class b171 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
System.out.println(6 * n * (n - 1) + 1);
}
}
| JAVA |
171_B. Star | <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 | 2 | 8 | n = int(input())
print(1+6*n*(n-1))
# Made By Mostafa_Khaled | PYTHON3 |
171_B. Star | <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 | 2 | 8 | #In the name of Allah
from sys import stdin, stdout
input = stdin.readline
a = int(input())
ans = 1
for i in range(1, a):
ans += 6 * (2 * i)
stdout.write(str(ans))
| PYTHON3 |
171_B. Star | <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 | 2 | 8 | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class FirstApril2012 {
void solve () throws IOException {
int a = in.nextInt();
int f[] = new int[a + 10];
f[1] = 1;
f[2] = 1 + 6 + 6;
int p = 3;
for (int i = 3; i <= a; i++){
... | JAVA |
171_B. Star | <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 | 2 | 8 | n = int(input())
print(6 * n * (n - 1) + 1)
| PYTHON |
171_B. Star | <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 | 2 | 8 | def init():
a = int(raw_input())
return int(a)
def solve(n):
a = (3 * n - 2) * (3 * n - 1) / 2
b = 3 * n * (n - 1) + 1
return 2 * a - b
if __name__ == "__main__":
a = init()
print solve(a)
| PYTHON |
171_B. Star | <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 | 2 | 8 | n = int(input())
print( 1+sum([12*(i-1) for i in range(2,n+1)])) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
cout << 1 + 12 * n * (n - 1) / 2 << endl;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
int a = 1 + 12 * (n * (n - 1) / 2);
cout << a;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.util.*;
public class Problem0171b {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(triangular(n-1)*4 + (n*2-1)*(n*2-1));
}
public static int triangular(int n) {
if(n == -1) {
retur... | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
template <typename T>
T inline SQR(const T &a) {
return a * a;
}
template <typename T>
T inline ABS(const T &a) {
return a < 0 ? -a : a;
}
const double EPS = 1e-9;
inline int SGN(double a) {
return ((a > EPS) ? (1) : ((a < -EPS) ? (-1) : (0)));
}
inline int CMP(double a, double b) { retur... | CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int depth, solution = 1;
cin >> depth;
for (int size = 12; depth > 1; --depth, size += 12) solution += size;
cout << solution << "\n";
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Star {
public static void main(String[] args) throws Exception {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
long n = Long.parseLong(bf.readLine());
System.out.println(6 * n * (n - 1) + 1);
}
}
| JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a;
cin >> a;
if (a == 1LL) {
cout << 1;
return 0;
}
--a;
long long res = (3LL * a + 2LL) * (3LL * a + 1LL) / 2LL;
res += 3LL * a * (a + 1LL) / 2LL;
cout << res << endl;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
int n;
int main() {
scanf("%d", &n);
printf("%d", 1 + 6 * n * ~-n);
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.io.*;
import java.util.*;
public class Solution {
public static StringTokenizer tok = null;
public static BufferedReader cin;
public static String nextToken() throws Exception {
if (tok == null || !tok.hasMoreTokens()) {
tok = new StringTokenizer(cin.readLine());
}
return tok.nextToken();
}
... | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a;
cin >> a;
cout << (1 + 12 * a * (a - 1) / 2) << endl;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import sys
a = input()
s = 1
if a == 1: print s; sys.exit(0)
for i in range(2,a+1):
s += 6*(i-1)*2
print s | PYTHON |
171_B. Star | <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 | 2 | 8 | import static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
... | JAVA |
171_B. Star | <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 | 2 | 8 | import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class Star {
public static void main(String[] args) {
InputStream in = System.in;
PrintStream out = System.out;
Scanner input = new Scanner(in);
int a = input.nextInt();
if... | JAVA |
171_B. Star | <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 | 2 | 8 | n = input()
result = 6*n*n - 6*n + 1
print result
| PYTHON |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
long long qpow(long long a, long long b) {
long long s = 1;
while (b > 0) {
if (b % 2 == 1) {
s = s * a;
}
a = a * a;
b = b >> 1;
}
return s... | CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n == 1)
cout << 1;
else {
long long res = 13, s = 12;
for (int i = 3; i <= n; ++i) {
s += 12;
res += s;
}
cout << res;
}
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << 6 * n * (n - 1) + 1;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m = 0;
cin >> n;
for (int i = 1; i < n; i++) {
m += i;
}
if (n == 1) {
cout << 1;
return 0;
}
long long y = (2 * n + (n - 2)) * (2 * n + (n - 1));
y = y / 2;
cout << y + 3 * m;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin >> n;
long long int ans = 0;
for (long long int i = 0; i < n; i++) {
ans += 12 * i;
}
cout << ans + 1;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int a, res, i, side, cnt;
int main() {
cin >> a;
cnt = 0;
if (a == 1)
res = 1;
else {
res = 1;
side = 1;
for (i = 1; i < a; i++) {
side += 3;
res += side * 3;
if (i > 1) res += cnt * 3;
cnt++;
}
}
cout << res << endl;
... | CPP |
171_B. Star | <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 | 2 | 8 | n = int(input())
print(n * (n - 1) * 6 + 1)
| PYTHON3 |
171_B. Star | <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 | 2 | 8 | import java.util.*;
public class Star {
public static void main(String[] args){
Scanner reader = new Scanner(System.in);
int n = reader.nextInt();
long[] memo = new long[n+1];
memo[1] = 1;
for(int i = 2; i <= n; i++)
memo[i] = memo[i-1] + 12l*(i-1);
System.out.println(memo[n]);
}
}
| JAVA |
171_B. Star | <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 | 2 | 8 | import java.util.*;
public class B {
public static void main(String[] args) {
long r = 1;
for (long n = new Scanner(System.in).nextLong(); n-- > 1;) {
r += 12 * n;
}
System.out.println(r);
}
}
| JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long n;
cin >> n;
cout << 6 * n * (n - 1) + 1 << '\n';
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.util.*;
public class a {
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int n;
n=scan.nextInt();
System.out.println(6*n*(n-1)+1);
}
}
| JAVA |
171_B. Star | <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 | 2 | 8 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.List;
public class Main ... | JAVA |
171_B. Star | <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 | 2 | 8 | import java.io.*;
import java.util.*;
import java.math.*;
public class Codeforces implements Runnable {
BufferedReader in;
PrintWriter out;
StringTokenizer st;
Random rnd;
void solve() throws IOException {
int n = nextInt();
int res = 6 * n * (n - 1) + 1;
out.println(res);
}
public static void main(Stri... | JAVA |
171_B. Star | <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 | 2 | 8 | '''
Created on Apr 22, 2013
@author: ola
'''
def ps(x):
total = 1
while x > 1:
total += (2*x - 1)*6 - 6
x = x - 1
return total
def solve():
line = raw_input()
data = line.split()
x = int(data[0])
if x == 1:
print 1
else:
print ps(x)
if __name__ == '__m... | PYTHON |
171_B. Star | <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 | 2 | 8 | import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static ... | JAVA |
171_B. Star | <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 | 2 | 8 | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class T171B {
public void solve(int n) {
long[] ans = new long[18258];
ans[1] = 1;
ans[2] = 12;
for (int i = ... | JAVA |
171_B. Star | <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 | 2 | 8 | #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];
}
| CPP |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | //2021 B
import java.util.*;
import java.io.*;
public class Solution {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
int caseNum = 1;
for (int ks = 1; ks <= caseNum; ks++) {
System.out.println(new Solution().solve(input));
}
}
... | JAVA |
171_B. Star | <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 | 2 | 8 | import java.util.*;
public class b {
/**
* @param args
*/
static Scanner in=new Scanner(System.in);
public static void main(String[] args) {
// TODO Auto-generated method stub
int n=in.nextInt();
int ans=1;
for(int i=1;i<n;i++){
ans+=6*(2*i);
}
System.out.println(ans);
}
}
| JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a;
cin >> a;
cout << 6 * a * (a - 1) + 1 << endl;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.io.*;
import java.util.*;
public class B {
public void solve() throws IOException {
int n = nextInt();
int ans = 1;
for (int i = 2; i <= n; i++) {
ans += (2 * i - 2) * 6;
}
writer.println(ans);
}
public static void main(String[] args) throws... | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
int main() {
int x;
scanf("%d", &x);
printf("%d\n", 6 * x * (x - 1) + 1);
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
do
{
long n = input.nextLong();
long resultado = (((3*n-1)*(3*n-2)+(n)*(n-1)*3)/2);
System.out.println(resultado);
}while(input... | JAVA |
171_B. Star | <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 | 2 | 8 | n = int(input())
S = 1 + 12 * n * (n - 1) / 2
print(int(S))
| PYTHON3 |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << (n * (n - 1) * 6 + 1);
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | n=int(input())
print(1+6*(n*(n-1))) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
cout << 6 * (n * (n - 1)) + 1 << endl;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import sys
import copy
from collections import Counter
sys.setrecursionlimit(11111)
import re
import itertools
n = int(sys.stdin.readline().strip())
print 6 * n * (n-1) + 1 | PYTHON |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #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;... | CPP |
171_B. Star | <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 | 2 | 8 | import java.util.*;
public class sad {
public static void main(String[] args)
{
Scanner inp=new Scanner(System.in);
int i=1,n,cnt=0,x=1;
n=inp.nextInt();
for(i=1;i<n;i++)
{
cnt=cnt+12*i;
}
System.out.println(cnt+1);
// <3 #... | JAVA |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.io.*;
import java.util.*;
public class Tasks {
public static void main(String[] args) throws IOException {
new Tasks().runMain();
}
void runMain() {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if (n == 1) System.out.print(1);
else if(n ... | JAVA |
171_B. Star | <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 | 2 | 8 | import java.util.Scanner;
public class AprilB {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int x = 1;
for (int i = 1; i < n; i++) {
x= x+12*i;
}
System.out.println(x);
}
}
| JAVA |
171_B. Star | <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 | 2 | 8 | n=int(input())
a=3*n-2
b=n-1
print(int((a*(a+1))/2 + ((b*(b+1))/2)*3)) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | n = int(input())
print(int((2*n-1)*(2*n-1)+4*(n-1)*(n)/2))
| PYTHON3 |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | ## DATA SOURCE (1 for file, 0 for std input)
opt = 0
src = opt and open("input", "r") or None
def gvals(source, format = int, separator = ' '):
if source:
a = map(format, source.readline().split(separator))
else:
a = map(format, raw_input().split(separator))
return a
def gval(source, format = int):
if source:... | PYTHON |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #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;
fo... | CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << n * (n - 1) * 6 + 1;
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | a = int(input())
k = 1
p = 12
for i in range(a - 1):
k += p
p += 12
print(k) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | r=1
for i in range(int(input()),1,-1):
r+=6*((i-1)*2)
print(r)
| PYTHON3 |
171_B. Star | <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 | 2 | 8 | print(sum((i - 1) * 12 for i in range(1, int(input()) + 1)) + 1) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
long long t;
int main() {
scanf("%d", &t);
printf("%d", 6 * t * (t - 1) + 1);
return 0;
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.util.Scanner;
public class alalal2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int sayi = input.nextInt();
int x=sayi;
int b=0;
int result=0;
if(sayi>1){
for(int a=1;a<x;a++){
result=(sayi-1)*12;
sayi--;
b=b+result;
}
}
else{... | JAVA |
171_B. Star | <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 | 2 | 8 | #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 lo... | CPP |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | #star noumber problem
# 1 13....
n=int(input())
k=6*n;k1=n-1;ans=k*k1
print(ans+1)
| PYTHON3 |
171_B. Star | <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 | 2 | 8 | IOI=int(input())
print(IOI*(IOI-1)*6+1) | PYTHON3 |
171_B. Star | <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 | 2 | 8 | #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;
}
| CPP |
171_B. Star | <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 | 2 | 8 | // practice with kaiboy
import java.io.*;
import java.util.*;
public class CF171B extends PrintWriter {
CF171B() { super(System.out, true); }
Scanner sc = new Scanner(System.in);
public static void main(String[] $) {
CF171B o = new CF171B(); o.main(); o.flush();
}
int triangle(int n) {
return n * (n + 1) / 2... | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
printf("%d", 6 * n * (n - 1) + 1);
}
| CPP |
171_B. Star | <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 | 2 | 8 | import java.util.Scanner;
public class Main {
static long sol;
static int a;
public static void main(String[] args) {
Scanner l = new Scanner(System.in);
a=l.nextInt();
sol=6*a*(a-1)+1;
System.out.println(sol);
}
} | JAVA |
171_B. Star | <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 | 2 | 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << 6 * n * (n - 1) + 1;
}
| CPP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.