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 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
impo... | 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 susbus{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long p = n*n*6-6*n+1;
System.out.println(p);
}
} | 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 arr[18530];
arr[0] = 0;
arr[1] = 1;
arr[2] = 13;
for (int i = 3; i <= 18527; i++) arr[i] = 12 * (i - 1) + arr[i - 1];
int n;
cin >> n;
cout << arr[n] << 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 java.io.*;
public class star
{
public static void main(String args[])throws IOException
{
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(read);
int i,n,s;
s=0;
n=Integer.parseInt(in.readLine());
if(n>1)
{
for(i=1;i<n;i++)
s+=i;
}
s*=12;
s... | 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.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws IOException
*/
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 | #include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
cin >> x;
}
template <class A>
void read(vector<A> &x) {
for (auto &a : x) read(a);
}
string to_string(bool b) { return b ? "TRUE" : "FALSE"; }
string yesno(bool b) { return b ? "YES" : "NO"; }
string to_string(char c) { return strin... | 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;
unsigned long long n, ans = 1;
int main() {
cin >> n;
for (unsigned long long i = 2; i <= n; i++) ans += (i - 1) * 12;
cout << ans;
}
| 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=input()
n=n-1
if n==0:
print "1"
exit(0)
print (n*(2*12+(n-1)*12))/2+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;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long n;
cin >> n;
long long m = n - 1, ans = 0;
for (long long k = m; k >= 1; k--) {
long long j = 12 * k;
ans += j;
}
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 | x = int(input())
print((6*x*(x-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 | import java.util.Scanner;
public class Main1 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
System.out.println(1+6*((a-1)*a));
}
} | 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() {
long long int n;
scanf("%I64d", &n);
printf("%I64d", 1 + n * (n - 1) * 6);
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 = 0;
scanf("%d", &n);
int s = 0, nr = 0;
s = 1;
for (int i = 2; i <= n; i++) nr += 12, s += nr;
printf("%d\n", s);
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 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;
int main() {
int a, result = 1;
cin >> a;
for (int i = 1; i <= a; i++) {
result = result + (i - 1) * 12;
}
cout << result;
}
| 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 hdrstop
using namespace std;
#pragma argsused
int main(int argc, char* argv[]) {
int a, b = 1;
cin >> a;
for (int i = 1; i < a; i++) {
b += 12 * i;
}
cout << b << 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 | a = int(input())
print(6 * a**2 - 6 * a + 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>
int main() {
int n;
scanf("%d\n", &n);
printf("%d\n", n * 6 * (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 | #include <bits/stdc++.h>
using namespace std;
inline int read() {
int a = 0, f = 1;
char ch = getchar();
for (; !isdigit(ch); ch = getchar())
if (ch == '-') f = -1;
for (; isdigit(ch); ch = getchar()) a = (a << 3) + (a << 1) + ch - '0';
return a * f;
}
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
signe... | 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 | x = int(input()) - 1
y = 6*x**2 + 6*x + 1
print(y)
| 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;
int a[21111];
a[1] = 1;
for (int i = 2; i <= n; i++) {
a[i] = a[i - 1] + ((i - 1) * 2 - 1) * 3 + i * 6 - 3;
}
cout << a[n] << 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 | a=int(input())
print(1+6*a*(a-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 tr(long long x) { return x * (x + 1) / 2; }
int main() {
long long n;
cin >> n;
cout << tr(n * 2 + n - 2) + 3 * tr(n - 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;
int main() {
int n;
long long s = 0;
cin >> n;
n--;
s = 1;
for (int i = 1; i <= n; i++) {
s = s + 12 * i;
}
cout << s;
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())
print((a-1)*(a)*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 | //package aprilfool;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
public class B {
InputStream is;
PrintWriter out;
String INPUT = "";
void solve()
{
int a = ni();
long s = 1;
for(int i = 2;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 | a=int(input())
n=a-1
s=n*(6*n+6)
print(s+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;
const int intmax = 0x3f3f3f3f;
const long long lldmax = 0x3f3f3f3f3f3f3f3fll;
double eps = 1e-8;
template <class T>
inline void checkmin(T &a, T b) {
if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
if (b > a) a = b;
}
template <class T>
inline 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 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {
public static final long MOD = (long) 1e9 + 7;
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
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 | a = int(input())
ans = 1
z = 0
for i in range(2, a + 1):
z += 2
ans += z * 6
print(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 | #include <bits/stdc++.h>
int main(int argc, char **argv) {
long long int n;
std::cin >> n;
long long int result =
(n * 3LL - 2LL) * (n * 3LL - 1LL) / 2LL + 3LL * n * (n - 1LL) / 2LL;
std::cout << result;
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 j{public static void main(String a[])throws IOException{Scanner b=new Scanner(System.in);double m=b.nextDouble();System.out.print((long)(6*m*(m-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 | a=input();print 6*a*~-a+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 | a = input ()
b = 0
if 1 <= a <= 18257 :
while a != 0 :
c = ( a - 1 ) * 12
b += c
a -= 1
print b + 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 | import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.*;
public class Star{
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream ... | 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 a[19000], b, c, n;
a[1] = 1;
int i = 2;
while (i <= 18257) {
a[i] = a[i - 1] + 12 * (i - 1);
i++;
}
while (scanf("%d", &n) != EOF) {
printf("%d\n", a[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 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
int s;
s = n * (n - 1) * 6 + 1;
cout << s << 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.util.Scanner;
public class B171 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long N = in.nextInt();
long answer = 6*N*(N-1)+1;
System.out.println(answer);
}
}
| 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=6*n*(n-1)+1
print(a) | 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 | x=int(raw_input())
print 1+6*x*(x-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 | number = input()
print (6 * number * (number-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 | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws Exception {
int... | 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(raw_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 | #include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
printf("%d\n", 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 | import java.io.*;
import java.util.*;
import java.lang.Math.*;
public class star_num
{
public static void main(String args[])throws Exception
{
Scanner in=new Scanner(System.in);
int n=in.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 | #include <bits/stdc++.h>
using namespace std;
int triangle(long long n) {
if (n == 1)
return 1;
else
return n + triangle(n - 1);
}
int heart(long long a) {
if (a == 1)
return 1;
else
return (6 * (a - 1)) + heart(a - 1);
}
int balls(long long a) {
if (a == 1)
return 1;
else
return hea... | 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 x = 0, n, ans = 1;
scanf("%d", &n);
for (int i = 1; i < n; i++) x += 12, ans += x;
printf("%d\n", 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 | #include <bits/stdc++.h>
#pragma hdrstop
using namespace std;
#pragma argsused
int main(int argc, char* argv[]) {
int a, b = 1;
cin >> a;
for (int i = 1; i < a; i++) {
b += 12 * i;
}
cout << b << 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 | var dp = new Int32Array(18257);
dp[0] = 1;
for (var i = 1; i < 18257; i++)
dp[i] = dp[i - 1] + 12 * i;
print(dp[readline() - 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 | #!/usr/bin/env python
from sys import stdin
N = int(stdin.readline())
#N -= 1
res = 1 + 12 * (N * (N-1)) / 2
print res
| 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 | a = input()
print 6 * a * a - 6 * a + 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;
int main() {
int n, k = 1, a[100000];
scanf("%d", &n);
a[1] = 1;
while (k < n) {
k++;
a[k] = a[k - 1] + 12 * (k - 1);
}
printf("%d\n", a[k]);
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(raw_input())
print(6 * a * (a - 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;
int main() {
int n;
while (cin >> n) {
int r = 1;
for (int i = 0, j = 0; i < n; i++, j += 2) r += j * 6;
cout << r << 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.util.Scanner;
public class CF
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int ans = 1 + 6*n*(n-1);
System.out.println(ans);
scan.close();
}
} | 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 sys
input = lambda: sys.stdin.readline().rstrip()
n = int(input())
print(6*n*(n-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() {
int n;
long long result;
cin >> n;
result = 6 * n * (n - 1) + 1;
cout << result;
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.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collectio... | 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
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int sum = 0;
for(int i = 1; i <= n; i++) {
if(i == 1) {
sum += 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(raw_input())
n = (6 * n - 6) * n + 1
print n
| 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.util.Scanner;
public class cfBStar {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
long ret = 1;
for (int k = 1; k < n; k++) {
ret += (2*k) * 6;
}
System.out.println(ret);
}
}
| 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 | print sum([12*(i-1) for i in xrange(1,int(raw_input())+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 | import java.util.*;
public class cf171b {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long a = in.nextInt();
System.out.println(6*a*(a-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 sys
a = int( sys.stdin.readline() )
print( 6 * a * (a - 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>
int n;
int main() {
scanf("%d", &n);
printf("%d", (2 * n - 1) * (2 * n - 1) + 4 * (n - 1) * n / 2);
}
| 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 X {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long n = in.nextLong();
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;
bool cmp(const int &a, const int &b) { return a > b; }
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
cin.exceptions(cin.failbit);
long long 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 | #include <bits/stdc++.h>
using namespace std;
long long arr[(int)1e6] = {};
int main() {
int n;
cin >> n;
arr[0] = 1, arr[1] = 13;
for (int i = 1; i <= n; i++) {
arr[i] = arr[i - 1] + (12 * i);
}
cout << arr[n - 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>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int nomalDay[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int leapDay[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int OHT = 100100;
const int TH = 1010;
const int FH = 510;
const int MAXINF = (2 << 26... | 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 p171b
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long count = 6*a*(a-1)+1;
System.out.println(count);
}
} | 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.*;
public class star{
public static void main(String args[])throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int c = 0;
int p = Integer.parseInt(in.readLine());
int count=-1;
for(int i=0;i<p;i++){
c+=i;
count++;
}
int x = 2*p-1;
int y =... | 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 int m, s = 1;
cin >> m;
for (long int i = 0; i < m; i++) {
s = s + 12 * i;
}
cout << s << 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 = input()
n = int(n)
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 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Solution {
//<editor-fold desc="input parse" defaultstate="collapsed">
private static StringTokenizer st;
private static BufferedReader reader = new BufferedReader(new InputStreamReader(System.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 | def hex(n):
return 3 * n * (n+1) + 1
def tri(n):
return n * (n+1) / 2
import sys
n = int(sys.stdin.readline())
print 2 * tri(3 * n - 2) - hex(n - 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>
FILE *in, *out;
int main() {
int i, a, b, c = 1, say = 0, q;
long long n = 1;
char dixi[100000];
scanf("%d", &a);
if (a == 1) {
printf("1");
return 0;
}
for (i = 1; i < a; i++) n += 12 * i;
printf("%I64d", 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 | k = int(raw_input())
print sum((i + 1) * 6 + (i - 1) * 6 for i in xrange(k)) + 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 | n = int(input())
m = n-1
n = 1+3*m
print(n*(n+1)//2 + 3*(m*(m+1)//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 | x=int(input())
if(x==1):
print(1)
elif(x==0):
print(0)
else:
u=1
plus=0
for i in range(x-1):
plus+=2
u+=6*plus
print(u) | 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.InputStreamReader;
import java.util.StringTokenizer;
public class B {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTo... | 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;
signed main() {
long long int 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 | #include <bits/stdc++.h>
using namespace std;
long long a;
string b;
int main() {
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;
int toInt(string s) {
int r = 0;
istringstream sin(s);
sin >> r;
return r;
}
long long toInt64(string s) {
long long r = 0;
istringstream sin(s);
sin >> r;
return r;
}
double toDouble(string s) {
double r = 0;
istringstream sin(s);
sin >> r;
return r... | 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;
int v = 6 * n * (n - 1);
cout << v + 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 Star {
Scanner in =new Scanner(System.in);
public static void main(String args[]){
new Star().go();
}
public void go(){
int count=1;
int prev=0;
int a=in.nextInt();
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 | a=int(input())
print(a*(a-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;
int s[18257 + 1];
int main() {
memset(s, 0, sizeof(s));
s[1] = 1;
for (int i = 2; i <= 18257; i++) {
s[i] = (2 * i - 3) * 6 + 6;
}
int a;
scanf("%d", &a);
if (a == 1) {
cout << s[1] << endl;
} else {
int sum = 0;
for (int i = 1; i <= a; i++) ... | 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())
a=[0]*n
a[0]=1
for i in range(1,n):
a[i]=a[i-1]+(6*(i*2))
print(a[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>
int main() {
int a, b, c, d, sum = 1;
scanf("%d", &a);
if (a == 1)
printf("1");
else {
for (b = 1; b < a; b++) sum += (b * 12);
printf("%d", sum);
}
}
| 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(void) {
int A, R;
cin >> A;
R = (6 * A) * (A - 1) + 1;
cout << R << 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.util.*;
import java.io.*;
public class j {
public static void main(String[] args) throws Exception
{
Scanner input = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = input.nextInt();
out.println((long)6*n*n-6*n+1);
out.close();
}
}
| 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 a;
while (scanf("%d", &a) != EOF) {
long long ans(1), dx(3);
for (int i = 2; i <= a; ++i) {
ans += 6 * dx - 6;
dx += 2;
}
printf("%I64d\n", ans);
}
}
| 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 = input()
print n*(n-1)*6+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;
int main() {
int n;
scanf("%d", &n);
int ret = n * (n - 1) / 2;
ret = 1 + 12 * ret;
printf("%d\n", ret);
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;
const int MOD = 1e9 + 7;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long amount[18258];
amount[1] = 1;
for (int i = 2; i < 18258; i++) {
amount[i] = amount[i - 1] + (i - 1) * 12;
}
int n;
while (cin >> n) {
cout << amo... | 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 - 6 * n + 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 star(long long int n);
int main() {
long long int n;
cin >> n;
cout << star(n) << endl;
return 0;
}
int star(long long int n) {
if (n == 1) return 1;
return ((n * 12) - 12) + star(n - 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 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(0);
;
int i, a;
long long A[18258];
A[1] = 1;
for (i = 2; i < 18258; i++) A[i] = A[i - 1] + 12 * (i - 1);
cin >> a;
cout << A[a];
}
| 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 | # -*- coding: utf-8 -*-
a = int(raw_input())
def f(n):
return (2*n-1)*3 + (2*n-3)*3
res = 1
for i in xrange(2, a+1):
res += f(i)
print res
| 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>
int main() {
int a, b;
scanf("%d", &a);
b = 1 + 6 * a * (a - 1);
printf("%d\n", b);
return 0;
}
| CPP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.