akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int x1 = sc.nextInt();
			int y1 = sc.nextInt();
			int x2 = sc.nextInt();
			int y2 = sc.nextInt();
			if(x1 == 0 && y1 == 0 && x2 == 0 && y2 == 0) break;
			double A[] = new double[] {x1,y1};
			double B[] = new double[] {x2,y2};
			
			int x3 = sc.nextInt();
			int y3 = sc.nextInt();
			int x4 = sc.nextInt();
			int y4 = sc.nextInt();
			
			double C[] = new double[] {x3,y3};
			double D[] = new double[] {x4,y4};
			
			int x5 = sc.nextInt();
			int y5 = sc.nextInt();
			int x6 = sc.nextInt();
			int y6 = sc.nextInt();
			
			double E[] = new double[] {x5,y5};
			double F[] = new double[] {x6,y6};
			
			double ABCD[] = new double[2];
			double ABEF[] = new double[2];
			double CDEF[] = new double[2];
			
			int r1 = cross(A,B,C,D,ABCD);
			int r2 = cross(A,B,E,F,ABEF);
			int r3 = cross(C,D,E,F,CDEF);
			
			boolean bad = false;
			if(r1 != 1 || r2 != 1 || r3 != 1) {
				bad = true;
			}
			double sum = -1;
			if(!bad) {
				sum = Math.abs(ABCD[1]*(ABEF[0] - CDEF[0]) + ABEF[1]*(CDEF[0] - ABCD[0]) + CDEF[1]*(ABCD[0] - ABEF[0]))/2.0;
				if(sum < 1.0e-9) {
					bad = true;
				}
			}
			if(!bad) {
				if(sum >= 1900000) {
					System.out.println("dai-kichi");
				}
				else if(sum >= 1000000) {
					System.out.println("chu-kichi");
				}
				else if(sum >= 100000) {
					System.out.println("kichi");
				}
				else {
					System.out.println("syo-kichi");
				}
			}
			else {
				System.out.println("kyo");
			}
			
		}
	}
	/*************************************/
	/* 2???????????????                       */
	/*      A + r(B - A) ??¨ C + s(D - C) */
	/*      P : ???????????§?¨?               */
	/*      return : =-1 : ???????????????    */
	/*               =0 : ????????????????????? */
	/*               =1 : ???????????????     */
	/*************************************/
	static int cross(double A[], double B[], double C[], double D[], double P[])
	{
		double r, s, AC[] = new double [2], BUNBO, EPS = 1.0e-8;
		int sw = -1;

		AC[0] = C[0] - A[0];
		AC[1] = C[1] - A[1];
		BUNBO = (B[0] - A[0]) * (D[1] - C[1]) - (B[1] - A[1]) * (D[0] - C[0]);
		if (Math.abs(BUNBO) > EPS) {
			r = ((D[1] - C[1]) * AC[0] - (D[0] - C[0]) * AC[1]) / BUNBO;
			s = ((B[1] - A[1]) * AC[0] - (B[0] - A[0]) * AC[1]) / BUNBO;
			if (r > -EPS && r < 1.0+EPS && s > -EPS && s < 1.0+EPS) {
				P[0] = A[0] + r * (B[0] - A[0]);
				P[1] = A[1] + r * (B[1] - A[1]);
				sw   = 1;
			}
			else
				sw = 0;
		}

		return sw;
	}
}

Measured memory_bytes: 20444
#include <cstdio>
#include <cmath>
#include <cfloat>
#include <algorithm>
using namespace std;

typedef pair<int,int> P;

int main() {
  int n, id, w, h, ans_id;
  double bmi, err, min_err;
  while (1) {
    scanf("%d", &n);
    if (!n) break;
    min_err = DBL_MAX;
    for (int i=0; i<n; i++) {
      scanf("%d %d %d", &id, &h, &w);
      bmi = (double)w * 10000. / (h * h);
      err = fabs(bmi - 22.);
      if (err < min_err) {
        min_err = err;
        ans_id = id;
      } else if (err == min_err && id < ans_id) {
        ans_id = id;
      }
    }
    printf("%d\n", ans_id);
  }
  return 0;
}

Measured memory_bytes: 1028
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		
		int[] dp = new int[100001];
		for(int i=1;i<=5;i++) {
			dp[i] = i;
		}
		for(int i=6;i<=8;i++) {
			dp[i] = i-5;
		}
		int sixPow = 6;
		int ninePow = 9;
		for(int i=9;i<=n;i++) {
			if(sixPow*6<=i) sixPow *= 6;
			if(ninePow*9<=i) ninePow *= 9;
			dp[i] = Math.min(dp[i-1]+1, Math.min(dp[i-sixPow]+1, dp[i-ninePow]+1));
		}
		
		System.out.println(dp[n]);
		in.close();
	}

}

Measured memory_bytes: 21972
from sys import stdin,stdout
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()
import math
from collections import Counter,defaultdict

d=defaultdict(int)
m=10**6+1
sieve=[-1]*m
n=IN()
a=sorted(LI())
for i in a:
    if d[i]==0:
        d[i]+=1
        for j in range(2*i,m,i):
            sieve[j]=1
    else:
        sieve[i]=1
ans=0
for i in a:
    if sieve[i]==-1:
        ans+=1
print(ans)

Measured memory_bytes: 45048
def plus(s):
    global c
    d = [0] * 7
    for i in range(7):
        if s in g[i]:
            for j in range(7):
                if g[i] & g[j] != set():
                    d[i] += c[j]
    c = d

n = int(input())
s = input()
g = [set(["J"]), set(["O"]), set(["I"]), set(["J", "O"]), set(["J", "I"]), set(["O", "I"]), set(["J", "O", "I"])]
c = [1, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
    plus(s[i])

print(sum(c) % 10007)


Measured memory_bytes: 5600
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <limits>
#include <map>
#define REP(i,n) for(long (i)=0;(i)<(n);(i)++)
#define REPI(i,a,b) for(long (i)=(a);(i)<(b);(i)++)
#define INF numeric_limits<double>::infinity()
constexpr long MOD = 1e9 + 7;
using namespace std;
using P = pair<long, long>;
using VI = vector<long>;

long gcd(long a, long b) {
    if (a % b == 0) return b;
    return gcd(b, a % b);
}

long lcm(long a, long b) {
    return a / gcd(a, b) * b;
}

int main() {
    int n;
    cin >> n;
    long ans = 1;
    REP(i,n) {
        long t;
        cin >> t;
        ans = lcm(ans, t);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
card = [list(map(int, input().split())) for _ in range(3)]
yes_no = [False]*9
N = int(input())
for i in range(N):
  b = int(input()) 
  for j in range(9):
    j_1 = j//3
    j_2 = j%3
    if b == card[j_1][j_2]:
      yes_no[j] = True

if yes_no[0] == yes_no[1] == yes_no[2] == True:
  print('Yes')
elif  yes_no[3] == yes_no[4] == yes_no[5] == True:
  print('Yes')
elif  yes_no[6] == yes_no[7] == yes_no[8] == True:
  print('Yes')
elif  yes_no[0] == yes_no[3] == yes_no[6] == True:
  print('Yes')
elif  yes_no[1] == yes_no[4] == yes_no[7] == True:
  print('Yes')
elif  yes_no[2] == yes_no[5] == yes_no[8] == True:
  print('Yes')
elif  yes_no[0] == yes_no[4] == yes_no[8] == True:
  print('Yes')
elif  yes_no[2] == yes_no[4] == yes_no[6] == True:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define FASTIO
using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void solve() {
    ll N;
    cin >> N;
    Vl A(N);
    ll s = 0;
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
        s ^= A[i];
    };
    for (ll i = 0; i < N; i++) {
        ll ans = s ^ A[i];
        cout << ans << " ";
    }
    cout << "\n";
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    ofstream ofs("./in_out/output.txt");
    cout.rdbuf(ofs.rdbuf());
#endif
    solve();
    cout << flush;
    return 0;
}

Measured memory_bytes: 4716
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>

using namespace std;
 
typedef long long i64;
typedef pair<i64, i64> P;

template<class T>
const T INF = numeric_limits<T>::max();
template<class T>
const T SINF = numeric_limits<T>::max() / 10;
static const i64 MOD = 1000000007;

//int dx[4] = {0,1,0,-1}, dy[4] = {-1,0,1,0};
//int dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
//int dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//int dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

struct edge {
  i64 from, to, cost;
  edge(i64 to, i64 cost) : from(-1), to(to), cost(cost) {}
  edge(i64 src, i64 to, i64 cost) : from(src), to(to), cost(cost) {}
};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//-----end of template-----//

i64 h[100], p[100];

i64 rec(i64 n, i64 x){
	if(x <= 0) return 0;
	if(x == h[n] || x == h[n] - 1) return p[n];
	if(x > h[n - 1] + 2) return p[n - 1] + 1 + rec(n - 1, x - h[n - 1] - 2);
	if(x == h[n - 1] + 2) return p[n - 1] + 1;
	if(x == h[n - 1] + 1) return p[n - 1];
	else return rec(n - 1, x - 1);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	i64 n, x;
	cin >> n >> x;
	h[0] = p[0] = 1;
	for(int i = 0; i < 50; ++i){
		h[i + 1] = 2 * h[i] + 3;
		p[i + 1] = 2 * p[i] + 1;
	}
	cout << rec(n, x) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <climits>
#include <cassert>
#include <algorithm>
#include <utility>

using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;
using VVI = vector<vector<long long int> >;


int main(void) {
    string s;
    cin >> s;
    string t = "YAKI";
    if (s.find(t) == 0) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3596
#include<stdio.h>

int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    int i,j;
    double x;
    i=a/b;
    j=a%b;
    x=1.0*a/b;
    printf("%d %d %.5lf\n",i,j,x);
    return 0;
}

Measured memory_bytes: 1816
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
using namespace std;

string s;
int n;
long dp[4][100010];
long mod = 1e9 + 7;

int main(){
  cin >> s;
  n = s.size();
  rep(i, 4)rep(j, n+2) dp[i][j] = 0;
  dp[0][0] = 1;
  rep(i, 4)rep(j, n+2){
    dp[i][j+1] = (dp[i][j+1] + dp[i][j]) % mod;
    if(j != 0){
      if(s[j-1]=='?') dp[i][j+1] = (dp[i][j+1] + dp[i][j] * 2) % mod;
      if((i==0 && (s[j-1]=='A' || s[j-1]=='?')) || (i==1 && (s[j-1]=='B' || s[j-1]=='?')) || (i==2 && (s[j-1]=='C' || s[j-1]=='?'))) dp[i+1][j+1] = (dp[i+1][j+1] + dp[i][j]) % mod;
    }
  }
  cout << dp[3][n+1] << endl;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
const ll mod = 1e9+7;
int a[maxn];

bool ok(int d, int n, int m){
    vector<int>temp;
    for(int i=0;i<n;i++){
        temp.push_back(a[i] % d);
    }
    sort(temp.begin(), temp.end());
    int head=0, tail=(int)temp.size()-1;
    while(!temp[head]) head++;
    int cnt = 0, rest = 0;
    while(head<=tail){
        if(rest <= 0){
            rest += temp[head];
            cnt += temp[head];
            head++;
        }
        else{
            rest -= (d-temp[tail]);
            cnt += (d-temp[tail]);
            tail--;
        }
    }
    if(cnt > 2*m) return false;
    if(rest != 0) return false;
    return true;
}

int main()
{
    int n, m;
    while(cin>>n>>m){
        int sum = 0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sum+=a[i];
        }
        vector<int>divis;
        for(int i=1;i*i<=sum;i++){
            if(sum%i==0) {
                divis.push_back(i);
                if(sum/i != i){
                    divis.push_back(sum / i);
                }
            }
        }
        sort(divis.begin(), divis.end());
        for(int i=(int)divis.size()-1;i>=0;i--){
//            cout<<"try   "<<divis[i]<<endl;
            if(ok(divis[i], n, m)) {
                cout<<divis[i]<<endl;
                break;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
N = int(input())


def judge_siri():
    L = []
    for i in range(N):
        S = input()
        if S in L:
            return "No"
        if len(L) != 0 and S[0] != L[-1][-1]:
             return "No"
        L.append(S)
    return "Yes"

print(judge_siri())

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

bool equal(vector<int>a, vector<int>b) {
	for (int i = 0; i < a.size(); i++)if (a[i] != b[i])return false;
	return true;
}

int main() {
	int i = 0, x, y;
	int n; cin >> n;
	vector<int>p(n), q(n), a(n);
	for (int i = 0; i < n; i++)cin >> p[i];
	for (int i = 0; i < n; i++)cin >> q[i];
	for (int i = 0; i < n; i++)a[i] = i + 1;
	do {
		if (equal(a, p))x = i;
		if (equal(a, q))y = i;
		i++;
	} while (next_permutation(a.begin(), a.end()));
	cout << abs(x - y) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

int main() {
  ll a, b, k;
  cin >> a >> b >> k;

  // ll ra = a - min(a, k);
  // ll rb = b - (k - min(a, k));

  ll x = min(a, k);
  a -= x;
  k -= x;
  b -= min(b, k);

  cout << a << " " << b << endl;
  return 0;
}


Measured memory_bytes: 256
/*
 * 2363.cc: Unequal Dice
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const double DELTA = 1e-7;

/* typedef */

/* global variables */

/* subroutines */

double calc_ev() {
  int n, m;
  cin >> n >> m;

  double esum = 0.0, rsum = 0.0;
  for (int i = 0; i < m; i++) {
    double v, r;
    cin >> v >> r;
    esum += v * r;
    rsum += r;
  }

  return esum / rsum;
}

/* main */

int main() {
  int t;
  cin >> t;

  double maxe = 0.0;

  for (int i = 0; i < t; i++) {
    double e = calc_ev();
    if (maxe < e) maxe = e;
  }

  double pe = calc_ev();

  bool ok = (maxe - pe > DELTA);
  cout << (ok ? "YES" : "NO") << endl;
  return 0;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
using namespace std;

typedef long long LL;

template<typename T>
void printmatrix(vector<vector<T> > ar){
    for (int i = 0; i < (int)ar.size(); i++) {
        for (int j = 0; j < (int)ar.size(); j++) {
            cout << ar[i][j];
        }
        cout << endl;
    }
}

template<typename T>
void printvector(vector<T> vec){
    for (int i = 0; i < (int)vec.size(); i++) {
        cout << vec[i] << endl;
    }
}

template<typename T>
void unique(vector<T>& vec){
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
}

template<typename T>
vector<T> cumsum(vector<T> vec){
    vector<T> newvec((T)vec.size());
    int tmp = 0;
    for (int i = 0; i < (int)vec.size(); i++) {
        tmp += vec[i];
        newvec[i] = tmp;
    }

    return newvec;
}


int main(int argc, char const* argv[])
{
    int x,a,b;
    cin >> x >> a >> b;
    if (abs(x-a) > abs(x-b)) {
        cout << "B" << endl;
    }else{
        cout << "A" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define res register int
#define ll long long
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define INF 1000000007
#define gc getchar()
#define MAXN 1000005
#define lc pos<<1
#define rc pos<<1|1
using namespace std;

inline int read()
{
    int ch=gc,f=0;
    int x=0;
    while(ch<'0'||ch>'9')
    {
        f|=ch=='-';
        ch=gc;
    }
    while(ch>='0'&&ch<='9')
    {
        x=x*10+ch-'0';
        ch=gc;
    }
    return f?-x:x;
}
int n,m;
int a[MAXN],f[MAXN];
inline bool check(int lim)
{
	for(int i=1;i<=2*n+1;i++)
	f[i]=a[i]<=lim;
	for(int i=0;i<n;i++)
	{
		if(f[n+1+i]==f[n+2+i])
		return f[n+1+i];
		if(f[n+1-i]==f[n-i])
		return f[n-i];
	}
	return f[1];
}
int main()
{
	n=read()-1;
	for(int i=1;i<=2*n+1;i++)
	a[i]=read();
	int l=1,r=2*n+1;
	while(l<r)
	{
		int mid=l+r>>1;
		if(check(mid))
		r=mid;
		else
		l=mid+1;
	}
	printf("%d\n",r);
	return 0;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
using namespace std;

int main(){
    string S,T;
    cin >>S>>T;
    
    for(int j=0;j<S.size();j++){
     string A=S;
    for(int i=0;i<S.size();i++){
    if(i==S.size()-1){
       S.at(0)=A.at(S.size()-1);
       break;
    }
     S.at(i+1)=A.at(i);
    }
    if(S==T){
        cout <<"Yes"<<endl;
        return 0;
    }
    }
    cout <<"No"<<endl;

}

Measured memory_bytes: 3640
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s;
    cin >> s;
    
    int ans=0;
    for(int i=0; i<s.length(); i++){
        if(s[i] != s[s.length()-1-i]){
            ans++;
        }
    }
    ans /= 2;

    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> d(N);
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
    int species = 0;
  sort(d.begin(), d.end());
  for (int i = 0; i < N - 1; i++){
    if (d[i] != d[i+1]) {
      species++;
    }
  }
  cout << species + 1 << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a.at(i);
	sort(a.begin(),a.end());
	int sum=0;
	rep(i,n-1) sum+=a.at(i);
	if(sum>a.at(n-1)) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")

#include <bits/stdc++.h>
using namespace std;
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define dec(i, n)  decID(i, 0, n)

// ---- ----

#define setmin(a, b) if(b < a) { a = b; }
#define setmax(a, b) if(b > a) { a = b; }

const int L = 1'000'000 / 2 + 1;

int A[L], B[L], aa, bb, mi, sum;
char s[1 << 21]; int c;
int main() {
	int size = fread_unlocked(s, 1, 1 << 21, stdin);
	while(s[c] != '\n') { c++; }
	while(++c < size) {
		if(s[c] == '\n') {
			int a = -mi, b = sum - mi;
			if(a <= b) { A[a] += sum; setmax(aa, a + 1); }
			else       { B[b] += sum; setmax(bb, b + 1); }
			mi = 0, sum = 0;
		} else {
			if(s[c] == '(') { sum++; }
			else            { sum--; setmin(mi, sum); }
		}
	}
	
	inc(i, aa) {
		setmin(mi, sum - i);
		sum += A[i];
	}
	dec(i, bb) {
		sum += B[i];
		setmin(mi, sum - i);
	}
	puts(mi == 0 && sum == 0 ? "Yes" : "No");
}


Measured memory_bytes: 5528
#include<bits/stdc++.h>
using namespace std;

string days[7] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};

int main () {
  string s;
  cin >> s;
  int t = 0;
  for (int i=0;i<7;++i)
    if (s == days[i]) t = i;
  for (int i=1;i<=7;++i)
    if (days[(t+i)%7] == "SUN") printf("%d\n",i);
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var A int64
	fmt.Scan(&A)
	//sc.Split(bufio.ScanWords)
	ret := A + A*A + A*A*A
	fmt.Print(ret)
}
func nextLine() string {
	sc.Scan()
	return sc.Text()
}
func nextInt() int64 {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return int64(i)
}
func MySort(a []int) {
	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })

}
func SortedBinaryAppend(sortedArr []int, targetValue int) []int {
	return []int{}
}
func SortedBinaryDelete(sortedArr []int, targetValue int) []int {
	return []int{}
}
func SortedBinarySearch(sortedArr []int, targetValue int) int {
	post := len(sortedArr) - 1
	pre := 0
	for {
		div := (post + pre) / 2
		tim := sortedArr[div]
		if tim == targetValue {
			return pre + div
		} else if tim > targetValue {
			post = tim
		} else {
			pre = tim
		}
		if pre == post {
			return -1
		}
	}
}
func Abs(i int) int {
	if i < 0 {
		return -1 * i
	}
	return i
}
func Min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func Max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {
	if (*dp)[[2]int{tate, yoko}] != 0 {
		return (*dp)[[2]int{tate, yoko}]
	}
	return yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)
}
func arrSum(arr []int) int {
	sum := 0
	for _, a := range arr {
		sum += a
	}
	return sum
}
func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}
func scanStrings(len int) (strings []string) {
	var str string
	for i := 0; i < len; i++ {
		fmt.Scanf("%s", &str)
		strings = append(strings, str)
	}
	return
}


Measured memory_bytes: 1772
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }



int main() {
  string s;
  cin >> s;

  int n = s.length();
  rep(i, n - 1) {
    if (s.substr(i, 2) == "AC") {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;


  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

//FILE *fi=freopen("1.txt","r",stdin);

int n,a[200001];
long long d1[200001],d2[200002],mi=1e18;

void nhap()
{
    scanf("%d",&n);
    for (int i=1;i<=n;++i)
    {
        scanf("%d",&a[i]);
    }
    for (int i=1;i<=n;++i)
        d1[i]=d1[i-1]+a[i];
    for (int i=n;i>0;--i)
        d2[i]=d2[i+1]+a[i];
}

void process()
{
    for (int i=1;i<n;++i)
    {
        mi=min(mi,abs(d1[i]-d2[i+1]));
    }
    cout<<mi;
}

int main()
{
    nhap();
    process();
    return 0;
}


Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int INF=1e9;
const ll LINF=1e18;

int main(){
    int n,a,b;
    cin>>n>>a>>b;
    ll h[n];
    for(int i=0;i<n;i++)cin>>h[i];
    ll ok=1e9,ng=0;
    while(abs(ok-ng)>1){
        ll mid=(ok+ng)/2;
        ll cnt=0;
        for(int i=0;i<n;i++){
            ll t=h[i]-mid*b;
            if(t>0)cnt+=(t+a-b-1)/(a-b);
        }
        if(cnt<=mid)ok=mid;
        else ng=mid;
    }
    cout<<ok<<endl;
}


Measured memory_bytes: 1024
def get_next_char(s):
    """
    >>> get_next_char("a")
    'b'
    >>> get_next_char("y")
    'z'
    """
    next_ord = ord(s)+1
    next_chr = chr(next_ord)
    return next_chr
    
def main():
    s = input().rstrip("\n")
    print( get_next_char(s))

if __name__ == '__main__':
    main()
if __name__ == '__jupyter__':
    import doctest
    print(doctest.testmod())
    

Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
class LCA{
	public:
	int N,root,max_log;
	vvi G,parent;
	vi depth;
	LCA(int size){
		N=size;
		G=vvi(size);
		max_log=20;
		depth=vi(size);
		parent=vvi(max_log,vi(size));
	}
	void add_edge(int a,int b){
		G[a].pb(b);
		G[b].pb(a);
	}
	void dfs(int v,int p,int d){
		parent[0][v]=p;
		depth[v]=d;
		rep(i,G[v].size())if(G[v][i]!=p)dfs(G[v][i],v,d+1);
	}
	void init(){
		root=0;
		dfs(root,-1,0);
		for(int k=0;k+1<max_log;k++){//doubling
			for(int v=0;v<N;v++){
				if(parent[k][v]<0)parent[k+1][v]=-1;
				else parent[k+1][v]=parent[k][parent[k][v]];
			}
		}
	}
	int lca(int u,int v){
		if(depth[u]>depth[v])swap(u,v);
		rep(k,max_log)if((depth[v]-depth[u])>>k&1)v=parent[k][v];
		if(u==v)return u;
		for(int k=max_log-1;k>=0;k--){
			if(parent[k][u]!=parent[k][v]){
				u=parent[k][u];
				v=parent[k][v];
			}
		}
		return parent[0][u];
	}
};
int main(){
	int n;
	cin>>n;
	LCA lca(n);
	rep(i,n){
	
		int k;
		cin>>k;
		rep(j,k){
			int a;
			cin>>a;
			lca.add_edge(i,a);
		}
	}
	lca.init();
	int q;
	cin>>q;
	while(q--){
		int a,b;
		cin>>a>>b;
		int k=lca.lca(a,b);
		cout<<k<<endl;
	}
}

Measured memory_bytes: 24484
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int N;
    cin >> N;

    vector<int> A(N);

    for(int i = 0; i < N; i++)
    {
        cin >> A.at(i);
    }

    
    bool judgeOdd = false;
    int count = 0;

    while(judgeOdd == false)
    {
        for(int i = 0; i < N; i++)
        {
            if(A.at(i) % 2 == 0)
            {
                A.at(i) /= 2;
            } 
            else
            {
                judgeOdd = true;
                break;
            }
            
        }
        if(judgeOdd == false)count++;
        
    }

    cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main () {
  int m1, d1;
  cin >> m1 >> d1;
  int m2, d2;
  cin >> m2 >> d2;
  if (m1 != m2) cout << 1 << endl;
  else cout << 0 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;

long long n,m,d[100005],nowwhere,imos[100005];
long long int ans=0;
int main(){
    cin>>n>>m;
    for(int i=1; i<n; i++) cin>>d[i];
    nowwhere=1;
    int a;
    for(int i=1; i<=m; i++){
        cin>>a;
        if(a>0){
            imos[nowwhere]++;
            nowwhere+=a;
            imos[nowwhere]--;
        }else{
            imos[nowwhere]--;
            nowwhere+=a;
            imos[nowwhere]++;
        }
    }
    for(int i=1; i<n; i++) {
        imos[i]+=imos[i-1];
    }
    for(int i=1; i<n; i++) ans+=imos[i]*d[i];

    cout<<ans%100000<<endl;
}

Measured memory_bytes: 4632
a,b,k = list(map(int,input().split(' ')))
"""takahashi has a
   aoki has b
   loop k

for _ in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    b -= 1
  elif a == 0 and b == 0:
    break
"""
if a <= k:
  k -= a
  a = 0
else:
  a -= k
  k = 0

#print('a,k',a,k)  

if b <= k:
  k -= b
  b = 0
else: 
  b -=k
  k = 0

#print('b,k',b,k)  
  
print(a,b)  

Measured memory_bytes: 38256
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using Pair = pair<int64_t, int64_t>;
constexpr int64_t kInf = INT64_MAX / 2L;

// std::cout << std::setprecision(20) << 1.1 << endl;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int64_t H, W;
  cin >> H >> W;
  vector<vector<int64_t>> distance(10, vector<int64_t>(10, kInf));
  for (int64_t r = 0; r < 10; ++r) {
    for (int64_t c = 0; c < 10; ++c) {
      cin >> distance[r][c];
    }
  }

  for (int64_t i = 0; i < 10; ++i) {
    distance[i][i] = 0;
  }
  for (int64_t k = 0; k < 10; ++k) {
    for (int64_t i = 0; i < 10; ++i) {
      for (int64_t j = 0; j < 10; ++j) {
        distance[i][j] = min(distance[i][j], distance[i][k] + distance[k][j]);
      }
    }
  }

  int64_t result = 0;
  for (int64_t r = 0; r < H; ++r) {
    for (int64_t c = 0; c < W; ++c) {
      int64_t a;
      cin >> a;
      if (a >= 0) {
        result += distance[a][1];
      }
    }
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 3620
n,m=map(int,input().split())
a=[0]*n
w=[0]*n
ac=0
wc=0
for _ in range(m):
    p,s=input().split()
    p=int(p)-1
    if a[p]==0:
        if s=='AC':
            a[p]=1
            ac+=1
            wc+=w[p]
        else:
            w[p]+=1
print(ac,wc)


Measured memory_bytes: 4596
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
const ll INF = 1e+9+7;
ll n,m,l;
string s,t;
ll d[200010],dp[550][550];

int main(){
  cin >> n;
  m = 0;
  l = 0;
  while(n > 0){
    if(n % 2)m++;
    n /= 2;
    l++;
  }
  //cout << m << " " << l << endl;
  print(max(m,l-1));
  return 0;
}


Measured memory_bytes: 3164
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Queue;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;



public class Main{
	
	static int posx;
	static int posy;
	static int type;
	static int diff;
	static int INF = Integer.MAX_VALUE;
	static int[][] d;
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 
	 long A=sc.nextLong();
	 long B=sc.nextLong();
	 long C=sc.nextLong();
	 long D=sc.nextLong();
	 
	 long numC=A/C;
	 if(A%C!=0) {
		 numC+=1;
	 }
	 long numC2=B/C;
	 
	 long numD1=A/D;
	 if(A%D!=0) {
		 numD1+=1;
	 }
	 long numD2=B/D;
	 
	
	 long numCD1=A/lcm(C,D);
	 if(A%(lcm(C,D))!=0) {
		 numCD1+=1;
	 }
	 long numCD2=B/lcm(C,D);
	 if(numCD2<numCD1) {
		 numCD2=numCD1-1;
	 }
	 
	 
	 
	 long result=(numC2-numC+1)+(numD2-numD1+1)-(numCD2-numCD1+1);
	 
	 //System.out.println(numC+" "+numC2+" "+numD1+" "+numD2+" "+numCD1+" "+numCD2);
	 System.out.println(B-A+1-result); 
	 
	
	 
	 
	 
 }
	


}

Measured memory_bytes: 25556
#include <bits/stdc++.h>
using namespace std;

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf=1e9;
const int64_t inf64=1e18;
const double eps=1e-9;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

//init:O(n).unite,find:(Ack^-1(n,n))
class union_find{
	private:
	vector<int> parent,rank,gs;
    int size;
	public:
    int count_group;
    union_find()=default;
    union_find(int n){ init(n); }

    void init(int n){
		size=n;
		count_group=n;
		parent.resize(size);
		rank.assign(size,0);
        gs.assign(size,1);
		for(int i=0; i<size; ++i) parent[i]=i;
	}

	int find(int x){
		if(parent[x]==x) return x;
		else return parent[x]=find(parent[x]);
	}

	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y) return;
		if(rank[x]<rank[y]){
			parent[x]=y;
            gs[y]+=gs[x];
		} else {
			parent[y]=x;
            gs[x]+=gs[y];
			if(rank[x]==rank[y]) ++rank[x];
		}
		--count_group;
	}

	bool is_same_group(int x,int y){
		return find(x)==find(y);
	}

    int group_size(int x){
        return gs[find(x)];
    };
};

void solve(){
    int w,h;
    cin >> w >> h;
    vector<tuple<int64_t,int,int>> vt;
    rep(i,0,w){
        int p;
        cin >> p;
        vt.push_back(make_tuple(p,i,i+1));
    }
    rep(i,0,h){
        int q;
        cin >> q;
        vt.push_back(make_tuple(q,i+w+1,i+w+2));
    }
    sort(vt.begin(),vt.end());
    union_find uf(w+h+2);
    int64_t ans=0,cnt1=0,cnt2=0;
    for(auto &edge:vt){
        int64_t cost=get<0>(edge);
        int a=get<1>(edge),b=get<2>(edge);
        if(uf.is_same_group(a,b)) continue;
        uf.unite(a,b);
        if(a<=w){
            ans+=cost*(h+1-cnt1);
            ++cnt2;
        }else{
            ans+=cost*(w+1-cnt2);
            ++cnt1;
        }
    }
    cout << ans << endl;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    solve();
    return 0;
}


Measured memory_bytes: 5868
#include<bits/stdc++.h>
using namespace std;

int main(){
    int N, Alice = 0, Bob = 0;
    cin >> N;
    vector<int> a(N);
    for(int i = 0; i < N; ++i) cin >> a[i];
    sort(a.begin(), a.end(), greater<int>());
    for(int i = 0; i < N; ++i){
        if(i % 2 == 0) Alice += a[i];
        else Bob += a[i];
    }
    cout << Alice - Bob << endl;
    return 0;
}

Measured memory_bytes: 3620
n,m = map(int, raw_input().split())
xls = map(int, raw_input().split())
yls = map(int, raw_input().split())
xsum = 0
for x in range(n):
    xsum += x * xls[x] - (n-x-1) * xls[x]
ysum = 0
for y in range(m):
    ysum += y * yls[y] - (m-y-1) * yls[y]
print (xsum * ysum) % (10**9 + 7)


Measured memory_bytes: 14496
#include <iostream>
#include <algorithm>
using namespace std;

int gcd(int a, int b){
	int r=a%b;
	while(r!=0){
		a=b;
		b=r;
		r=a%b;
	}
	return b;
}

int main(){
	int a,b;
	while(cin>>a>>b){
		cout << gcd(a,b) << " " << a/gcd(a,b)*b << endl;
	}
	return 0;
}

Measured memory_bytes: 2960
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)

int main()
{
  ll n, m, p, cv=0, pv=0;
  string s;
  cin >> n >> m;
  vecll cor(n, 0);
  vecll pen(n, 0);
  forll(i, 0, m){
	cin >> p >> s;
	if (s == "AC")
	  cor[p-1] += 1;
	else if (cor[p-1] == 0)
	  pen[p-1] += 1;
  }
  forll(i, 0, n){
	if(cor[i] > 0){
	  cv++;
	  pv += pen[i];
	}
  }
  cout << cv << " " << pv << endl;
}


Measured memory_bytes: 1792
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


N, Q = map(int, input().split())
 
class Node():
    def __init__(self):
        self.connected = []
        self.count = 0
 
 
 
def add_count(v, p):
    for c in G[v].connected:
        if c == p:
            continue
        G[c].count += G[v].count
        add_count(c, v)
 

G = [Node() for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    G[a-1].connected.append(b-1)
    G[b-1].connected.append(a-1)

for _ in range(Q):
    p, x = map(int, input().split())
    G[p-1].count += x

add_count(0, -1)

counts = [node.count for node in G]
print(*counts)



Measured memory_bytes: 264112
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl "\n"
#define all(v) v.begin(),v.end()
#define mp make_pair
#define mm(a) memset(a,0,sizeof(a))
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define repn(i,a,b) for(ll i = a; i >= b; i--)
#define pb push_back
#define ff first
#define ss second
#define fto(k,m) for(auto k:m)
#define in_edges(m) repp(i, 1, m){ ll a, b; cin >> a >> b; adj[a].pb(b), adj[b].pb(a);}
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define MOD 1000000007
#define sz(a) ll((a).size())
#define pii 3.1415926535897
#define quick ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main()
{
	quick
	// Bahut gussa aya mujhe YE QUESTION BANAKE @!@
	ll t;t=1;
    // cin >> t;
	while(t--)
	{
		ll n; cin >>n;
		vector<ll> v(n+1,0);
		rep(i,1,n+1)
		{
			for( ll j =0;j<=n;j+=i)v[j]++;
		}
		ll sum = 0;
		rep(i,1,n+1)sum+=i*(ll)v[i];
		cout << sum <<endl;
	}
}


Measured memory_bytes: 81344
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define All(V) v.begin(), v.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9+7, INF = 1e9;

int main() 
{
  int a[3];
  rep(i, 3) cin >> a[i];
  sort(a, a+3);
  cout << a[0]+a[1] << endl;
  system("pause");
}

Measured memory_bytes: 504
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    string str;
  map<string,int> mp;
  mp["SUN"]=7;
  mp["MON"]=6;
  mp["TUE"]=5;
  mp["WED"]=4;
  mp["THU"]=3;
  mp["FRI"]=2;
  mp["SAT"]=1;
  cin>>str;
  cout<<mp[str]<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223372036854775807
#define INF 2147483647
#define MOD 1000000007
using namespace std;


int main(int argc, char* argv[])
{
    long a,b,c;
    scanf("%ld%ld%ld", &a, &b, &c);

    if(a-b==b-c) {
        printf("YES\n");
    }
    else {
        printf("NO\n");
    }

    return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <map>
using namespace std;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> a(n + 1);
    rep(i, n) cin >> a[i + 1];

    for (int i = 0; i < k; i++)
    {
        vector<int> imos(n + 2, 0);
        int n_cnt = 0;
        for (int j = 1; j <= n; j++)
        {
            int left = max(0, j - a[j]);
            int right = min(n, j + a[j]) + 1;
            ++imos[left];
            --imos[right];
        }
        int cnt = imos[0];
        for (int i = 1; i <= n; i++)
        {
            cnt += imos[i];
            a[i] = cnt;
            if (a[i] == n)
            {
                ++n_cnt;
            }
            if (n_cnt == n)
            {
                print(a);
                return 0;
            }
        }
    }
    print(a);
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 1; i < v.size(); i++)
    {
        if (i - 1)
            cout << " ";
        cout << v[i];
    }
    cout << endl;
}


Measured memory_bytes: 4844
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
//*/


using namespace std;
static const int _ = []() {
	ios::sync_with_stdio(false);
	cin.sync_with_stdio(false);
	cout.sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	return 0;
}();
#define ll long long
#define ull unsigned long long
#define rep(i,a) for(ll i=0;i<(a);i++)
#define rng(i,a,b) for(ll i=(a);i<=(b);i++)
#define rev(i,a) for(ll i=(a)-1;i>=0;i--)
#define S size()
#define all(a) (a).begin(),(a).end()
#define any(i,a) for(auto& i:a)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define X first
#define Y second
#define V vector
#define VL V<ll>
#define VVL V<VL>
#define VS V<string>
template<class T> inline vector<T> rv(ll n) { vector<T> v(n); rep(i, n) cin >> v[i]; return v; }
template<class T> inline void pv(const vector<T>& v) { rep(i, v.size()) cout << v[i] << " "; cout << endl; }
template<class T> inline void amax(T& a, const T& b) { if (a < b) a = b; }
template<class T> inline void amin(T& a, const T& b) { if (a > b) a = b; }
const ll MOD = 1e9 + 7;
const ll MOD1 = 998244353;
struct custom_hash {
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}
	size_t operator()(uint64_t x) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(x + FIXED_RANDOM);
	}
};



int main() {
	ll n; cin >> n;
	unordered_map<ll, ll, custom_hash> s;
	s[n] = 1;
	for (int i=2;;i++) {
		if (n % 2) {
			n = 3 * n + 1;
		}
		else {
			n /= 2;
		}
		if (s.count(n)) {
			return cout << i << endl, 0;
		}
		s[n] = i;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

#define FOR(x, a, b) for (int x = a; x <= b; ++x)
#define FOD(x, a, b) for (int x = a; x >= b; --x)
#define REP(x, a, b) for (int x = a; x < b; ++x)
#define DEBUG(X) { cout << #X << " = " << X << endl; }
#define PR(A, n) { cout << #A << " = "; FOR(_, 1, n) cout << A[_] << " "; cout << endl; }
#define PR0(A, n)  { cout << #A << " = "; REP(_, 0, n) cout << A[_] << " "; cout << endl; }

using namespace std;

typedef long long LL;
typedef pair <int, int> II;

const int N = 1e3 + 10;
const int INF = 0x3f3f3f3f;

int n, m;
int dp[N][N], a[N][N], s[N][N];

bool Inside(int x, int y) {
    return 1 <= x && x <= n + 1 && 0 <= y && y <= m;
}

int DP(int i, int j) {
    if (i == n + 1 && j == m) return 0;
    int &ans = dp[i][j];
    if (ans != -1) return ans;
    ans = -INF;
    // R
    if (Inside(i, j + 1)) ans = max(ans, -DP(i, j + 1));
    // D
    bool first = ((i + j) % 2 == 1);
    int sum = (s[i][m] - s[i][j]) - s[i][j];
    if (Inside(i + 1, j)) ans = max(ans, -DP(i + 1, j) + (first ? sum : -sum));
    return ans;
}

int main() {
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // LOCAL
    scanf("%d%d", &m, &n);
    FOR(i, 1, n)
        FOR(j, 1, m) scanf("%d", &a[i][j]);
    FOR(i, 1, n)
        FOR(j, 1, m) s[i][j] = s[i][j - 1] + a[i][j];
    memset(dp, -1, sizeof dp);
    cout << abs(DP(1, 0)) << endl;
    return 0;
}



Measured memory_bytes: 15192
#include <bits/stdc++.h>

constexpr long long mod = 998244353;

template<typename T>
constexpr T modpow(T a,int n){//(a^n)%MOD
    T ret=1;
    while(n>0){
        if((n&1)!=0){//n%2==1
            ret=ret*a%mod;
        }
        a=a*a%mod;
        n=n/2;
    }
    return ret;
}

std::vector<long long> fac;
std::vector<long long> ifac;

//long long mod=1000000007LL;

template <typename T>
T modcomb(T a, T b){
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    long long tmp = ifac[a-b]* ifac[b] % mod;
    return tmp * fac[a] % mod;
}

void combinit(int maxn){
    fac.resize(maxn+1);
    ifac.resize(maxn+1);
    fac[0] = 1;
    ifac[0] = 1;
    for(long long i = 0; i<maxn; i++){
        fac[i+1] = fac[i]*(i+1) % mod;
        ifac[i+1] = ifac[i]*modpow(i+1, mod-2) % mod;
    }
}

using namespace std;
using ll = long long;

int main() {
    combinit(200000);
    ll n,m,k;
    cin>>n>>m>>k;
    if(k==0) {
        ll ans=m;
        ans*=modpow(m-1,n-1);
        cout<<ans%mod<<endl;
        //cerr<<"hoge\n";
        return 0;
    }


    ll ans=0;
    for(ll i = 0;i <= k;++i) {
        ll tans=modcomb(n-1,i);
        tans*=modpow(m-1,n-i-1);
        //cerr<<tans<<endl;
        ans+=tans%mod;
        ans%=mod;
    }
    ans*=m;
    ans%=mod;
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 6280
#include <bits/stdc++.h>
#include <string>
using namespace std;

int main()
{
  int n, a;
  stack<int> q;
  cin >> n;
  for (int i = 0; i < n; i++)
  {
    cin >> a;
    q.push(a);
  }

  while (!q.empty())
  {
    if (q.size() == 1)
    {
      cout << q.top();
    }
    else
    {
      cout << q.top() << " "; // 先頭の値を出力
    }
    q.pop(); // 先頭の値を削除
  }
  cout << endl;
}


Measured memory_bytes: 3100
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    static int[] w = new int[100010];
    static int[] v = new int[100010];
    static int[][] dp = new int[110][100010];
    static int k;

    static int chmin(int a, int b) {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    }

    static int chmax(int a, int b) {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int count = 0;

        for (int i = 0; i < n; i++) {
            if (sc.nextInt() >= k)
                count++;
        }

        System.out.println(count);
    }
}


Measured memory_bytes: 113028