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.*;
public class b {
public static void main(String[] args) throws Throwable {
int n = Integer.parseInt(
new BufferedReader(new InputStreamReader(System.in)).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>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
template <class T>
double sqrt(T x) {
return sqrt((double)x);
}
template <class T>
T sqr(T x) {
return x * x;
}
const double PI = acos(-1.0);
const int INF = 1000000000;
const int MOD = 1000000007;
void wa() {
cout << 5;
e... | 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 num;
long long result;
cin >> num;
result = 6 * num * (num - 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class B{
public static void main(String[] args) {
FastScanner scan = new FastScanner();
PrintWriter out = new PrintWriter(System.out);
int[] dp = new... | 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 Prob171B {
public static void main(String[] Args) {
Scanner in = new Scanner(System.in);
long side = in.nextInt();
long ans = (side - 1) * side * 6 + 1;
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 | import java.io.*;
public class Main
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n= Integer.parseInt(br.readLine());
long c = 0;
int i = 0 ;
while(i<n)
{
c = c+i*12;
i++;
}
System.out.println(c+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())
s=1
for i in range(1,n):
s+=i*12
print(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>
int main() {
int n;
scanf("%d", &n);
int add = 0;
long long total = 1;
for (int i = 0; i < n; i++) {
total += add;
add += 12;
}
printf("%I64d\n", total);
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;
std::cin >> n;
std::cout << 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 | #include <bits/stdc++.h>
using namespace std;
int main() {
long a, S, i;
for (cin >> a, i = 0, S = 0; i < 1;
S += (6 * a * (a - 1) + 1), cout << S, ++i)
;
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.*;
import java.math.BigInteger;
public class AprB{
static BufferedReader br;
public static void main(String args[])throws Exception{
br=new BufferedReader(new InputStreamReader(System.in));
long a=toInt();
if(a==1){
System.out.println("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=int(input())
s=1
for i in range(0,a):
s+=i*12
print (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 << (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.math.*;
import static java.lang.Math.*;
import java.security.SecureRandom;
import static java.util.Arrays.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import sun.misc.Regexp;
import java.awt.geom.*;
import sun.net.www.content.text.plain;
public c... | 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() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
long long n, ans;
while (t--) {
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 int N;
cin >> N;
cout << (N * (N - 1) * 6) + 1 << 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 MAX(long long int a, long long int b) {
if (a > b) {
return a;
} else {
return b;
}
}
int MIN(long long int a, long long int b) {
if (a < b) {
return a;
} else {
return b;
}
}
int gcd(long long int a, long long int b) {
long long int c;
w... | 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() {
unsigned long int a, sum = 1, i;
scanf("%lu", &a);
for (i = 2; i <= a; i++) {
sum += (i - 1) * 12;
}
printf("%lu", 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 | #include <bits/stdc++.h>
int main() {
long long a;
scanf("%I64d", &a);
if (a == 1)
puts("1");
else
printf("%I64d\n", a * (a - 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 | #include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long MAX = 1e17;
int main() {
ios_base::sync_with_stdio(0);
;
int n;
cin >> n;
n = 1 + 6 * n * (n - 1);
cout << 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 | n = int(input())
print(1+6*(n**2-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.InputStreamReader;
import java.util.StringTokenizer;
public class B_171_Star {
public static void main(String[] args) throws IOException {
BufferedReader buf = new BufferedReader(
new InputStreamReader(System.in));
StringTokenizer st = ... | 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.*;
public class FirstApril {
FastScanner in;
PrintWriter out;
void solve() {
int n = in.nextInt() - 1;
int ans = 1;
int add = 0;
for (int i = 0; i < n; i++) {
add += 12;
ans += add;
}
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;
long long star(int n) {
if (n == 1)
return 1;
else
return 12 * n - 12 + star(n - 1);
}
int main() {
int n;
cin >> n;
cout << star(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) {
BufferedReader br = null;
InputStreamReader is = null;
try {
is = new InputStreamReader(System.in);
br = new BufferedReader(is);
... | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java... | 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] = {0};
int main() {
int a;
cin >> a;
A[0] = 1;
for (int i = 1; i < a; i++) A[i] = A[i - 1] + 6 + 6 * (2 * i - 1);
cout << A[a - 1] << 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>
int main() {
int n;
long long int s;
scanf("%d", &n);
s = 6 * n * (n - 1) + 1;
printf("%I64d", 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())
if a == 1:
print(1)
else:
print(6*(a-1) + 6*(a-1)**2 + 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;
void loadData(void);
int proc(void);
void printRes(int);
int a;
int main(int argc, char** argv) {
loadData();
printRes(proc());
return 0;
}
int proc(void) {
long long res = 0;
res += (long long)(a + a + a - 1) * (long long)a / (long long)2;
res += (long long)(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 | import sys
inN = int(sys.stdin.readline())
out = 1
for i in range(1,inN):
out += i*12
sys.stdout.write(str(out))
| 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 argc, char** argv) {
int n;
scanf("%d", &n);
n--;
printf("%d\n", (int)(1 + (long long)(n + 1) * (long long)n * 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 | num = int(input())
if num == 1:
print("1")
else:
print(int((num-1)*(num)/2)*12+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 | a = int(input())
ans = 6*(a-1)*a+1
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>
using namespace std;
long long n, s;
int main() {
cin >> n;
s = 6 * n * (n - 1) + 1;
cout << 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 A[10];
int main() {
int n, m, i, s = 1;
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 |
import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
long a = s.nextInt();
System.out.println(a * (a - 1) / 2 * 12 + 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() {
int a;
scanf("%d", &a);
printf("%d\n", 6 * a * (a - 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 | a = int(raw_input())
res = 1
for i in xrange(a):
res += 12 * 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 |
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author mas1991
*/
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n= in.nextInt();
int[]d= new in... | 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.*;
public class Template implements Runnable {
BufferedReader in;
PrintWriter out;
StringTokenizer tok = new StringTokenizer("");
void init() throws FileNotFoundException {
try {
in = new BufferedReader(new FileReader("input.txt"));
o... | 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(void) {
int n;
scanf("%d", &n);
n--;
long m = n * (n + 1) / 2;
m *= 12;
m++;
printf("%I32d", m);
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;
int main() {
scanf("%lld", &a);
printf("%lld", 1 + 12 * (a * (a - 1) / 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 | //package codeforces;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class A implements Closeable {
Buffere... | 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;
int ans = 0;
for (int i = 1; i < n; i++) ans += i * 12;
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() {
long long a;
cin >> a;
if (a == 1) {
cout << 1;
return 0;
}
cout << (a - 1) * a * 6 + 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() {
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;
}
| 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, a = 1, b = 12;
scanf(" %d", &n);
for (int i = 0; i < n - 1; i++) {
a += b;
b += 12;
}
printf("%d", 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 | n = int(input())
print((3 * n - 1) * (3 * n - 2) - 3 * 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 |
import java.util.Scanner;
public class Test {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int ans = 0;
for(int i=1;i<n;i++)
ans += 12*i;
System.out.println(ans+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() {
int n;
while (~scanf("%d", &n)) {
int res = 1;
for (int i = 1; i < n; i++) res += i * 12;
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 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
cout << ((3 * n - 2) * (3 * n - 1) + 3 * (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, ans;
int main() {
cin >> n;
ans = (2 * n - 1) * (2 * n - 1) + 4 * (n - 1) * (n) / 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 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>
using namespace std;
int main() {
long long i;
while (scanf("%I64d", &i) != EOF) {
long long ans = (3 * i - 1) * (3 * i - 2) / 2 + 3 * i * (i - 1) / 2;
printf("%I64d\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 | import sys
FIN = sys.stdin
FOUT = sys.stdout
a = int(FIN.readline())
ans = 1
for i in range(a):
ans += 12 * i
FOUT.write(str(ans)) | 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 | integer = int(input())
if integer == 1: print(1)
else:print(1+integer*(integer-1)*6) | 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 math
t=int(input())
if(t==1):
print(1)
else:
x=t-1
print(6*t*x +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 | sum = 1
n = int(input())
if n ==1:
print(sum)
else:
for i in range(1, n):
sum += 12*i
print(sum)
| 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 res = 1;
int a;
cin >> a;
for (int i = 1; i < a; i++) {
res += 12 * i;
}
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 | from sys import stdin, gettrace
if not gettrace():
def input():
return next(stdin)[:-1]
# def input():
# return stdin.buffer.readline()
def main():
a = int(input())
print(6*a*(a-1) + 1)
if __name__ == "__main__":
main() | 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 pray(int a) {
if (a == 1) return 1;
if (a == 2) return 13;
return ((a - 1) * 12) + pray(a - 1);
}
int main() {
ios_base::sync_with_stdio(false);
int a;
cin >> a;
cout << pray(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 | #include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-11;
int main() {
cout << setiosflags(ios::fixed) << setprecision(10);
int t = 13;
int n;
cin >> n;
if (n == 1)
cout << 1;
else {
int k = 24;
for (int i = 0; i < (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 | x=int(input())
print(x*6*(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 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
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 |
// ~/BAU/ACM-ICPC/Teams/A++/BlackBurn95
// ~/sudo apt-get Accpeted
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;
... | 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;
cin >> a;
if (a == 1)
cout << 1;
else
cout << 6 * a * (a - 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 {
void run(){
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
long edge=12;
long sum=1;
for(int i=2;i<=n;i++){
sum+=edge;
edge+=12;
sum%=2000000000;
edge%=2000000000;
... | 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;
/**
*
* @author owner
*/
public class JavaApplication7 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int n = (new Scanner(System.in)).nextInt();
System.out.print(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 | //package codeforce171;
import java.util.Scanner;
public class B {
public long solve(long n) {
if (n == 1)
return 1;
long sideLen = n * 3 - 2;
return sideLen * (sideLen + 1) / 2 + (n - 1) * n / 2 * 3;
}
public static void main(String[] args) {
B problem = new B();
Scanner scanner = new Scanner(Syste... | 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;
int main() {
cin >> a;
cout << 6 * a * (a - 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>
int main() {
int n;
scanf("%d", &n);
long long a = 1, b = 12;
for (int i = 0; i < n - 1; i++) {
a += b;
b += 12;
}
printf("%I64d\n", 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 | #include <bits/stdc++.h>
using namespace std;
const int maxN = 30 + 321;
int main() {
ios::sync_with_stdio(0);
int n;
cin >> n;
long long ans = 0;
if (n == 1) {
cout << '1' << endl;
return 0;
}
ans = 1;
for (int i = 2; i <= n; i++) ans += 11 * (i - 1) + i - 1;
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 | n = int(input().split()[0])
print((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 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
in.close();
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() {
ios_base::sync_with_stdio(false);
long long n;
cin >> n;
n--;
cout << ((3 * n + 1) * (3 * n + 2) / 2) + (3 * (n) * (n + 1) / 2) << 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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
public class A {
public static long Mod = 1073741824;
public static void main(String[] args) {
try {
... | 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 static java.util.Arrays.deepToString;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;
public class Main {
static void solve() throws IOException {... | 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.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;
public class FoolDay_B implements Runnable {
final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
BufferedReader in;
PrintWriter out;
StringTokenizer tok;
public static void main(String[] arg... | 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())
if a == 1:
print(1)
else:
print(12 * (a - 1) * a // 2 + 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 t;
scanf("%d", &t);
printf("%lld", (long long)(t * 3 - 2) * (t * 3 - 1) / 2 +
(long long)t * 3 * (t - 1) / 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 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a = 0, output = 0, last = 1, i = 1, j = -1;
cin >> a;
for (int k = 1; k <= a; k++) {
output = last + 2 * i + 2 * j;
i += 2;
j += 4;
last = output;
}
cout << output;
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;
signed main() {
long long n, ans = 0;
cin >> n;
for (long long i = 2; i <= n; i++) ans += (i * 2 - 1) * 6 - 6;
cout << ans + 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>
int N;
int main() {
scanf("%d", &N);
printf("%d", (N - 1) * N * 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 | import sys
n = int(sys.stdin.readline()) # get the number of test cases
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 | a = int(input())
print(1 + (a * (a - 1) // 2) * 12) | 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 * 6) - 6 * (n - 1) - 5 << 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() {
long long int n;
cin >> n;
cout << n * 6 * (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.util.Scanner;
public class B171 {
public static void main(String[] args)
{
Scanner read = new Scanner(System.in);
short input = read.nextShort();
read.close();
System.out.println((6*input*(input-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())
x = n * 3 - 2
print(x * (x + 1) - (n * (n + 1) * 3 - n * 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 xd(long long n) { return (((n - 1) * 12) * n) / 2 + 1; }
int main() {
long long n;
cin >> n;
cout << xd(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 | #include <bits/stdc++.h>
int main() {
int ans = 1, n;
scanf("%d", &n);
for (int i = 1; i < n; i++) ans += 12 * i;
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 | 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 i, t = 1, ekle = 0, x;
cin >> x;
for (i = 1; i <= x; i++) {
t += ekle;
ekle += 12;
}
cout << t << 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;
const int mod = 1000000007;
const int maxn = 1000000 + 10;
int main() {
int n;
cin >> n;
long long int s = 1;
for (int i = 1; i < n; i++) s += i * 12;
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 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int a[18258];
a[0] = 1;
a[1] = 12;
a[2] = 24;
int i;
for (i = 3; i < 18257; i++) a[i] = a[i - 1] + 12;
while (cin >> n) {
long long sum = 0;
for (i = 0; i < n; i++) sum += a[i];
cout << sum << 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;
cin >> n;
cout << 1 + (n) * (n - 1) / 2 * 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 | import java.util.Scanner; public class Main{ public static void main(String...args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println(6*a*a - 6*a + 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 N;
cin >> N;
long long res = (6 * N) * (N - 1) + 1;
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>
using namespace std;
int main() {
int n;
cin >> n;
int i;
int s = 1;
for (i = 2; i <= n; i++) {
s += (i - 1) * 12;
}
cout << s << endl;
return 0;
}
| CPP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.