akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pp long long int
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define rzip(i,a,b) for(int i=a;i>=b;i--)
#define ll unsigned long long int
#define test int t;cin>>t; while(t--)
#define um unordered_map
#define en '\n'
#define us unordered_set
typedef pair<int, int>     pii;
typedef pair<char, int>    pci;
typedef pair<char, char>   pcc;
typedef vector<pii>       vii;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define INF (1e18+5)
#define inf (1e9+5)
#define mod 1000000007


bool check_prime(long long n)
{
	int flag = 0;
	for (long long i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			flag = 1;
			break;
		}
	}
	if (n == 1)
		return false;
	else if (flag == 0 || n == 2 || n == 3)
	{
		return true;
	}
	else
	{
		return false;
	}

}

int BE(int x, int n, int m) //function to calculate x raise to power n modulo m
{
	int result = 1;
	while (n > 0)
	{
		if (n % 2 == 1)
			result = result * x % m;
		x = x * x % m;
		n = n / 2;
	}
	return result;
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	if (fopen("input.txt", "r"))
	{
		freopen ("input.txt" , "r" , stdin);
		freopen ("output.txt" , "w" , stdout);
	}
#endif
	//_______________________________-code starts-_______________________________________________

	int n, y;
	cin >> n >> y;
	rep(i, 0, 2000)
	{
		rep(j, 0, 2000)
		{
			int x = y - 10000 * i - 5000 * j;
			if (x % 1000 == 0 && x / 1000 + i + j == n && x >= 0)
			{
				cout << i << " " << j << " " << x / 1000 << en;
				return 0;
			}
		}
	}
	cout << -1 << " " << -1 << " " << -1 << en;



	return 0;

}



Measured memory_bytes: 256
#include<iostream>

using namespace std;

long gcd(long a, long b);

int main(){
    int N;
    cin >> N;
    long a[N];
    for(int i=0;i<N;i++){
        cin >> a[i]; 
    }

    long r[N];
    long l[N];

    l[0] = a[0];
    r[N-1] = a[N-1];

    for(int i=1;i<N-1;i++){
        l[i] = gcd(l[i-1], a[i]);
        r[N-1-i] = gcd(r[N-i], a[N-1-i]);
    }

    long max = -1;
    long temp;
    for(int i=1;i<N-1;i++){
        temp = gcd(r[i+1], l[i-1]);
        if(max < temp) max = temp;
    }
    if(max < l[N-2]) max = l[N-2];
    if(max < r[1] ) max =r[1];

    cout << max << endl;
    return 0;
}


long gcd(long a, long b){
    if(a < b){
        long temp = b;
        b = a;
        a = temp;
    }
    long c = a%b;
    if(c==0){
        return b;
    }
    else{
        return gcd(c,b);
    }
}

Measured memory_bytes: 2560
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 1000000

int main(){

    int k,s;
    cin >> k >> s;
    vector<int> a(MAX_A,MAX_A);

    for(int i = k;i >= 0;i--){
        a[k-i] = s-i;
        //cout << a[i] << " ";
    }
    /*REP(k+1){
        cout << a[i];
    }
    cout << endl;*/
    int count = 0;
    //vector<int>::iterator itr;
    for(int i = 0;i <= k;i++){
        for(int j = 0;j <= k;j++){
            int tmp = i+j;
            //cout << i+j << endl;
            if(std::binary_search(a.begin(),a.end(),tmp)){
                count++;
                //cout << i+j << " " << count << endl;
            }

        }
    }
    cout << count << endl;


    return 0;
}

Measured memory_bytes: 4732
w,h,x,y = map(float,input().split())
s = float(w*h/2)
d = 0
if h*x/w == y and x != 0 and x != w:
    d = 1
elif -(h*x/w) + h == y and x != 0 and x != w:
    d = 1
print("{0} {1}".format(s,d))

Measured memory_bytes: 2940
N = int(input())
S = input()

ans = 0
for i in range(N+1):
  left = S[:i]
  right = S[i:]

  k=0
  for j in range(ord('a'),ord('z')+1):
    if left.count(chr(j))>0 and right.count(chr(j))>0:
      k += 1

  if ans<k:
    ans = k

print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<string.h>
using namespace std;

short mat[4000][4000];

int lcs(string s,string t) {
  int z = 0;
  for(int i=0; i<s.length(); ++i) {
    for(int j=0; j<t.length(); ++j) {
      if(s.at(i) == t.at(j)) {
        if(i == 0 || j == 0)
          mat[i][j] = 1;
        else {
          mat[i][j] = mat[i-1][j-1] + 1;
        }
        z = max(z, (int)mat[i][j]);
      }
    }
  }
  return z;
}

int main() {
  string s,t;
  while(cin>>s) {
    cin>>t;
    memset(mat, 0, sizeof(mat));
    cout<<lcs(s,t)<<endl;
  }
}

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int N;
int level[510][510];

void f(std::vector<int> v, int l){
    int n = v.size();

    if(n <= 1){
        return;
    }
    
    std::vector<int> v1, v2;
    v1.emplace_back(v[0]);

    for(int i=1;i<n;++i){
        level[v[i-1]][v[i]] = l;
        level[v[i]][v[i-1]] = l;
    }

    for(int i=1;i<n;i+=2){
        v2.emplace_back(v[i]);
        if(i + 1 < n){
            v1.emplace_back(v[i + 1]);
        }
    }

    // for(int i : v1){
    //     std::cout << i << std::endl;
    // }
    // for(int i : v2){
    //     std::cout << "?" << i << std::endl;
    // }
    // std::cout << "----------" << std::endl;

    for(int i=0;i<v1.size();++i){
        for(int j=0;j<v2.size();++j){
            level[v1[i]][v2[j]] = l;
            level[v2[j]][v1[i]] = l;
        }
    }

    f(v1, l + 1);
    f(v2, l + 1);
}

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

    std::cin >> N;

    std::vector<int> v;

    for(int i=1;i<=N;++i){
        v.emplace_back(i);
    }

    f(v, 1);

    for(int i=1;i<N;++i){
        for(int j=i+1;j<=N;++j){
            std::cout << level[i][j] << " \n"[j == N];
        }
    }
}


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

#define ll long long
#define ar array

const int mxN=3e3, M=998244353;
int n, s, a[mxN];
ll dp[mxN+1][mxN+1], ans;

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

	cin >> n >> s;
	for(int i=0; i<n; ++i) {
		cin >> a[i];
		memcpy(dp[i+1], dp[i], sizeof(dp[0]));
		//start a new sequence
		dp[i+1][a[i]]=(dp[i+1][a[i]]+i+1)%M;
		for(int j=0; j+a[i]<=s; ++j)
			dp[i+1][j+a[i]]=(dp[i+1][j+a[i]]+dp[i][j])%M;
		ans=(dp[i+1][s]+ans)%M;
	}
	cout << ans;
}


Measured memory_bytes: 73944
h, w = map(int, input().split())
s = [[i == "#" for i in input()] for _ in range(h)]
dp = [[10**9] * w for _ in range(h)]
dp[0][0] = int(s[0][0])
for i in range(h):
    for j in range(w):
        a = dp[i - 1][j] + (not s[i - 1][j] and s[i][j])
        b = dp[i][j - 1] + (not s[i][j -1] and s[i][j])
        dp[i][j] = min(a, b,dp[i][j])
print(dp[-1][-1])


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

using namespace std;

#define INPUT_OUTPUT { \
	freopen("input.txt", "r", stdin); \
	freopen("output.txt", "w", stdout); \
}

int main()
{
	//INPUT_OUTPUT;
	int n, i, k = 0;
	cin >> n;
	string s;
	cin >> s;
	for(i = 0; i < s.size(); i++) {
		if(s.at(i)+n > 90) {
			k = (s.at(i)+n)-90;
			s.at(i) = char(65+k-1);
		}
		else {
			s.at(i) = char(s.at(i)+n);
		}
	}
	cout << s << endl;
	return 0;
}

Measured memory_bytes: 256
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

N, M = getNM()
A = [int(i) // 2 for i in input().split()]

# 4と8の場合
# 2 6 10 14 18...
# 4 12 20 28... これを２で割ると

# 1 3 5 7 9...
# 2 4 10 14... 起点が偶数と奇数なため永遠に一致しない

# 4と12なら
# 2 6 10 14 18...
# 6 18 30 42... これを２で割ると
# 1 3 5 7 9...
# 3 9 15 21...　になり、起点が奇数と奇数になるためどこかで一致する

# Aの各要素がどれも2でn回ちょうど割れる必要がある
def div_2(n):
    cnt = n
    res = 0
    while cnt > 0:
        if cnt % 2 == 0:
            cnt //= 2
            res += 1
        else:
            return res

def lcm(x, y):
    return x * (y // gcd(x, y))

judge = [div_2(i) for i in A]

if min(judge) != max(judge):
    print(0)
    exit()
L = 1
for i in range(N):
    L = lcm(L, A[i])

# Ai * 0.5, Ai * 1, Ai * 1.5...の個数 - Ai * 1, Ai * 2...の個数
print(M // L - M // (2 * L))

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)

int main(){
 int n,x;
  cin >> n >> x;
  VI m(n);
  ll sum=0;
  int a=1001;
  rep(i,n){
    cin >> m.at(i);
    a=min(a,m.at(i));
    sum+=m.at(i);
  }
  int am;
  am=n+(x-sum)/a ;
  cout << am << endl;      
}

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

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

class unionfind {
	vector<int> par, rank;

public:
	void init(int n) {
		par.resize(n);
		rank.resize(n);

		for (int i = 0; i < n; i++) {
			par[i] = i;
			rank[i] = 0;
		}
	}

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

	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y) return ;

		if (rank[x] < rank[y]) par[x] = y;
		else {
			par[y] = x;
			if (rank[x] == rank[y]) ++rank[x];
		}
	}

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

int N, M;

int main() {
	ios::sync_with_stdio(false);
	cin >> N >> M;
	uf.init(N + M);

	rep(i, N) {
		int K;
		cin >> K;
		rep(j, K) {
			int l;
			cin >> l;
			--l;
			uf.unite(i, N+l);
		}
	}

	set<int> s;
	rep(i, N) s.insert(uf.find(i));

	puts((int)s.size()==1?"YES":"NO");
	return 0;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=200005,MOD=1000000007;

int n,A[MAXN],last[MAXN];
int dp[MAXN];

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&A[i]);
	dp[0]=1;
	for(int i=1;i<=n;i++)
	{
		dp[i]=dp[i-1];
		if(last[A[i]]&&last[A[i]]!=i-1)
			dp[i]=(dp[i]+dp[last[A[i]]])%MOD;
		last[A[i]]=i;
	}
	printf("%d\n",dp[n]);
	
	return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
template <typename T>
inline bool chmax (T& a, T b)
{
  if(a < b)
  {
    a = b;
    return true;
  }
  return false;
}

bool odd(int x)
{
  if(x % 2 == 1)
  {
    return true;
  }
  return false;
}

int main()
{
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n)
  {
    cin >> a[i];
  }
  int ans = 0;

  for(int i; i < n; i += 2)
  {
    if(odd(a[i]))
    {
      ans++;
    }
  }

cout << ans << endl;
}


Measured memory_bytes: 3592
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
//-----------------------------------------
#define dcml(n) fixed<<setprecision(n)
using namespace std;
typedef pair<ll,ll> P;
int main(void){
    ll N;cin>>N;
    priority_queue<P,vector<P>,greater<P>> que;
    ll A,B;
    REP(i,N){
        cin>>A>>B;
        que.push(make_pair(B,A));
    }
    bool ok=true;
    ll time=0;
    REP(i,N){
        auto r=que.top();que.pop();
        time+=r.second;
        if(time>r.first){
            ok=false;
            break;
        }
    }
    if(ok)cout<<"Yes"<<"\n";
    else cout<<"No"<<"\n";
}

Measured memory_bytes: 6384
/*
https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
https://www.youtube.com/watch?v=gPFr7q7eLL8
じょえ〜
*/

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n,k;
  cin >> n >> k;
  ll ans=0;
  while(n) {
    ans++;
    n/=k;
  }
  pr(ans);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int a, b;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> a >> b;
  cout << (a+b)%24 << endl;
}

Measured memory_bytes: 256
import sys
N=int(sys.stdin.readline().strip())

mod=10**9+7
fact,inv_fact=[1], [1]
fact_tmp=1
for i in range(1, N+1):
    fact_tmp*=i
    fact_tmp%=mod
    fact.append(fact_tmp)
    inv_fact.append(pow(fact_tmp,mod-2,mod))

def ncr(n,r):
	if n<0 or r<0 or n<r: return 0
	else: return (fact[n]*inv_fact[r]*inv_fact[n-r])%mod

b=N/3

ans=0
for i in range(1,b+1):
    ans+=ncr(N-i*3+i-1,i-1)
    ans%=mod
print ans


Measured memory_bytes: 68652
def main():
    n = int(input())
    lst_a = [int(v) for v in input().split()]
    s = 0
    for a in lst_a:
        s ^= a
    lst_b = []
    for a in lst_a:
        lst_b.append(s ^ a)
    for i, b in enumerate(lst_b):
        if i > 0:
            print(' ', end='')
        print(b, end='')
    print()


if __name__ == '__main__':
    main()


Measured memory_bytes: 31452
import java.io.*;
 
class Main {
    	public static void main(String[] args) throws IOException {
        	double x1, y1, x2, y2;
        	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String[] str = br.readLine().split(" ");
	        x1 = Double.parseDouble(str[0]);
	        y1 = Double.parseDouble(str[1]);
	        x2 = Double.parseDouble(str[2]);
	        y2 = Double.parseDouble(str[3]);
	        System.out.println(Math.sqrt(Math.pow(Math.abs(x2 - x1), 2) + Math.pow(Math.abs(y2 - y1), 2)));
    	}
}

Measured memory_bytes: 17104
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<cstdint>
#include<cstddef>
#include<algorithm>
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using usize = uint_fast64_t;
#define rep(i, n) for (usize i = 0; i < (usize)(n); i++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using P = pair<i64,i64>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
i64 a,b,c,d;
cin >> a >> b >> c >> d;

    cout << max({a * c, b * d,a * d,b * c}) << endl;
}

Measured memory_bytes: 3648
void main(){
	string s = readln().chomp();
	string t = readln().chomp();
	sort!("a<b")( cast(ubyte[]) s);
	sort!("a>b")( cast(ubyte[]) t);

	writeln(s<t?"Yes":"No");
}
     
import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math, std.range;
const long mod = 10^^9+7;      
// 1要素のみの入力
T inelm(T= int)(){
	return to!(T)( readln().chomp() );
}
     
// 1行に同一型の複数入力
T[] inln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split())ln ~= elm.to!T();
	return ln;
}


Measured memory_bytes: 2588
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7

O = str(input())
E = str(input())

ans = ""
for i in range(len(E)):
    ans += O[i]
    ans += E[i]

if len(O)-len(E) == 1:
    ans += O[-1]

print(ans)


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

int main(){
    
    while(1){
        
    
    int a,b;
    
    string op;
    
    cin>>a>>op>>b;
    
    if ( op == "?") break; 
    
    if ( op == "+" ){
        
        cout<< a + b<<endl;
    }
    
    else if ( op == "-" ){
        
        cout<< a - b <<endl;
        
    }
    
    else if ( op == "*"){
        
        cout<< a * b <<endl;
        
    }
    
    else if ( op == "/" ){
        
        cout<< a / b <<endl;
        
    }
}
    
    
    return 0;
}


Measured memory_bytes: 3144
#include <bits/stdc++.h>
#define endl    '\n'
using namespace std;

typedef long long ll;

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

    int n;
    int id, d1, d2;
    int max_id, max_v;

    cin >> n;

    while (n != 0) {
        max_v = -1;

        for (int i = 0; i < n; i++) {
            cin >> id >> d1 >> d2;

            if (max_v < d1 + d2) {
                max_id = id;
                max_v  = d1 + d2;
            }
        }

        cout << max_id << " " << max_v << endl;

        cin >> n;
    }

    return 0;
}




Measured memory_bytes: 3140
import java.util.ArrayList;
import java.util.Scanner;
 
public class Main{
    public static void main(String[] args){
        ArrayList<Integer> A = new ArrayList<Integer>();
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
 
        for(int i=0;i<N;i++){
            A.add(scanner.nextInt());
        }
        printList(A,N);
        insertionSort(A,N);
    }
     
    static void insertionSort(ArrayList<Integer> A,int N){
        for(int i=1;i<N;i++){
            int v = A.get(i);
            int j=i-1;
            while(j>=0 && (v < A.get(j))){
                A.set(j+1,A.get(j));
                j--;
            }
            A.set(j+1, v);
            printList(A,N);
        }
    }
    static void printList(ArrayList<Integer> A,int N){
        StringBuilder builder = new StringBuilder();
        for(int i=0;i<N;i++){
            if(i>0){
                builder.append(" ");
            }
            builder.append(A.get(i));
        }
        System.out.println(builder);
    }
}

Measured memory_bytes: 29728
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define sz(x) (int)(x).size()
typedef vector<int> vi;
// #define ll long long 
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
const int MOD = 1e9+7;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=1e5+2;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int k,x;
	cin>>k>>x;
	if(500*k>=x)
	{
		cout<<"Yes\n";
	}
	else cout<<"No\n";
}  
// I never lose. I either win or I learn

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

using namespace std;

typedef long long ll;
typedef vector<ll> vl;

const int MAX_P = 1100000;

int main() {
  ll a, b; cin >> a >> b;
  vector<bool> isPrime(MAX_P, true);
  vl primes;
  for (int p = 2; p < MAX_P; p++) {
    if (isPrime[p]) {
      primes.push_back(p);
      for (int i = 2*p; i < MAX_P; i += p) {
        isPrime[i] = false;
      }
    }
  }
  ll g = __gcd(a,b);
  int ans = 0;
  for (int i = 0; i < primes.size(); i++) {
    ll p = primes[i];
    if (g % p == 0) {
      while (g%p==0) g/=p;
      ans++;
    }
  }
  if (g != 1) ans++;
  cout << ans + 1 << endl;
  return 0;
}


Measured memory_bytes: 1528
#include <bits/stdc++.h>
using namespace std;
typedef std::pair<int, int> ipair;
#define int long long
#define pb push_back
#define ff first
#define INF INT_MAX
#define ss second
#define rep(i, a) for (int i = 0; i < a; i++)
#define fr(i, j, a) for (int i = j; i < a; i++)
#define cnt_ones(x) __builtin_popcount(x)
#define all(x) x.begin(), x.end()
#define mp make_pair
#define mod 1000000007
#define IOS                                                                    \
  std::ios::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
void init() {
  int n,k;
  cin >> n>>k;
  vector<int> h(n), dp(n,INT_MAX);
  fr(i, 0, n) cin >> h[i];
  dp[0] = 0;
  fr(i, 0, n) {
      fr(j,i,i+k+1){
          if(j<n){
              dp[j]=min(dp[j],dp[i]+abs(h[i]-h[j]));
          }
      }
  }
  cout<<dp[n-1]<<endl;
}
int32_t main() {
  IOS;
  init();
  return 0;
}


Measured memory_bytes: 1792
n, m, x = map(int, input().split())
a = list(map(int, input().split()))
p1 = 0
p2 = 0
for i in range(x)[::-1]:
    if i in a:
        p1 += 1
for i in range(x, n + 2):
    if i in a:
        p2 += 1
print(min(p1, p2))

Measured memory_bytes: 3064
#include<stdio.h>
#include<bits/stdc++.h>
#include<string>
#include<string.h>
using namespace std;
int main ()
{
    int n,i,l,p,k;
    cin>>n;
    set<string> ss;
    string s,q,w;
    vector<string>v;
    for(i=0;i<n;i++)
    {
        cin>>s;
        v.push_back(s);
    }
        for(i=0;i<n;i++)
    {
        ss.insert(v[i]);
    }
    l=0;
    for(i=0;i<n-1;i++)
    {
        q=v[i];
        p=q.size();
        w=v[i+1];
        if(q[p-1]==w[0])
            l++;


    }

    if(l==(n-1)&&ss.size()==n)
        printf("Yes\n");
    else
        printf("No\n");

    return 0;
}


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

int main(){
  vector<int> a={0,1,3,1,2,1,2,1,1,2,1,2,1};
  int x,y;
  cin >> x >> y;
  if(a.at(x)==a.at(y)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
N, S = int(input()), input()
res = 0
def cmn_chars(A, B):
    a_set, b_set = set(A), set(B)
    return len(a_set.intersection(b_set))

res = cmn_chars(S[:len(S)//2], S[len(S)//2:])

for idx in range(res, len(S) - res):
    res = max(cmn_chars(S[:idx], S[idx:]), res)

print(res)

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line = br.readLine();
        String[] lineArray = line.split(" ");
        int H = Integer.parseInt(lineArray[0]);
        int W = Integer.parseInt(lineArray[1]);

        char[][] campus = new char[H + 2][W + 2];

        for (int i = 1; i < H + 1; i++) {
            line = br.readLine();
            for (int j = 1; j < W + 1; j++) {
                campus[i][j] = line.charAt(j - 1);
            }
        }

        for (int i = 1; i < H + 1; i++) {
            if (drawer(campus, H, W, i) == "No") {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");

    }
    
    public static String drawer(char[][] campus, int H, int W, int i) {
        for (int j = 1; j < W + 1; j++) {
            if (!(campus[i - 1][j] == '#' || campus[i][j - 1] == '#' || campus[i][j + 1] == '#'
                    || campus[i + 1][j] == '#') && campus[i][j] == '#') {
                return "No";
            }
        }
        return "Yes";
    }
}

Measured memory_bytes: 23380
p (1..gets.to_i).inject(1){|s,i|
	s*i%998244353
}*gets.chomp.chars.map{|x|
	{"R"=>0,"G"=>1,"B"=>2}[x]
}.inject([[0]*6,1]){|a,c|
	a[0][c+3]>0 ?
		a.tap{a[1]=a[1]*a[0][c+3]%998244353}.tap{a[0][c+3]-=1}
	: a[0][t=(c+1)%3]>0 ?
		a.tap{a[1]=a[1]*a[0][(c+1)%3]%998244353}.tap{a[0][(c+1)%3]-=1}.tap{a[0][3+(c+2)%3]+=1}
	: a[0][t=(c+2)%3]>0 ?
		a.tap{a[1]=a[1]*a[0][(c+2)%3]%998244353}.tap{a[0][(c+2)%3]-=1}.tap{a[0][3+(c+1)%3]+=1}
	: a.tap{a[0][c]+=1}
}[1]%998244353

Measured memory_bytes: 54932
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    A, B, C, K = LI()

    if A+B>=K:
        print(min(A, K))
    else:
        print(A-(K-(A+B)))

if __name__ == '__main__':
    resolve()

Measured memory_bytes: 9212
#include <iostream>

using namespace std;

int gcd(int a, int b){
	if(b>0){
		return gcd(b, a%b);
	}
	else{
		return a;
	}
}

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

int main(){
	int a, b;

	while(cin >> a >> b){
		cout << gcd(a,b) << " " << lcm(a,b) << endl;
	}
}

Measured memory_bytes: 1160
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <iterator>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
 
#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)c.size())

typedef unsigned long long ull;
const int INF = (int)1e8;

int main(){
	int n;
	while(cin>>n,n!=-1){
		if(n==0){ puts("0"); continue; }
		string s;
		while(n>0){
			s += ('0'+n%4);
			n/=4;
		}
		reverse(s.begin(),s.end());
		cout << s << endl;
	}
	return 0;
}

Measured memory_bytes: 1192
import kotlin.math.sqrt

// https://atcoder.jp/contests/abc112/tasks/abc112_d
fun longList() = readLine()?.split(" ")?.map(String::toLong) ?: TODO()
fun main() {
    val (n, m) = longList()
    if (isPrime(m)) {
        if (n == 1L) {
            println(m.toString())
        } else {
            println("1")
        }
        return
    }
    (m / n).downTo(1).forEach {
        if (m % it == 0L) {
            println(it.toString())
            return
        }
    }
}

fun isPrime(candidate: Long): Boolean {
    if (candidate % 2L == 0L) {
        return false
    }
    var prime = 3
    val l = sqrt(candidate.toDouble()).toLong()
    while (l > prime) {
        if (candidate % prime == 0L) {
            return false
        }
        prime += 2
    }
    return true
}

Measured memory_bytes: 36676
N = int(input())
A = sorted(list(map(int, input().split())))
dp = {}
quota = 0
res = 0
size = 0
streak = 1
for i in range(N-1):
  a = A[i]
  size += a
  if A[i+1] <= size*2:
    streak += 1
  else:
    streak = 1

print(streak)


Measured memory_bytes: 63856
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int h[] = new int[n];
		int a[] = new int[m];
		int b[] = new int[m];
		int  data[] = new int[n+1];
		int count =0;
		int max = 0;
		int min = 0;


		for (int i = 0;i<n ;i++ ) {
			h[i] = sc.nextInt();
		}
		for (int i = 0;i<m ;i++ ) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();

			if (h[a[i]-1]>h[b[i]-1]) {
				max = a[i];
				min = b[i];
			}else{
				max = b[i];
				min = a[i];
				if (h[a[i]-1]==h[b[i]-1]) {
					data[min] -=100;
					data[max] -=100;
				}
			}
			data[max] +=1;
			data[min] -=100;
		}

		for (int i = 1;i<n+1 ;i++ ) {
			if (data[i]>=0) {
				count++;
			}
		}

		System.out.println(count);
	}
}


Measured memory_bytes: 61332
#include<bits/stdc++.h>
using namespace std;
int h,w;
char chr[1005][1005];
int f[1005][1005]={0};
int main(){
	scanf("%d %d",&h,&w);
	for(int i=1;i<=h;i++){
		string str;
		cin>>str;
		for(int j=1;j<=w;j++){
		chr[i][j]=str[j-1];
		}
	}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(i==1&&j==1) {
				f[i][j]=1;continue;
			}
			if(chr[i][j]=='#') f[i][j]=0;
			else f[i][j]=(f[i-1][j]+f[i][j-1])%1000000007;
		}
	}
	cout<<f[h][w];
	return 0;
}

Measured memory_bytes: 5120
#include<iostream>
      
using namespace std;
      
int main()
{
    int a, b;
    do{
        cin >> a >> b;
 
        if((a == 0) && (b == 0)) break;
        if(a > b){
            cout << b << " " << a << endl;
        }else{
            cout << a << " " << b << endl;
        }
 
    }while(1);
 
    return 0;
}

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

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

    string s;
    cin >> s;

    bool start = false;
    int ans = 0;
    int cnt = 0;
    for(size_t i = 0; i < s.size(); ++i){
        if(start){
            ++cnt;
            if(s[i] == 'Z'){
                ans = cnt;
            }
        }
        if(s[i] == 'A' && !start){
            start = true;
            cnt = 1;
        }
    }
    cout << ans << endl;

    return 0;
};

Measured memory_bytes: 720
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]D - Integer Cards
            var line = ReadLine();
            long n = (long)line[0]; //カードの枚数
            int m = line[1]; //操作の回数

            var cards = GetCards();

            for (int i = 0; i < m; i++)
            {
                line = ReadLine();
                int count = line[0];  //選べるカードの最大枚数
                int number = line[1]; //カードに書かれた整数

                if (cards.ContainsKey(number))
                {
                    cards[number] += count;
                }
                else
                {
                    cards.Add(number, count);
                }
            }

            var query = cards.OrderByDescending(x => x.Key);
            long sum = 0;

            foreach(var q in query)
            {
                if (n >= q.Value)
                {
                    sum += q.Key * q.Value;
                    n -= q.Value;
                }
                else
                {
                    sum += q.Key * n;
                    break;
                }
            }

            Console.WriteLine(sum);
        }

        static Dictionary<long, long> GetCards()
        {
            //カードに書かれた数字
            var a = ReadLine();

            var cards = new Dictionary<long, long>();

            foreach(var ai in a)
            {
                if (cards.ContainsKey(ai))
                {
                    cards[ai]++;
                }
                else
                {
                    cards.Add(ai, 1);
                }
            }

            return cards;
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var array = line.Split(' ');

            return array.Select(x => int.Parse(x)).ToList();
        }
    }
}


Measured memory_bytes: 34356
#include <iostream>
#include <bits/stdc++.h>
#define mod 998244353

using namespace std;
int n;
pair<int,int> point[200005];
vector<int> xmp;
map<int,int> xti;
int d[1600010],b[1600010];
int xcnt[200005];long long p2m[200005];

void build(int s, int t, int p) {
  if (s == t) {
    d[p] = xcnt[s];
    return;
  }
  int m = (s + t) / 2;
  build(s, m, p * 2), build(m + 1, t, p * 2 + 1);
  d[p] = d[p * 2] + d[(p * 2) + 1];
}

void update(int l, int r, int c, int s, int t, int p) {

  if (l <= s && t <= r) {
    d[p] += (t - s + 1) * c, b[p] += c;
    return;
  }
  int m = (s + t) / 2;
  if (b[p] && s != t) {
    d[p * 2] += b[p] * (m - s + 1), d[p * 2 + 1] += b[p] * (t - m);
    b[p * 2] += b[p], b[p * 2 + 1] += b[p];
    b[p] = 0;
  }
  if (l <= m) update(l, r, c, s, m, p * 2);
  if (r > m) update(l, r, c, m + 1, t, p * 2 + 1);
  d[p] = d[p * 2] + d[p * 2 + 1];
}

int getsum(int l, int r, int s, int t, int p) {

  if (l <= s && t <= r) return d[p];
  int m = (s + t) / 2;
  if (b[p]) {
    d[p * 2] += b[p] * (m - s + 1), d[p * 2 + 1] += b[p] * (t - m),
        b[p * 2] += b[p], b[p * 2 + 1] += b[p];
    b[p] = 0;
  }
  int sum = 0;
  if (l <= m) sum = getsum(l, r, s, m, p * 2);
  if (r > m) sum += getsum(l, r, m + 1, t, p * 2 + 1);
  return sum;
}

bool cmp(const pair<int,int>&a,const pair<int,int>&b)
{
    if(a.second!=b.second) return a.second>b.second;
    return a.first < b.first;
}

int main()
{
    scanf("%d",&n);
    int x,y;
    for(int i=0;i<n;++i){
        scanf("%d%d",&x,&y);
        point[i].first = x;point[i].second = y;
        xmp.push_back(x);
    }
    sort(point,point+n,cmp);
    sort(xmp.begin(),xmp.end());


    p2m[0]=1;
    for(int i=1;i<=n;++i)
        p2m[i]=p2m[i-1]*2%mod;

    build(1,n,1);
    long long ans = 0;
    for(int i=1;i<=n;++i){
        int ind = i-1;
        //cout << xti[point[ind].first] << endl;
        int ti = lower_bound(xmp.begin(),xmp.end(),point[ind].first)-xmp.begin()+1;
        int z1=getsum(1,ti,1,n,1);
        int z2 = ti-1 - z1;
        int z3 = i-1-z1;
        int z4 = n-1-z1-z2-z3;
        ans+=p2m[n-1];ans%=mod;
        ans+=((p2m[z1]-1)*(p2m[z4]-1)%mod*((p2m[z2]-1)+(p2m[z3]-1)+1))%mod+
        (p2m[z2]-1)*(p2m[z3]-1)%mod*((p2m[z1]-1)+(p2m[z4]-1)+1)%mod
        +(p2m[z1]-1)*(p2m[z4]-1)%mod*(p2m[z2]-1)%mod*(p2m[z3]-1)%mod;
        ans%=mod;
        update(ti,ti,1,1,n,1);
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 13044
n = int(input())
b = list(map(int, input().split()))
a = []
while n > 0:
    x = -1
    for i in range(n):
        if b[i] == i + 1:
            x = i
    if not x == -1:
        b.pop(x)
        a.append(x + 1)
    else:
        print(-1)
        exit()
    n -= 1
a.reverse()
for i in a:
    print(i)

Measured memory_bytes: 9160
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
typedef long long LL;
#define FOR(i, a, b) for(LL i=(LL)(a);i<(LL)(b);i++)
#define REP(i,x) for(LL i=0;i<(LL)(x);i++)

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

    int N, M;
    cin >> N >> M;

    map<int, int> num;
    REP(i, M)
    {
        int s, c;
        cin >> s >> c;

        if(num.count(s))
        {
        // キーが有る
            // 桁が矛盾
            if(num.at(s) != c)
            {
                cout << -1 << endl;
                return 0;
            }
        }
        else
        {
        // キーがない
            num.emplace(s, c);
        }
        
    }

    // 縛りなし
    if(M == 0)
    {
        if(N==1)
          cout << 0 << endl;
        else
          cout << pow(10, N-1) << endl;
        return 0;
    }

    // 1桁じゃないのに最上位桁の値が0
    if(N > 1 && num.count(1) && num.at(1) == 0)
    {
        cout << -1 << endl;
        return 0;
    }

    string S(N, '0');
    // 最上位の桁
    char digit1 = '0';
    if(num.count(1))
    {
        digit1 += num.at(1);
    }
    else
    {
        digit1 = '1';
    }
    S.at(0) = digit1;

    // 2番目の桁
    char digit2 = '0';
    if(N > 1)
    {
        if(num.count(2) && num.at(2))
        {
            digit2 += num.at(2);
        }
        S.at(1) = digit2;
    }

    // 3番目の桁
    char digit3 = '0';
    if(N > 2)
    {
        if(num.count(3) && num.at(3))
        {
            digit3 += num.at(3);
        }
        S.at(2) = digit3;
    }

    cout << S << endl;
    return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::{Ordering};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};

#[allow(unused_imports)]
use std::iter::FromIterator;

#[allow(unused_macros)]
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::min($x, min!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::max($x, max!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! get { 
    ([$t: ty]) => { 
        { 
            let mut line = String::new(); 
            stdin().read_line(&mut line).unwrap(); 
            line.split_whitespace().map(|t|t.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    };
    ([$t: ty];$n: expr) => {
        (0..$n).map(|_|get!([$t])).collect::<Vec<_>>()
    };
    ($t: ty) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t: ty),*) => {
        { 
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
    ($t: ty; $n: expr) => {
        (0..$n).map(|_|get!($t)).collect::<Vec<_>>()
    };
    ($($t: ty),*; $n: expr) => {
        (0..$n).map(|_|get!($($t),*)).collect::<Vec<_>>()
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

const BIG_STACK_SIZE: bool = true;

#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

fn solve() {
    let r = get!(usize);
    println!("{}", 3*r*r);
}


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

#define pb push_back
#define ll long long
#define maxn 300005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i));
#define ms1(i) memset(i,-1,sizeof(i));
#define bg begin()
#define ed end()
#define pii pair<int,int>

int main(){
	int n,k;
	while(cin >> n >> k){
		cout<<n-k+1<<endl;
	}
}

Measured memory_bytes: 256
while True:
    tmp=input().split(" ")
    if tmp[1]=="?":
        break
    if tmp[1]=="+":
        print(int(tmp[0])+int(tmp[2]))
    if tmp[1]=="-":
        print(int(tmp[0])-int(tmp[2]))
    if tmp[1]=="*":
        print(int(tmp[0])*int(tmp[2]))
    if tmp[1]=="/":
        print(int(tmp[0])//int(tmp[2]))


Measured memory_bytes: 5600
#include<iostream>
#include<algorithm>
using namespace std;
int a[26];
int main(){
    string s;
    cin>>s;
    for(int i=0;i<26;i++) a[i]=0;
    sort(s.begin(),s.end());
    int d=s.length();
    for(int i=0;i<d;i++){
        a[s[i]-'a']++;
    }
    int flag=0;
    for(int i=0;i<=s[d-1]-'a';i++){
        if(a[i]%2!=0){
            flag++;
            break;
        }
    }
    if(flag>0) cout<<"No";
    else cout<<"Yes";
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int x,y,k=0;
	scanf("%d%d",&x,&y);
	for(int i=0;i<=x;i++){//4
		for(int j=0;j<=x-i;j++){//2
			if(y-(4*i+2*j) == 0){
				if(i+j == x){
					printf("Yes");
					k++;
					break;
				}
			}
		}
		if(k!=0){
			break;
		}
	}
	if(k==0){
		printf("No");
	}
}

Measured memory_bytes: 1732
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)

typedef int long long ll;
using namespace std;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll MOD=1e9+7;
static const int MAX = 100;
static const int INF = (1<<23);
template<class T> T gcd(T a, T b){return b? gcd(b,a%b) : a;}
template<class T> T lcm(T a,T b){return a / gcd(a,b)*b;}

int main(){


    ll a;
    string b;
    cin>>a>>b;
  ll aa= a;
  ll bb=0;
  rep(i,b.size()){
      if(b[i]!='.'){
          bb*=10;
          bb+=b[i]-'0';
      }
  }


   ll ab = aa*bb;
 //  cout<<ab<<endl;
   ll ans = ab/100;

    cout<<ans<<endl;
return 0;
}


Measured memory_bytes: 3624
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<set>
using namespace std;
int gcd(int a, int b) {
	int c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}
	return b;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};
typedef long long ll;

const ll M = 1000000007;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)

ll mpow(ll x, ll n) {
	ll ans = 1;
	while (n != 0) {
		if (n & 1) ans = ans * x % M;
		x = x * x % M;
		n = n >> 1;
	}
	return ans;
}

ll comb(ll a, ll b) {
	if (a == 0 && b == 0)return 1;
	if (a < b || a < 0)return 0;
	ll tmp = ifac[a - b] * ifac[b] % M;
	return tmp * fac[a] % M;
}
int main() {
	ll n, m, i, a, b, c, ans = 0;
	cin >> n >> m;
	vector<pair<ll, ll>> p(n + m);
	for (i = 0; i < n; i++) {
		cin >> a;
		p[i] = make_pair(a, 1);
	}
	for (i = 0; i < m; i++) {
		cin >> b >> c;
		p[i + n] = make_pair(c, b);
	}
	sort(p.begin(), p.end());
	for (i = n + m - 1; n > 0; i--) {
		if (p[i].second > n) {
			ans += p[i].first*n;
			n = 0;
		}
		else {
			ans += p[i].first*p[i].second;
			n -= p[i].second;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 8064
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;

int n, q;
bool exi[100000];
void solve() {
	cin >> n >> q;exi[1] = true;
	int loc = 0;
	rep(i, q) {
		int a, b; cin >> a >> b; a--; b--;
		if (loc == a) {
			loc = b;
		}
		else if (loc == b)loc = a;
		swap(exi[a], exi[b]);
		if (loc > 0) {
			exi[loc - 1] = true;
		}
		if (loc < n - 1)exi[loc + 1] = true;
	}
	exi[loc] = true;
	int cnt = 0;
	rep(i, n) {
		if (exi[i])cnt++;
	}
	cout << cnt << endl;
}
int main() {
	solve();
	//stop
	return 0;
}

Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main()
{
    long long n,a,b;
    cin>>n>>a>>b;
    if((n>1&&b>=a)||(n==1&&a==b))
    cout<<(b-a)*(n-2)+1<<endl;
    else
    cout<<"0\n";
    return 0;
}

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

using namespace std;

int main() {
	string s;

	cin >> s;

	map <string, int> season;

	season["SSS"] = 0;
	season["SSR"] = 1;
	season["SRS"] = 1;
	season["SRR"] = 2;
	season["RSS"] = 1;
	season["RSR"] = 1;
	season["RRS"] = 2;
	season["RRR"] = 3;

	cout << season[s] << "\n";

	return 0;
}

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

typedef long long int64;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

int main() {
  string S, T;
  std::cin >> S >> T;

  int count = 0;
  REP(i, S.size()) {
    if (S[i] != T[i])
      count++;
  }
  std::cout << count << std::endl;
  return 0;
}


Measured memory_bytes: 3904
#include<cstdio>
using namespace std;
inline char tc(void){
	static char fl[10000],*A=fl,*B=fl;
	return A==B&&(B=(A=fl)+fread(fl,1,10000,stdin),A==B)?EOF:*A++;
}
inline int read(void){
	int a=0;static char c;
	while((c=tc())<'0'||c>'9');
	while(c>='0'&&c<='9')a=a*10+c-'0',c=tc();
	return a;
}
int n,s[10001];
int main(void){
	register int i,j,x;
	n=read(),s[0]=1;
	for(i=1;i<=n;++i){
		x=read();
		for(j=10000-x;j>=0;--j)	
			if(s[j])s[j+x]=1;
	}
	for(i=10000;i;--i)
		if(s[i]&&i%10){
			printf("%d\n",i);
			return 0;
		}
	puts("0");
	return 0;
}

Measured memory_bytes: 256