akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(ll i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
struct pair_hash {inline std::size_t operator()(const std::pair<ll, ll> & v) const {return v.first*31+v.second;}};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define fr first
#define sc second
#define prnt(m) for(auto it = m.begin() ; it != m.end() ; ++it){cout<<*it<<endl;}
#define tra(it,m) for(auto it=m.begin();it!=m.end();++it)
#define DBG(x) cout<<"# # #     "<<x<<'\n';
#define fri(i,s,n) for(int i=s;i<n;i++)
#define mod 1000000007LL
#define mod2 998244353
#define vct2 vector<vector<ll>>
#define vct vector<ll>
#define pll pair<ll,ll>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define arrin(a,n) for(ll i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(ll i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl,exit(0);
#define inf 1e18
#define five 100005;
#define six 1000005;
#define prllclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//___________________________________________________________________________________________________________________________________________________________
const int N = five;
ll dp[2][N];
pll val[N];
ll pre[N];
int main()
{
       int n,l;
       cin>>n>>l;
       int a[n];
       int sum = 0;
       fri(i,0,n){
              a[i] = l+i;
              sum += a[i];
       }

       sort(a,a+n);
       int ans = mod;
       ll xx;
       fri(i,0,n){
              if(abs(sum-(sum-a[i]))<ans){
                     ans = abs(sum-(sum-a[i]));
                     xx = sum - a[i];
              }
       }
       cout<<xx<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=505;
int a[N][N];
void dfs(int l,int r,int k)
{
    if(l==r) return;
    int m=l+r>>1;
    for(int i=l;i<=m;i++)
        for(int j=m+1;j<=r;j++)
            a[i][j]=k;
    dfs(l,m,k+1);dfs(m+1,r,k+1);
}
int main()
{
    int n;scanf("%d",&n);
    if(n==2){printf("1\n");return 0;}
    dfs(1,n,1);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
        printf(j==n?"%d\n":"%d ",a[i][j]);
}


Measured memory_bytes: 1408
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	string s;
	cin >> s;
	cout << (s == "ABC" ? "ARC" : "ABC");
}

Measured memory_bytes: 3628
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long



using namespace std;

void file(){
	#ifndef ONLINE_JUDGE
    	freopen("in.txt", "r", stdin);
	#endif
}
int tc;
const int N=5e5+5,M=2e6+5,MOD=1e9+7,OO=1e9;

const int MSQ = sqrt(N) + 5;


int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//file();

	ll a,b,c,d;

	scanf("%lld %lld %lld %lld",&a,&b,&c,&d);

	ll all = b-a+1;
	printf("%lld\n",all-(b/d -(a-1)/d)-(b/c-(a-1)/c)+((b)/((c*d)/__gcd(c,d))-((a-1))/((c*d)/__gcd(c,d)) ));
}		



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,m,a1,b1,ans;
vector<int>v[100100];
priority_queue<int>q;
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a1,&b1);
		if(a1>m) continue;
		v[m-a1+1].push_back(b1);
	}
	for(int i=1;i<=m;i++){
		for(int j=0;j<v[i].size();j++) ans+=v[i][j],q.push(-v[i][j]);
		while(q.size()>i) ans+=q.top(),q.pop();
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 6268
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()


int main(){
  int N,A,B;
  cin >> N >> A >> B;
  string s;
  cin >> s;
  int bc = 0;
  int all = 0;
  for(int i = 1;i <= N;i++){
    if((s[i - 1] == 'a' && all < A + B) || (s[i - 1] == 'b' && all < A + B && bc < B)){
      cout << "Yes" << endl;
      all++;
      bc += s[i - 1] == 'b';
    }
    else{
      cout << "No" << endl;
    }
  }
  return 0;
}


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

int main(){
  int N;
  cin >> N;
  pair<int, int> X[N];
  for(int i=0; i<N; i++){
    cin >> X[i].first;
    X[i].second = i;
  }
  //ここまで入力

  //Xの値を入れてソートしたものを入れておく
  int Y[N];
  for(int i=0; i<N; i++)
    Y[i] = X[i].first;
   
  sort(Y, Y+N);
  
  for(int i=0; i<N; i++){
    //Xのコピーをソート済みの配列において，
    //X[i]の値が最初に見つかる場所を入れておく
    int tmp = lower_bound(Y, Y+N, X[i].first) - Y;
    //半分未満かどうかでメジアンの場所が一つずれる
    if(tmp < N/2)
      cout << Y[N/2] << endl;
    else if(N/2 <= tmp)
      cout << Y[N/2-1] << endl;
  }
  
  return 0;
}


Measured memory_bytes: 4480
#include<stdio.h>
int main()
{
    int a, b, c, d;
    scanf("%d %d %d %d", &a, &b, &c, &d);
    if(a+b==c+d) printf("Balanced\n");
    else if(a+b>c+d) printf("Left\n");
    else printf("Right\n");
return 0;
}


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

using ll = long long;

#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define len(x) int((x).size())

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define randint(n) uniform_int_distribution<int>(1, (n))(rng)

int P[5001];
ll C[5001];

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

	#ifdef ARTHUR_LOCAL
		ifstream cin("input.txt");
	#endif

	int n;
	cin>>n;

	int k;
	cin>>k;

	for(int i=1; i<=n; i++) cin>>P[i];
	for(int i=1; i<=n; i++) cin>>C[i];

	ll ans = - ll(1e18);

	vector<bool> cov(n+1);

	for(int i=1; i<=n; i++)
	{
		if(cov[i]) continue;

		vector<int> curi;
		vector<ll> curc;

		int j=i;

		while(1)
		{
			curi.push_back(j);
			curc.push_back(C[j]);
			//cout << C[j] << " ";
			j=P[j];
			if(j==i) break;
		}
		//cout << endl;

		ll cursum=0LL;
		for(auto c:curc) cursum+=c;
		
		for(int j=0; j<len(curi); j++)
		{
			cov[curi[j]]=1;

			// get rid of some k
			//int extra = k - len(curi)*int((k-1)/len(curi));
			//ll cur = max(0LL,ll(int((k-1)/len(curi)))*cursum);

			int manual = min(k%len(curi) + len(curi),k);

			ll cur = max(0LL,cursum * ll(int((k-manual)/len(curi))));
			// if(k!=manual) 

			for(int bump=0; bump<manual; bump++)
			{
				cur += curc[(j+bump)%len(curc)];
				ans=max(ans,cur);
			}
		
			// cout << j << " " << cur << endl;

			ans=max(ans,cur);
		}
		// cout<<"\n";
	}
	cout << ans << endl;
}

Measured memory_bytes: 3720
#include<iostream>
using namespace std;
int main()
{
	int n, k;
	int i, j;

	cin >> n >> k;
	long *a = new long[n];

	for (i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (i = 0; i + k < n; i++) {
		if (a[i] < a[i + k]) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}


Measured memory_bytes: 5200
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

bool solve(){
	int n,m;
	cin >> n >> m;
	if(n == 0 && m == 0)return false;
	vector<int> h(n+1),w(m+1);
	for(int i=1;i<=n;i++){
		cin >> h[i];
		h[i] += h[i-1];
	}
	for(int i=1;i<=m;i++){
		cin >> w[i];
		w[i] += w[i-1];
	}

	vector<int> hei(1500001);
	for(int i=0;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			hei[h[j]-h[i]]++;
		}
	}

	int cnt = 0;
	for(int i=0;i<=m;i++){
		for(int j=i+1;j<=m;j++){
			cnt += hei[w[j]-w[i]];
		}
	}
	cout << cnt << endl;
	return true;
}

int main(void){
	while(solve()){}
	return 0;
}

//????????????

Measured memory_bytes: 7064
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define PB push_back
#define SP << " " <<

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;

__attribute__((constructor))
void initial(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed <<setprecision(15);
}


int main(void){
	int N,R;
    cin >> N >> R;
    int ans = R;
    if(N < 10){
        ans = R+100*(10-N);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
// 標準入力からデータを読み込む準備
        Scanner sc = new Scanner(System.in);
// 2つの文字の固まりを整数値と想定して読み込む
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (a < b) {
            System.out.println("a < b");
        } else if (a == b) {
            System.out.println("a == b");
        } else {
            System.out.println("a > b");
        }
    }
}


Measured memory_bytes: 26144
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();

        List<Integer> group01 = new ArrayList<>();
        List<Integer> group02 = new ArrayList<>();
        List<Integer> group03 = new ArrayList<>();

        group01.add(1);
        group01.add(3);
        group01.add(5);
        group01.add(7);
        group01.add(8);
        group01.add(10);
        group01.add(12);

        group02.add(4);
        group02.add(6);
        group02.add(9);
        group02.add(11);

        group03.add(2);


        if ((group01.contains(x) && group01.contains(y))
        || (group02.contains(x) && group02.contains(y))
        || (group03.contains(x) && group03.contains(y))) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 21972
#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <string>
#include <string.h>
#include <stack>
#include <queue>
#include <set>
using namespace std;

const int MAX_N=10000;
int list[100001]={};
int n,a,b;

int main(){
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a >> b;
		for(int j=a;j<=b;j++){
			list[j]++;
		}
	}
	
	int c=0;
	for(int i=0;i<100001;i++) if(list[i]) c++;
	
	cout << c << endl;
	return 0;
}


Measured memory_bytes: 640
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val a = sc.nextLong()
    val b = sc.nextLong()
    val c = sc.nextLong()
    val d = sc.nextLong()
    val arr = arrayOf(a * c, a * d, b * c, b * d)
    println(arr.max())
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


Measured memory_bytes: 38336
#include <bits/stdc++.h>
using namespace std;
const int MAXN=6010;
int n,p,ans,dp[MAXN][MAXN*2];
int main () {
	scanf("%d%d",&n,&p);
	int delta=n*3;
	dp[0][delta]=1;
	for (int i=0;i<n*3;i++) {
		for (int j=delta-i;j<=delta+i;j++) {
			dp[i+1][j+1]=(dp[i+1][j+1]+dp[i][j])%p;
			dp[i+2][j-1]=(dp[i+2][j-1]+(1ll*dp[i][j]*(i+1))%p)%p;
			dp[i+3][j]=(dp[i+3][j]+(1ll*((1ll*(i+1)*(i+2))%p)*dp[i][j])%p)%p;
		}
	}
	for (int i=delta;i<=delta+n*3;i++) {ans=(ans+dp[n*3][i])%p;}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 280192
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;

int main(){
    double x[1050], y[1050];
    x[1] = 1, y[1] = 0;
    for(int i = 2;i < 1050;i++){
	double s = hypot(x[i - 1], y[i - 1]);
	x[i] = x[i - 1] - 1/s * y[i - 1];
	y[i] = y[i - 1] + 1/s * x[i - 1];
    }
    int n;
    while(cin >> n, n != -1){
	printf("%.9lf\n", x[n]);
	printf("%.9lf\n", y[n]);
    }
    return 0;
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#define op_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define fo(i,a,b) for(int i=a; i <b; i++)
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef map<int,int> mpii;
typedef map<ll,ll> mpll;
typedef map<int,ll> mpil;
typedef map<ll,int> mpli;

int solve(int n, int m, int x, vi &c, vvi &A){
  int ans = INT_MAX;
  for(int i = 1; i < (1<<n); i++){
    int curr = 0;
    vi curr_k(m,0);
    for(int j =0 ; j < n; j++){
      if(i&(1<<j)){
	curr += c[j];
	fo(l, 0, m){
	  curr_k[l] += A[j][l];
	}
      }
    }
    bool found = false;
    fo(l, 0, m){
      if(curr_k[l] < x){
	found = true;
	break;
      }
    }
    if(!found){
      ans = min(ans, curr);
    }
  }
    
  
  return ans;
}

int main(){
  op_io;
  int n,m,x;
  cin>>n>>m>>x;
  vi c(n);
  vvi A(n, vi(m,0));
  fo(i, 0, n){
    cin>>c[i];
    fo(j,0,m){
      cin>>A[i][j];
    }
  }
  bool found = true;
  fo(i, 0, m){
    int s = 0;
    fo(j, 0, n){
      s += A[j][i];
    }
    if(s < x){
      found = false;
      break;
    }
  }
  if(!found){
    cout<<-1<<endl;
  }else{
    cout<<solve(n,m,x,c,A)<<endl;
  }
  return 0;
}


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

int main()
{
    int H, W, A, B;
    cin>>H>>W>>A>>B;
    for (int y=0; y<H; y++)
    {
        for (int x=0; x<W; x++)
            cout<<char('0'+(x<A^y<B));
        cout<<endl;
    }
}


Measured memory_bytes: 1280
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <string>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <set>
#include <climits>
#include <sstream>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;
const dd PI = 3.1415926535;

class UnionFind {
	std::vector<int> p;

public:
	UnionFind(int n) : p(n, -1) {}

	int root(int x) { return p[x] < 0 ? x : p[x] = root(p[x]); }

	bool same(int x, int y) { return root(x) == root(y); }

	bool unite(int x, int y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;
		if (p[y] < p[x]) std::swap(x, y);
		if (p[x] == p[y]) --p[x];
		p[y] = x;
		return true;
	}
};

ll fast(ll n, ll k) {
	if (k == 0) {
		return 1;
	}
	if (k == 1) {
		return n;
	}
	if (k % 2 == 0) {
		ll tmp = fast(n, k / 2);
		return tmp * tmp % MOD;
	}
	else {
		ll tmp = fast(n, k / 2);
		tmp = tmp * tmp % MOD;
		return n * tmp % MOD;
	}
}

ll count(ll n, ll k) {
	ll cnt = 0;
	while (true)
	{
		if (n >= k) {
			break;
		}
		cnt++;
		n *= 2;
	}
	return cnt;
}

int main() {
	ll N, X;
	cin >> N >> X;

	vector<ll> candy(N);
	for (ll i = 0; i < N; i++)
	{
		cin >> candy[i];
	}

	ll ans = 0;
	for (ll i = 0; i < N - 1; i++)
	{
		ll diff = max(candy[i] + candy[i + 1] - X, 0LL);
		ans += diff;

		if (candy[i +1] >= diff) {
			candy[i + 1] -= diff;
		}
		else {
			candy[i + 1] = 0;
		}
	}
	cout << ans << endl;
}

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

typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define MOD 1000000007
const double PI=3.14159265358979323846;
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 (b<a) { a=b; return 1; } return 0; }
template<typename T> T Ceil(T a, T b){return (a+b-1)/b;}

int dy[]={0, 0, 1, -1, 1, -1, -1, 1};
int dx[]={1, -1, 0, 0, 1, 1, -1, -1};

void printv(vint &v){
    for(auto e:v) cout<<e<<" ";
        cout<<endl;
    }

int main() {
    cout<<fixed<<setprecision(10);

    vint a(7); rep(i,7) cin>>a[i];

    ll ans = a[1];
    set<ll> s;
    vint b;
    for(auto i:{0,3,4}) b.push_back(a[i]);

    // printv(b);
    sort(ALL(b));
    ll cnt = 0;
    for(auto e:b) cnt += (ll)(e%2==1);

    for(auto e:b) ans += e;
    if(cnt == 0 || cnt == 3){

    }else if(cnt == 1){
        ans--;
    }else{
        if(b.front() == 0){
            ans-=2;
        }else{
            ans--;
        }
    }
    cout<<ans<<endl;



    return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <vector>

#define FOR(i, a, b) for (int i = a; i < b; i++)
#define FORN(i, a, b) for (int i = a; i <= b; i++)
#define P(s) cout << s << endl
#define PC(condition, _true, _false) if (condition) _true; else _false;
#define toInt(_char) _char - '0'

using namespace std;
//
// Created by karayuu on 2018-12-18.
//

int main() {
    int m = 0;
    int f = 0;
    int r = 0;
    char point[50] = {'Z'};
    int count = 0;
    
    while (!(m == -1 && f == -1 && r == -1)) {
        cin >> m >> f >> r;
        //中間期末の合計点
        int sum = m + f;

        if (m == -1 || f == -1) {
            point[count] = 'F' ;
        } else if (sum >= 80) {
            point[count] = 'A';
        } else if (sum >= 65 && sum < 80) {
            point[count] = 'B';
        } else if (sum >= 50 && sum < 65) {
            point[count] = 'C';
        } else if (sum >= 30 && sum < 50) {
            if (r >= 50) {
                point[count] = 'C';
            } else {
                point[count] = 'D';
            }
        } else if (sum < 30) {
            point[count] = 'F';
        }
        count++;
    }

    //この設計だと-1 -1 -1のケースも判断対象になり
    //point[count]にFが入ってしまうため、最後をのぞいている
    FOR(i, 0, count - 1) {
        P(point[i]);
    }
}


Measured memory_bytes: 3080
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        if (N == 1) {
            System.out.println("Hello World");
        } else {
            int A = sc.nextInt();
            int B = sc.nextInt();
            System.out.println(A + B);
        }
    }
}


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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) begin(r),end(r)
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const ll mod = 1e9+7;
constexpr ll inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m,u;
  cin >> n;
  map<ll,ll> d,t;
  rep(i,n){
    cin >> u;
    d[u]++;
  }
  cin >> m;
  bool f = true;
  rep(i,m){
    cin >> u;
    if(d.count(u) && d[u] > 0){
      d[u] --;
    }
    else{
      f = false;
    }
  }
  if(f)
    std::cout << "YES" << std::endl;
  else {
    std::cout << "NO" << std::endl;
  }
  return 0;
}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
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 (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
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);
}
int main()
{
    int N;
    cin>>N;
    vll A(N);
    bool zero = false;
    ll ans=1;
    for (size_t i = 0; i < N; i++)
    {
        cin>>A[i];
        if(A[i]==0)
        {
            cout<<0;
            return 0;
        }
    }
    
    long double keta=0;
    for (size_t i = 0; i < N; i++)
    {
        keta += log10(A[i]);
        if(keta > 18)
        {
            cout<<-1;
            return 0;
        }
    }
    for (size_t i = 0; i < N; i++)
    {
        ans *= A[i];
        if(ans > 1000000000000000000)
        {
            cout<<-1;
            return 0;
        }
    }
    cout<<ans;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  rep(i, N) cin >> a[i];
  int ans = 0;
  rep(i, N) if ((i + 1) % 2 == 1 && a[i] % 2 == 1) ans++;
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3552
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.exe
    
int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    
  string s;
  cin >> s;
  if (s[0]==s[2])
  {
      cout << "Yes" << endl;
  }else
  {
      cout << "No" << endl;
  }
  
  
  
  
    
  
  
    


//////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;


int solve(int n, int keta, std::vector<int>& D){
  if(keta == 0) return n;
  int head = pow(10, keta - 1);
  int v = (n/head)%10;
  int next_n = n;
  int next_keta = keta;
  if(find(D.begin(), D.end(), v) != D.end()){
    next_n = (n/head)*head + head;
    if(v == 9){
      next_keta = keta + 1;
    }
  }else{
    next_keta = keta - 1;
  }
  // std::cout << n << " " << keta << " " << head << " " << v << " " << next_n << " " << next_keta << " n_keta_head_v_nextn_nextketa" << std::endl;

  return solve(next_n, next_keta, D);
}

int main(){
  int N,K;
  std::vector<int> D;

  cin >> N;
  cin >> K;
  for(int i = 0;i < K;i++){
    int a;
    cin >> a;
    D.push_back(a);
  }

  // std::sort(D.begin(), D.end());
  
  int keta = (int)log10(N) + 1;

  int res = solve(N, keta, D);
  
  std::cout << res << std::endl;
}




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

const int N = 1e6 + 5;

#define st first
#define nd second
#define make(a,b) make_pair(a,b)

typedef long long ll;

long long coins[N][3];
int pos[N];
set<pair<long long,int> > moves[3][3];

long long res = 0;
	
int wykonaj(int x, int y, vector<int>& v) {
	for (int i = 0; i < 3; i ++) {
		for (int j = 0; j < 3; j ++) {
			assert(moves[i][j].size() == v[i]);
		}
	}
	v[x] --;
	v[y] ++;
	assert(not moves[x][y].empty());
	int where = moves[x][y].begin() -> second;
	assert(pos[where] == x);
	res -= moves[x][y].begin() -> first;
	assert(moves[x][y].begin() -> first >= 0);
	for (int i = 0; i < 3; i ++) {
		moves[x][i].erase(make_pair(coins[where][x] - coins[where][i], where));
	}
	pos[where] = y;
	for (int i = 0; i < 3; i ++) {
		moves[y][i].insert(make_pair(coins[where][y] - coins[where][i], where));
	}
	return where;
}

int main()
{
	int x, y, z;
	scanf("%d%d%d", &x, &y, &z);
	vector<int> v(3);
	vector<int> goal(3);
	goal[0] = x;
	goal[1] = y;
	goal[2] = z;
	
	for (int i = 0; i < x + y + z; i ++) {
		scanf("%lld%lld%lld", coins[i] + 0, coins[i] + 1, coins[i] + 2);
		long long MAX = max({coins[i][0], coins[i][1], coins[i][2]});
		int added = -1;
		for (int j = 0; j < 3; j ++) {
			if (added == -1 && MAX == coins[i][j]) {
				v[j] ++;
				added = j;
			}
		}
		res += MAX;
		pos[i] = added;
		for (int j = 0; j < 3; j ++) {
			moves[added][j].insert(make_pair(coins[i][added] - coins[i][j], i));
		}
	}
	while(true) {
		bool ok = true;
		for (int i = 0; i < 3; i ++) {
			if (goal[i] != v[i]) {
				ok = false;
			}
		}
		if (ok) break;
		int duzo = 0;
		int gdzie_duzo = 0;
		int malo = 0;
		int gdzie_malo = 0;
		for (int i = 0; i < 3; i ++) {
			if (goal[i] < v[i]) {
				duzo ++;
				gdzie_duzo = i;
			}
			if (goal[i] > v[i]) {
				malo ++;
				gdzie_malo = i;
			}
		}
		if (duzo == 1 && malo == 2) {
			int m1 = gdzie_malo;
			int m2 = 3 - gdzie_duzo - gdzie_malo;
			if (moves[gdzie_duzo][m1].begin() -> first <= moves[gdzie_duzo][m2].begin() -> first) {
				wykonaj(gdzie_duzo, m1, v);
			} else {
				wykonaj(gdzie_duzo, m2, v);
			}
		} else if (duzo == 2 && malo == 1) {
			
// 			assert(false);
			int d1 = gdzie_duzo;
			int d2 = 3 - gdzie_duzo - gdzie_malo;
			if (moves[d1][gdzie_malo].begin() -> first <= moves[d2][gdzie_malo].begin() -> first) {
				wykonaj(d1, gdzie_malo, v);
			} else {
				wykonaj(d2, gdzie_malo, v);
			}
		} else {
			assert(malo == 1 && duzo == 1);
			int other = 3 - gdzie_duzo - gdzie_malo;
			if (not moves[other][gdzie_malo].empty() && moves[gdzie_duzo][gdzie_malo].begin() -> first <=
				moves[gdzie_duzo][other].begin() -> first + moves[other][gdzie_malo].begin() -> first) {
				wykonaj(gdzie_duzo, gdzie_malo, v);
			} else {
				int w1 = wykonaj(gdzie_duzo, other, v);
				int w2 = wykonaj(other, gdzie_malo, v);
				assert(w1 != w2);
			}
		}
	}
	printf("%lld\n", res);
}


Measured memory_bytes: 25472
#include <iostream>
#include <algorithm>

typedef long long ll;
using namespace std;

int main()
{
  ll a, b, k;
  cin >> a >> b >> k;
  ll ansa = max(0LL, a - k);
  ll ansb = b;
  if(ansa == 0)
    ansb = max(0LL, b - (k - a));
  printf("%lld %lld\n", ansa, ansb);

  return 0;
}


Measured memory_bytes: 256
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *                      # ll = deepcopy(l)
from heapq import *                     # heappush(hp,x)
from string import *                    # alpha = ascii_lowercase
from random import *                    # l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *                    # bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin                   # bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize                 # minn = -maxsize
from operator import *                  # d = sorted(d.items(), key=itemgetter(1))
from itertools import *                 # pre = [0] + list(accumulate(l))
from decimal import Decimal             # a = Decimal(a)    # use this for math questions
from collections import Counter         # d = dict(Counter(l))
from collections import defaultdict     # d = defaultdict(list)

'''
5 3
1 2
3 4
5 1
'''

class DSU:

	def __init__(self,n):
		self.n = n
		self.par = list(range(self.n))
		self.size = [1 for i in range(self.n)]

	def find(self,i):
		while(i != self.par[i]):
			self.par[i] = self.par[self.par[i]]
			i = self.par[i]
		return i

	def unite(self,a,b):
		par_a = self.find(a)
		par_b = self.find(b)
		if(par_a == par_b):
			return False
		else:
			if(par_a <= par_b):
				self.par[par_b] = par_a
				self.size[par_a] += self.size[par_b]
			else:
				self.par[par_a] = par_b
				self.size[par_b] += self.size[par_a]
			return True

	def same(self,a,b):
		self.find(a)
		self.find(b)
		return self.par[a] == self.par[b]

	def size(self,a):
		return self.size[a]


N,E = map(int, input().split())
dsu = DSU(N)
for i in range(E):
	a,b = list(map(int, input().split()))
	a -= 1
	b -= 1
	dsu.unite(a,b)
print(max(dsu.size))


Measured memory_bytes: 93340
def inpl(): return list(map(int, input().split()))
X = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(X[int(input())-1])

Measured memory_bytes: 3060
stack = []
arr = gets.split(" ").map{|i| /\d+/ =~ i ? i.to_i: i.to_sym}
for i in 0...arr.length
  if Integer === arr[i]
    stack.push(arr[i])
  else
    a, b = stack.pop(2)
    stack.push(a.send(arr[i], b))
  end
end
puts stack

Measured memory_bytes: 6104
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<map>
using namespace std;
#define ll long long
#define pb push_back
#define pll pair<ll,ll> 
#define mll map<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0; i<n; i++)
#define All(x,v) for(auto x:v)
#define arrin(a,n) ll a[n]; rep(i,n) cin>>a[i]
#define vi vector<int>
#define nl "\n"
#define print(arr) All(x,arr) cout<<x<<" "; cout<<nl
#define sz(x) (int)x.size()
#define all(v) v.begin(),v.end()
#define ing(m,ad) rep(i,m){ int u,v; cin>>u>>v; u--;v--; ad[u].pb(v); ad[v].pb(u);}
#define vdsort(v) sort(v.begin(),v.end(),greater<int>())
#define F first
#define S second
#define mod 1000000007
const int MAXN=100001;
int spf[MAXN];
int gcd(int x, int y){ return y?gcd(y,x%y):x; }

void precal(){  
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++)  spf[i] = i; 
    for (int i=4; i<MAXN; i+=2) spf[i] = 2; 
    for (int i=3; i*i<MAXN; i++) { 
        if (spf[i] == i) 
            for (int j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j)  spf[j] = i; 
    } 
} 
vector<int> getFactorization(int x){
    vector<int> ret; 
    while (x != 1) { 
        ret.push_back(spf[x]); 
        x = x / spf[x]; 
    } 
    return ret; 
}

ll exp(ll n, ll m){
    ll a = 1;
    while (m){
        if (m & 1) a = (a * n % mod) % mod;
        m /= 2;
        n = (n*n) % mod;
    }
    return a;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    int a,b,c,k,t=1;
    // cin>>t;
    while(t--){
        cin>>a>>b>>c>>k;
        while(a>=b && k) {
            b*=2; k--;
        }
        while(b>=c &&  k) {
            c*=2; k--;
        }
        if(a<b && b<c) cout<<"Yes\n";
        else cout<<"No\n";
    }
    return 0;
}

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

int main(){
	int Q;
	cin>>Q;
	for(int i=0;i<Q;i++){
		int c,a,n;
		int can=0,cca=0,ccc=0;
		cin>>c>>a>>n;
		while(1){
			if(c>0&&a>0&&n>0){
				can++;
				a--;c--;n--;
			}else{
				break;
			}
		}
		while(1){
			if(c>1&&a>0){
				cca++;
				a--;
				c-=2;
			}else{
				break;
			}
		}
		while(1){
			if(c>2){
				ccc++;
				c-=3;
			}else{
				break;
			}
		}
		cout<<ccc+cca+can<<endl;
	}
	return 0;
}

Measured memory_bytes: 3068
#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define FOR(i,n,m) for(int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;

// dijkstra O(ElogV)
// verify : https://onlinejudge.u-aizu.ac.jp/problems/GRL_1_A
template<typename T>
struct Dijkstra {
private:
    int V;
    struct edge { int to; T cost; };
    vector<vector<edge>> G;
public:
    const T inf = numeric_limits<T>::max();

    // s から i の最小コスト
    // 経路がない場合は inf
    vector<T> d;

    Dijkstra(int V) : V(V) {
        G.resize(V);
    }

    // 辺の追加
    // 有向の場合　directed = true
    void add_edge(int from, int to, T weight, bool directed = false) {
        G[from].push_back({to,weight});
        if (!directed) G[to].push_back({from,weight});
    }

    void build(int s) {
        d.assign(V, inf);
        typedef pair<T, int> P; //(cost,v)
        priority_queue<P, vector<P>, greater<P>> pq;
        d[s] = 0;
        pq.push(P(d[s], s));

        while (!pq.empty()) {
            P p = pq.top(); pq.pop();
            int v = p.second;
            if (d[v] < p.first) continue;
            for (const edge &e : G[v])
            {
                // 最小値が更新されるとき push
                if (d[e.to] > d[v] + e.cost) {
                    d[e.to] = d[v] + e.cost;
                    pq.push({d[e.to], e.to});
                }
            }
        }
    }
};

int main() {
    int n, m, s, t; cin >> n >> m >> s >> t;
    // G : sからyenだけのコスト
    // T : tからsnuだけのコスト
    Dijkstra<ll> G(n),T(n);
    s--; t--;
    REP(i, m) {
        int u, v, a; ll b;
        scanf("%d %d %lld %lld", &u, &v, &a, &b);
        u--; v--;
        G.add_edge(u, v, a);
        T.add_edge(u, v, b);
    }
    G.build(s);
    T.build(t);
    vector<ll> cost(n,LLINF);
    REP(i, n) {
        int j = n - i - 1;
        cost[j] = min((j<n-1?cost[j+1]:LLINF),G.d[j] + T.d[j]);
    }
    REP(i, n) {
        cout << ll(1e15) - cost[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 19012
#include <bits/stdc++.h>
using namespace std;
int v[305][305];
bool strawberry[305][305]; bool in[305], fir, sec;
long long w, h, k, x, y; char c;
int pox[2], poy[2]; 
queue<int> xx, yy;  
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> h >> w >> k; in[h+1]=1; in[0]=1;
poy[0]=1; poy[1]=-1;
for (int i=0; i<=max(h+1, w+1); i++){
	v[i][0]=1;
	v[0][i]=1;
	v[i][w+1]=1;
	v[h+1][i]=1;
}
for (int i=1; i<=h; i++){
	for (int j=1; j<=w; j++){
		cin >> c;
		if (c=='#'){
			strawberry[i][j]=1;
			v[i][j]=k;
			k--; in[i]=1;
		}
	}
} 

fir=1; sec=1;

for (int i=1; i<=h; i++){
	if (!sec) fir=0;
	for (int j=1; j<=w; j++){
	
		if (strawberry[i][j]){
			
			xx.push(i); yy.push(j);
			
			if (fir){
				sec=0;
				//if (i==1) continue;
				for (int z=i-1; z>0; z--){
				xx.push(z); yy.push(j);
				v[z][j]=v[z+1][j];
				}
			} 
			
			int kl=i+1;
			while (!in[kl]){
				//in[kl]=1;
				xx.push(kl); yy.push(j);
				v[kl][j]=v[kl-1][j]; kl++;
			}
		}
	}
			//cout << "argh";
	while (!xx.empty()){
		x=xx.front(); xx.pop();
		y=yy.front(); yy.pop();
		for (int z=0; z<2; z++){
			if (!v[x+pox[z]][y+poy[z]]){
				v[x+pox[z]][y+poy[z]]=v[x][y];
				xx.push(x+pox[z]);
				yy.push(y+poy[z]);
			}
		}
	}
}
for (int i=1; i<=h; i++){
	for (int j=1; j<=w; j++){
		cout << v[i][j] << " ";
	}
	cout << endl;
}
return 0;
}

Measured memory_bytes: 1280
/*
        _            _                  _            _       _     _         _   _          _          _             _        
       / /\         / /\               / /\         / /\    / /\  /\ \      /\_\/\_\ _     /\ \       /\ \     _    /\ \      
      / /  \       / /  \             / /  \       / / /   / / /  \ \ \    / / / / //\_\   \ \ \     /  \ \   /\_\ /  \ \     
     / / /\ \__   / / /\ \           / / /\ \__   / /_/   / / /   /\ \_\  /\ \/ \ \/ / /   /\ \_\   / /\ \ \_/ / // /\ \_\    
    / / /\ \___\ / / /\ \ \         / / /\ \___\ / /\ \__/ / /   / /\/_/ /  \____\__/ /   / /\/_/  / / /\ \___/ // / /\/_/    
    \ \ \ \/___// / /  \ \ \        \ \ \ \/___// /\ \___\/ /   / / /   / /\/________/   / / /    / / /  \/____// / / ______  
     \ \ \     / / /___/ /\ \        \ \ \     / / /\/___/ /   / / /   / / /\/_// / /   / / /    / / /    / / // / / /\_____\ 
 _    \ \ \   / / /_____/ /\ \   _    \ \ \   / / /   / / /   / / /   / / /    / / /   / / /    / / /    / / // / /  \/____ / 
/_/\__/ / /  / /_________/\ \ \ /_/\__/ / /  / / /   / / /___/ / /__ / / /    / / /___/ / /__  / / /    / / // / /_____/ / /  
\ \/___/ /  / / /_       __\ \_\\ \/___/ /  / / /   / / //\__\/_/___\\/_/    / / //\__\/_/___\/ / /    / / // / /______\/ /   
 \_____\/   \_\___\     /____/_/ \_____\/   \/_/    \/_/ \/_________/        \/_/ \/_________/\/_/     \/_/ \/___________/    
                                                                                                                              
*/
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)

#define endl '\n'
#define pb emplace_back
#define mkp make_pair
#define p_q priority_queue
#define INF 1000000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)

const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long

template <typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

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

  int r; cin >> r;
  cout << 3*r*r << endl;
}

Measured memory_bytes: 256
// God put a smile upon your face <3

#include <bits/stdc++.h>

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

bool is(ll x)
{
	while(x)
	{
		if(x % 10 == 7) return 1;

		x /= 10;
	}

	return 0;
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

    while(cin >> input)
    {
		if(is(input)) cout << "Yes\n";
		else cout << "No\n";
    }


}





Measured memory_bytes: 3488
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
const int MOD = 1e9 + 7;

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

	int n; cin >> n;
	vector<int> p(n);
	for (int i = 0; i < n; i++) cin >> p[i];
	int res = 0;
	p.push_back(0);
	for (int i = 0; i < n; i++) {
		int idx = i + 1;
		if (p[i] == idx) {
			swap(p[i], p[i + 1]);
			res++;
		}
	}
	cout << res << endl;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007

int main(){
    string s;
    int k;
    cin>>s>>k;
    int n=s.size();
    for(int i=0;i<n;i++){
        if(s[i]!='a'){
            int t='z'-s[i]+1;
            if(t<=k){
                s[i]='a';
                k-=t;
            }
        }
    }
    if(k>0){
        k%=26;
        s.back()+=k;
    }
    cout<<s<<endl;

}

Measured memory_bytes: 512
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n,m = map(int,input().split())
stair = [True for _ in range(n+1)]
for _ in range(m):
    broken = int(input())
    stair[broken] = False

mod = 1000000007

dp=[0 for _ in range(n+1)]

dp[0]=1
for now in range(n):
    for next in range(now+1,min(n,now+2)+1):
        if stair[next]:
            dp[next] += dp[now]
            dp[next] %= mod

print(dp[n])
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する



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

using namespace std;

typedef long long ll;
const int INF = 1<<30;

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

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

ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


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

    int N, M;
    cin >> N >> M;
    vector<vector<int>> G(N);

    // 0-indexed
    int u, v;
    for(int i = 0; i < M; i++){
        cin >> u >> v;
        u--;
        v--;
        G[u].push_back(v);
    }

    vector<vector<int>> d(N);
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 3; j++){
            d[i].push_back(INF);
        }
    }

    int S, T;
    cin >> S >> T;
    S--;
    T--;

    queue<int> q;
    q.push(S);
    d[S][0] = 0;

    int max_visit = (N+M)*10;
    int N_visit = 0;
    int current = 0;
    int next    = 0;
    while(q.size() != 0 && N_visit < max_visit){
        current = q.front();
        q.pop();

        for(int i = 0; i < G[current].size(); i++){
            next = G[current][i];
            for(int j = 0; j < 3; j++){
                if(chmin(d[next][(j+1)%3], d[current][j]+1)) q.push(next);
            }
        }
        N_visit++;
    }

    if(d[T][0] == INF){
        cout << -1 << endl;
    }else{
        cout << (d[T][0]/3) << endl;
    }

    return 0;
}



Measured memory_bytes: 11264
// Contest: AtCoder Beginner Contest 145 (https://atcoder.jp/contests/abc145)
// Problem: E: All-you-can-eat (https://atcoder.jp/contests/abc145/tasks/abc145_e)


// region {{{ boilerplate
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <chrono>
#include <cstdint>
#include <deque>
#include <exception>
#include <forward_list>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if __cplusplus >= 201703L
#   include <optional>
#   include <string_view>
#   include <variant>
#endif

using namespace std;

#if __cplusplus >= 201703L
#   define all(a)      begin(a),end(a)
#   define sz(x)       ((int)size(x))
#else
#   define all(a)      (a).begin(),(a).end()
#   define sz(x)       ((int)(x).size())
#endif

#define rep(a, b)      for(int a = 0; a < (b); ++a)
#define reps(a, b, c)  for(int a = (b); a < (c); ++a)
#define trav(a, b)     for(auto& a : b)

using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;

using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;

#if __cplusplus >= 201703L
#   define MAYBE_UNUSED [[maybe_unused]]
#else
#   define MAYBE_UNUSED
#endif

MAYBE_UNUSED static constexpr int INF = (int)1e9 + 5;
MAYBE_UNUSED static constexpr ll INFL = (ll)1e18 + 5;
MAYBE_UNUSED static mt19937 rng((u32)chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
//endregion }}}


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

    int n, t; cin >> n >> t;
    vpi d(n);
    trav(p, d) cin >> p.first >> p.second;
    sort(all(d));

    vi dp(t + 1);
    trav(p, d) {
        int ai, bi; tie(ai, bi) = p;
        for (int i = max(0, t - ai); i < t; ++i)
            dp[t] = max(dp[t], dp[i] + bi);
        for (int i = t - 1; i >= ai; --i)
            dp[i] = max(dp[i], dp[i - ai] + bi);
    }

    cout << dp[t] << '\n';
    return 0;
}

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

const int MAXN = 1010;
const int MAXV = MAXN*(MAXN-1)/2;

vector< vector<int> > graph (MAXV, vector<int>(0));
vector<int> dp (MAXV, -1);
int Vtable[MAXN][MAXN];
bool calculated[MAXV];

int q(int k) { // kからの最長経路
    if (dp[k] != -1) {
        if (!calculated[k]) return -1;
        return dp[k];
    }

    dp[k] = 1;
    for (int u : graph[k]) {
        int temp = q(u);
        if (temp == -1) return -1;

        dp[k] = max(dp[k], temp+1);
    }

    calculated[k] = true;
    return dp[k];
}

int returnV(int i, int j) {
    if (i > j) swap(i, j);
    return Vtable[i][j];
}

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

    vector< vector<int> > a (N, vector<int>(N-1));
    rep(i, N) {
        rep(j, N-1) {
            cin >> a[i][j];
            a[i][j]--;
        }
    }

    int V = 0;
    rep(i, N) rep(j, N) {
        if (i < j) {
            Vtable[i][j] = V;
            V++;
        }
    }

    rep(i, N) rep(j, N-2) {
        int A, B;
        A = returnV(i, a[i][j]);
        B = returnV(i, a[i][j+1]);
        graph[A].push_back(B);
    }
    
    int maxi = 0;
    rep(i,V) {
        int temp = q(i);
        if (temp == -1) {
            cout << -1 << endl;
            return 0;
        }
        maxi = max(maxi, temp); 
    }
    cout << maxi << endl;
    return 0;
}

Measured memory_bytes: 38272
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
typedef long long ll;
typedef vector<ll> vl;
#define rp(i, f, t) for (int i = f; i < t; i++)
#define pr(i, f, t) for (int i = t - 1; i >= f; i--)
#define ca(n, a) rp(ca_i, 0, n) cout << a[ca_i] << ((ca_i == n - 1) ? "\n" : " ")
#define za(n, a) rp(za_i, 0, n) a[za_i] = 0
#define be(a) a.begin(), a.end()
int main()
{
    ll n, a, b;
    cin >> n >> a >> b;
    cout << (ll(n / (a + b)) * a + min(a, n % (a + b))) << endl;
}

Measured memory_bytes: 256