akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
//using P = pair<double, double>;
using edge = struct {int to; ll cost;};

#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(a) (a).begin(), (a).end()

const int di[] = {-1, 0, 1, 0, 1, 1, -1, -1};
const int dj[] = {0, -1, 0, 1, 1, -1, 1, -1};
const int INF = 1e9+100;
const ll INF64 = 7e18l;
const int mod = 1000000007;

struct prime
{
  vector<bool> num;
  prime(int n) : num(n+1, true)
  {
    num[0] = false;
    num[1] = false;
    for(int i = 2; i <= n; i++) {
      if(num[i]) {
        for(int j = 2; i*j <= n; j++) num[i*j] = false;
      }
    }
  }
  bool isPrime(int x)
  {
    return num[x];
  }
};
struct UnionFind {
    vector<int> par;
    UnionFind(int N) : par(N) {
        for(int i = 0; i < N; i++) par[i] = i;
    }
    int root(int x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }
    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }
    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};
struct combination
{
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1)
  {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i)
      fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i)
      ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k)
  {
    if (k < 0 || k > n)
      return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
};

long long gcd(long long a, long long b)
{
  if (a < b)
    swap(a, b);
  while (true)
  {
    if (a % b == 0ll)
      break;
    ll _a = a;
    a = b;
    b = _a % b;
  }
  return b;
}

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

void solve()
{
  int a, b;
  cin >> a >> b;
  cout << max(a+b,max(a-b, a*b)) << "\n";
}

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


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

int main() {
  int n, l;
  cin >> n >> l;
  vector<string> s(n);
  for(int i = 0; i < n; i++)
    cin >> s.at(i);
  
  sort(s.begin(), s.end());
  
  string ans;
  for(int i = 0; i < n; i++)
    ans += s.at(i);
    
  cout << ans << endl;
}

Measured memory_bytes: 256
# ABCpana_B.py
from math import ceil
h,w=map(int,input().split())
# print(ceil(4/2))
if h==1:
    print(1)
    exit()
if w==1:
    print(1)
    exit()

if w%2==0:
    print(h*(w//2))
else:
    print(h*(w//2)+int(ceil(h/2)))


Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>

using namespace std;

#define ll long long
#define ld long double
#define EPS 1e-9
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}


signed main(void) {
    string s;
    cin >> s;
    if(s == "Sunny")cout << "Cloudy" << endl;
    if(s == "Rainy")cout << "Sunny" << endl;
    if(s == "Cloudy")cout << "Rainy" << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,D,X;cin>>N>>D>>X;
  vector<int> A(N);
  for(int i=0;i<N;i++)cin>>A[i];
  for(int i=0; i<D; i++){
    for(int j=0; j<N; j++){
      if(i%A[j]==0)X++;
    }
  }
  cout<<X<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<set>
#include<algorithm>
#include<cmath>
#include<stack>
#include<math.h>
#include<queue>
#define mem(x) memset(x,0,sizeof(x)) 
#define sca(x) scanf("%d",&x)
#define scaa(x,y) scanf("%d%d",&x,&y)
#define prt(x) printf("%d\n",x)
#define inf 0x7f7f7f7f
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#pragma GCC optimize(2)
using namespace std;
const double pi=acos(-1); 
const double eps=1e-10;
typedef pair<long,long> pll;
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<string,string> pcc;
typedef pair<double,double> pbb;
map<int,int> m;
int main()
{
	int k;
	sca(k);
	if(k%10==1||k%10==7||k%10==3||k%10==9)
	{
		int x=0,shi=1,ans=-1;
		for(int i=1;i<=k+5;i++)
		{
			x=(x+7*shi)%k;
			if(m[x]==0)
			m[x]=i;
			else
			{
				ans=i-m[x];
				break;
			}
			shi=(shi*10)%k;
		}
		prt(ans);
	}
	else
	printf("-1\n");
}

Measured memory_bytes: 50588
#include<bits/stdc++.h>
using namespace std;
#define mem(a) memset(a,0,sizeof(a))
#define ll long long
int c(int a)
{
	if(a<2)return 0;
	return a*(a-1)/2;
 } 
int main()
{
	int n,m;
	cin>>n>>m;
	cout<<c(n)+c(m);
	return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (a, b, h, m) = readLine()!!.split(' ').map { it.toDouble() }

    // 短針 1分0.5度
    val sd = (h*30 + m*0.5) * Math.PI/180
    val sx = Math.sin(sd) * a
    val sy = Math.cos(sd) * a

    // 長針 1分6度
    val ld = m*6 * Math.PI/180
    val lx = Math.sin(ld) * b
    val ly = Math.cos(ld) * b


    println("%.20f".format(Math.sqrt(Math.pow(sx-lx,2.0) + Math.pow(sy-ly,2.0))))

}


Measured memory_bytes: 37720
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    char[] array = sc.next().toCharArray();

    array[k-1] += 32;

    System.out.println(array);



  }

}

Measured memory_bytes: 21716
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(n)]

a.sort(reverse=True)
b.sort()
idxb = list()
for i in range(n):
    idx = -1
    miny = 1e+9
    for j in range(n):
        if not j in idxb:
            if a[i][0] < b[j][0] and a[i][1] < b[j][1] < miny:
                miny = b[j][1]
                idx = j
    if idx != -1:
        idxb.append(idx)

print(len(idxb))





Measured memory_bytes: 39280
#include <bits/stdc++.h>
using namespace std;
// nichijou
#define REP(i,a,b) for (int i(a), _B(b); i < _B; ++i)
#define RP(i,n) REP(i,0,n)
#define PER(i,a,b) for(int i((a)-1), _B(b); i >= _B; --i)
#define PR(i,n) PER(i,n,0)
#define REP1(i,a,b) REP(i,a,(b)+1)
#define RP1(i,n) REP1(i,1,n)
#define PER1(i,a,b) PER(i,(a)+1,b)
#define PR1(i,n) PER1(i,n,1)
#define DO(n) REP(__i,0,n)
template<typename T>
void cmax(T & a, T b) {a = max(a, b);}
template<typename T>
void cmin(T & a, T b) {a = min(a, b);}

// data type
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define F first
#define S second

// STL container
typedef vector<int> vi;
typedef vector<ll> vll;
#define SZ(a) ((int)a.size())
#define ALL(a) a.begin(), a.end()
#define CLR(a) a.clear()
#define BK(a) (a.back())
#define FT(a) (a.front())
#define DB(a) a.pop_back()
#define DF(a) a.pop_front()
#define PB push_back
#define EB emplace_back

/* I gave you my heart and then you turned around. */
void _BG(const char * s) {}
template<typename T, typename ... TT>
void _BG(const char * s,T a, TT...b)
{
	for (int c = 0; *s && (c || *s != ','); ++s) {
		cerr<<*s;
		switch (*s) {
		case '(':
		case '[':
		case '{':
			++c;
			break;
		case ')':
		case ']':
		case '}':
			--c;
			break;
		}
	}
	cerr<<" = "<<a;
	if (*s) {
		cerr<<", ";
		_BG(++s,b...);
	} else
		cerr<<endl;
}
#define BG(...) do { \
	cerr << __PRETTY_FUNCTION__ << ':' << __LINE__ << ": "; \
	_BG(#__VA_ARGS__,__VA_ARGS__); \
} while(0)

/* Reading input is now 20% cooler! */
bool RD(void) {return true;}
bool RD(char & a) {return scanf(" %c", &a) == 1;}
bool RD(char * a) {return scanf("%s", a) == 1;}
bool RD(double & a) {return scanf("%lf", &a) == 1;}
bool RD(int & a) {return scanf("%d", &a) == 1;}
bool RD(ll & a) {return scanf("%lld", &a) == 1;}

template<typename T, typename ... TT>
bool RD(T & a, TT & ...  b) {return RD(a) && RD(b...);}

/* Do princesses dream of magic sheep? */
#define RI(a) int a; RD(a)
#define RII(a,b) RI(a); RI(b)
#define RIII(a,b,c) RI(a); RII(b,c)
#define RIIII(a,b,c,d) RI(a); RIII(b,c,d)

/* For it's time for you to fulfill your output. */
void PT(const char a) {putchar(a);}
void PT(const char * a) {fputs(a, stdout);}
void PT(char * a) {fputs(a, stdout);}
void PT(const double a) {printf("%.16f", a);}
void PT(const int a) {printf("%d", a);}
void PT(const ll a) {printf("%lld", a);}

/* The line will last forever! */
template<char sep = ' ',char end = '\n'>
void PL(void) {if (end) PT(end);}
template<char sep = ' ',char end = '\n',typename T, typename ... TT>
void PL(const T a, const TT ...  b) {PT(a); if (sizeof...(b) && sep) PT(sep); PL<sep,end>(b...);}

/* Good Luck && Have Fun ! */
const int N = 2e5 + 87;
ll a[N];
int main()
{
	RI(n);
	RP1(i,n) RD(a[i]), a[i] += a[i-1];
	ll ans = abs(a[n] - a[1] * 2);
	REP1(i,2,n-1)
		ans = min(ans, abs(a[n] - a[i] * 2));
	PL(ans);
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int A, B, T;
	cin >> A >> B >> T;

	cout << B * (T / A) << endl;
}

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

int main(){
    int N, K;
    cin >> N >> K;
    vi x(N);
    rep(i, N) cin >> x[i];

    int sum = 0;
    rep(i, N){
        sum += min(x[i], K - x[i]);
    }

    cout << sum*2 << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main(){
    int a, b, c, sum;
    std::cin >> a >> b >> c >> sum;
    
    int count = 0;
    
    int max_A = (sum / 500 < a) ? sum / 500 : a;
    for(int i = 0; i < max_A + 1; i++){
        int sum_second =  sum - i * 500;
        int max_B = (sum_second / 100 < b) ? sum_second / 100 : b;
        for(int j = 0; j < max_B + 1; j++){
            int sum_third =  sum_second - j * 100;
            if(sum_third <= 50 * c){
                count++;
            }
        }
    }
    
    std::cout << count;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr double INFD = 1e100;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
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; }
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
// ---------------------------------------------------------------------------

// snukeさんのmodint
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

// mint N;
//cout << N.x << endl;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N,K;
    cin >> N >> K;
    vector<mint> cnt(K+1);
    for(int i=K; i>=1; i--){
        cnt[i] = K/i;
        cnt[i] = cnt[i].pow(N);
        ll temp = i*2;
        while(temp <= K){
            cnt[i] -= cnt[temp];
            temp += i;
        }
    }
    mint ans = 0;
    for(int i=1; i<=K; i++){
        ans += cnt[i] * mint(i);
    }
    cout << ans.x << enld;
    return 0;
}

Measured memory_bytes: 3960
type tree = Nil | Node of int * tree * tree

let create () = Nil

let insert x t =
  let rec doit t id = match t with
    | Nil -> id (Node (x, Nil, Nil))
    | Node (y, l, r) ->
      if x < y then doit l (fun a -> id (Node (y, a, r)))
      else doit r (fun b -> id (Node (y, l, b))) in
  doit t (fun i -> i)

let preorder f t =
  let rec doit = function
    | Nil -> ()
    | Node (x, l, r) -> f x; doit l; doit r in
  doit t

let inorder f t =
  let rec doit = function
    | Nil -> ()
    | Node (x, l, r) -> doit l; f x; doit r in
  doit t

let print t =
  inorder (fun e -> print_string " "; print_int e) t;
  print_newline ();
  preorder (fun e -> print_string " "; print_int e) t;
  print_newline ()

let split_on_char sep s =
  let open String in
  let r = ref [] in
  let j = ref (length s) in
  for i = length s - 1 downto 0 do
    if get s i = sep then begin
      r := sub s (i + 1) (!j - i - 1) :: !r;
      j := i
    end
  done;
  sub s 0 !j :: !r

let () =
  let m = read_int () in
  let t = ref (create ()) in
  for _ = 0 to m - 1 do
    match read_line () |> split_on_char ' ' with
    | ["insert"; n] -> t := insert (int_of_string n) !t
    | _ -> print !t
  done

Measured memory_bytes: 33360
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>

#define N_MAX 200000
#define MODVAL 1000000007

int main(void){

	long long int n[1001];
	long long int x;
	long long int i,j;
	long long int p,m;
	int max = 1000;
	for(i=0;i<max;i++){
		n[i] = i * i;
		n[i] = n[i] % MODVAL;
		n[i] *= i;
		n[i] = n[i] % MODVAL;
		n[i] *= i;
		n[i] = n[i] % MODVAL;
		n[i] *= i;
		n[i] = n[i] % MODVAL;
	}

	scanf("%lld",&x);

	for(i=0;i<max;i++){
		for(j=0;j<max;j++){
			p = n[i] + n[j];
			m = n[i] - n[j];
			if(m<0){
				m+= MODVAL;
			}
			if(x == p){
				printf("%lld %lld\n",i,-j);
				return 0;
			}
			if(x == m){
				printf("%lld %lld\n",i,j);
				return 0;
			}
		}
	}


	return 0;
}


Measured memory_bytes: 1740
#include <stdio.h>
#include <string.h>

#define MAX 100005

typedef struct Task {
  char name[100];
  int t;
} TASK;

TASK task[MAX];
int head, tail, n;

void enqueue(TASK x) {
  task[tail] = x;
  tail = (tail + 1) % MAX;
}

TASK dequeue() {
  TASK x = task[head];
  head = (head + 1) % MAX;
  return x;
}

int min(int a, int b) {
  return (a > b) ? b : a;
}

int main(void) {
  int elaps = 0, c;
  int i, q;
  TASK u;
  scanf("%d %d", &n, &q);

  for (i = 1; i <= n; i++) {
    scanf("%s", task[i].name);
    scanf("%d", &task[i].t);
  }
  head = 1;
  tail = n + 1;

  while (head != tail) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    elaps += c;
    if (u.t > 0) {
      enqueue(u);
    } else {
      printf("%s %d\n", u.name, elaps);
    }
  }
  return 0;
}

Measured memory_bytes: 10756
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

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

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<62)           //1LL<<63でオーバーフロー

int main(int argc,char* argv[]){
    int n;
    cin >> n;

    vector<int> f(n,0);

    int x,y,z;
    for(x=1;x<100;x++){
        for(y=1;y<100;y++){
            for(z=1;z<100;z++){
                if(((x+y)*(x+y)+(y+z)*(y+z)+(z+x)*(z+x))%2!=0)continue;
                int fans;
                fans=((x+y)*(x+y)+(y+z)*(y+z)+(z+x)*(z+x))/2;
                if(fans>n)continue;
                f.at(fans-1)++;
            }
        }
    }

    for(int i=0;i<n;i++){
        cout << f.at(i) << endl;
    }

    return 0;
}


Measured memory_bytes: 3592
#include<stdio.h>
#define N 200000

int main()
{
  int R[N];
  int i,n,maxv,minv;

  scanf("%d",&n);

  for(i = 0 ; i < n ; i++){
    scanf("%d",&R[i]);
  }
  maxv = R[1]-R[0];
  minv = R[0];

  for(i = 1 ; i < n ; i++){

    if(maxv < R[i]-minv) maxv = R[i]-minv;

    if(minv > R[i]) minv = R[i];
  }

  printf("%d\n",maxv);

  return 0;
} 

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

const int mxN = 4e2 + 2;
long long n, nums[mxN], dp[mxN][mxN];

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> nums[i];

    for (int len = 2; len <= n; len++)
    {
        for (int i = 0; i <= n - len; i++)
        {
            long long s = 0;
            for (int j = i; j < i + len; j++)
            {
                s += nums[j];
            }
            long long ret = 1e15;
            for (int sp = 1; sp <= len - 1; sp++)
            {
                ret = min(ret, dp[i][sp] + dp[i + sp][len - sp]);
            }
            dp[i][len] = ret + s;
        }
    }

    cout << dp[0][n] << endl;
}

Measured memory_bytes: 4812
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int D = sc.nextInt();
    int N = sc.nextInt();
    if (D == 0) {
      if (N != 100) {
        System.out.println(N);
      } else {
        System.out.println(N+1);
      }
    }
    if (D == 1) {
      if (N != 100) {
        System.out.println(N * 100);
      } else {
        System.out.println(N * 100 +100);
      }
    } 
    if (D == 2) {
      if (N != 100) {
        System.out.println(N * 10000);
      } else {
        System.out.println(N * 10000 + 10000);
      }
    }
  }
}

Measured memory_bytes: 22868
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define deb(a) cout << a << ": "
using namespace std;
const int inf = 1e18 + 7;
const int N = 1e6 + 7;
const int md = 1e9 + 7;
void sliczny() {
  int a;
  cin >> a;
  int ans = a + a*a + a*a*a;
  cout << ans << '\n';
}

int32_t main() 
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  //cin >> T; 
  for(int t = 1; t <= T; t++) {
    //cout << "Case #" << t << ": ";
    sliczny();
  }
  return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    string S;
    cin >> S;
    if (count(S.begin(), S.end(), '9')) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
import itertools
n = int(input())
a = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]
for _ in range(n):
    b, f, r, v = map(int, input().split())
    a[b-1][f-1][r-1] += v
for b in range(4):
    for f in range(3):
        for r in range(10):
            print('', a[b][f][r], end="")
        print() 
    if b < 3:
        print("#"*20)

Measured memory_bytes: 7848
import java.util.*;

public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int K = scanner.nextInt();

        // K * Kの最大公約数を出しておくマップ
        int[][] gmap = new int[K][K];

        for (int i = 0; i < K; i++) {
            for (int j = 0; j < K; j++) {
                gmap[i][j] = gcd(i + 1, j + 1);
            }
        }

        // GCD, 個数
        int[] rightGcdMap = new int[K];

        for (int i = 1; i <= K; i++) {
            for (int j = 1; j <= K; j++) {
                int gcd = gcd(i, j);

                rightGcdMap[gcd - 1]++;
            }
        }

        int[] leftGcdMap = new int[K];
        for (int i = 1; i <= K; i++) {
            for (int j = 1; j <= K; j++) {
                int gcd = gcd(i, j);

                leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];
            }
        }


        System.out.println(Arrays.stream(leftGcdMap).sum());
    }

    private static int gcd(int m, int n) {
        if(m < n) return gcd(n, m);
        if(n == 0) return m;
        return gcd(n, m % n);
    }
}


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

int main() {
    int n[140];

    int tail = -1;
    string s;
    while (cin >> s) {
        if (s == "+") {
            int a = n[tail--];
            int b = n[tail--];

            n[++tail] = a + b;
        } else if (s == "-") {
            int b = n[tail--];
            int a = n[tail--];

            n[++tail] = a - b;
        } else if (s == "*") {
            int b = n[tail--];
            int a = n[tail--];

            n[++tail] = a * b;
        } else {
            n[++tail] = atoi(s.c_str());
        }
    }

    cout << n[tail] << endl;

    return 0;
}


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

typedef long long ll;

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

    vector<int> a(3);
    cin >> a[0] >> a[1] >> a[2];
    sort(a.begin(),a.end());
    for(int i=0;i<3;i++){
        if(i<2) cout << a[i] << ' ';
        else cout << a[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3136
import std;

auto input()
{
    return readln().chomp();
}

alias sread = () => readln.chomp();

void main()
{
    long h, m;
    scan(h, m);
    auto s = new string[](h);
    foreach (i; 0 .. h)
    {
        s[i] = sread();
    }
    //writeln(s);
    foreach (i; 0 .. h)
    {
        foreach (j; 0 .. m)
        {
            if (s[i][j] == '#')
            {
                if ((i != 0 && s[i - 1][j] == '#') || (i != h - 1
                        && s[i + 1][j] == '#') || (j != 0 && s[i][j - 1] == '#')
                        || (j != m - 1 && s[i][j + 1] == '#'))
                {
                    continue;
                }
                writeln("No");
                return;
            }
        }
    }
    writeln("Yes");

}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}


Measured memory_bytes: 3672
#include <math.h>
#include <stdio.h>
#include <string.h>

#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

constexpr long long INFLL = 1e18;

using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int a;
  cin >> a;
  if (a == 1) {
    cout << 0 << endl;
  } else {
    cout << 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 3192
//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll
 
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define pi acos(-1.0)
/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second*/
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)


int main()
{

    int X,Y,x1,x2;

    cin>>X>>Y;

    if(!((4*X-Y)%2))
    {
        x1 = (4*X-Y)/2;
        x2 = X-x1;

        if(x1>=0 && x2>=0){
            cout<<"Yes\n";
            return 0;
        }

    }

    cout<<"No\n";


    return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
long long a[200005];
long long k;int n;
int f(long long mid)
{
	//?t¡¤?¦Ì??¨°¨®D?¨¤¨¦¨´??????D?¨®¨²x¡ê?
	long long b;long long ans=0;
	for(int i=1;i<n;i++)
	{
		b=a[i];
		if(b==0)
		{
			if(mid>0)
			{
				ans+=n-i;
			}
		}
		else if(b>0)
		{
			if(mid>0)
			{
				if(mid%b==0)//??3y¨¢?
				{
					int pos1=lower_bound(a+1,a+1+n,mid/b)-(a);
					if(pos1-i-1>0)ans+=pos1-i-1;
				}
				else//????3y
				{
					int pos1=lower_bound(a+1,a+1+n,mid/b+1)-(a);
					if(pos1-i-1>0)ans+=pos1-i-1;
				}
			}
			else if(mid==0)
			{
				int pos1=lower_bound(a+1,a+1+n,0)-a;
				if(pos1-i-1>0)ans+=pos1-i-1;
			}
			else if(mid<0)
			{
				int pos1=lower_bound(a+1,a+1+n,mid/b)-(a);
				if(pos1-i-1>0)ans+=pos1-i-1;
			}
		}
		else if(b<0)
		{
			if(mid>0)
			{
				if(mid%(-b)==0)//??3y¨¢?
				{
					int pos1=lower_bound(a+1,a+1+n,mid/b+1)-(a);
					if(min(n-i,n-pos1+1)>0)ans+=min(n-i,n-pos1+1);
				}
				else//????3y
				{
					int pos1=lower_bound(a+1,a+1+n,mid/b)-(a);
					if(min(n-i,n-pos1+1)>0)ans+=min(n-i,n-pos1+1);
				}
			}
			else if(mid==0)
			{
				int pos1=lower_bound(a+1,a+1+n,1)-a;
				if(min(n-i,n-pos1+1)>0)ans+=min(n-i,n-pos1+1);
			}
			else if(mid<0)
			{
				if((-mid)%(-b)==0)//??3y¨¢?
				{
					int pos1=lower_bound(a+1,a+1+n,mid/b+1)-(a);
					if(min(n-i,n-pos1+1)>0)ans+=min(n-i,n-pos1+1);
				}
				else//????3y
				{
					int pos1=lower_bound(a+1,a+1+n,mid/b+1)-(a);
					if(min(n-i,n-pos1+1)>0)ans+=min(n-i,n-pos1+1);
				}
			}
		}
	}
	if(ans>k-1)
	{
		return 1;
	}
	if(ans==k-1)return 0;
	if(ans<k-1)
	{
		return -1;
	}
}
int main()
{
	long long t;scanf("%d%lld",&n,&k);
	for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
	sort(a+1,a+1+n);
	//?t¡¤?¡äe¡ã?
	long long l=-1e18;long long r=1e18;long long mid;
	while(l<r)
	{
		mid=(l+r)/2;
		t=f(mid);
		if(t==0)
		{
			//cout<<l<<' '<<mid<<' '<<r<<endl;
			break;
		}
		else if(t<0)l=mid+1;
		else if(t>0)r=mid;
	}
	l=mid;
	while(l<r)
	{
		mid=l+(r-l)/2;
		if(f(mid))r=mid;
		else l=mid+1;
	}
	printf("%lld",l-1);
}


Measured memory_bytes: 1792
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve(args);
    }

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        int a = scanner.nextInt();
        String s = scanner.next();

        int max = 0;
        String bef;
        String aft;

        for (int i = 0;i<a;i++) {
        	bef = s.substring(0, i+1);
        	aft = s.substring(i+1,s.length());
        	int cnt = 0;

        	String[] bef2 = bef.split("");
        	Set<String> hash_set = new HashSet<String>();
        	/*
        	for(String tmp : bef2) {
        		hash_set.add(tmp);
        	}
        	*/
        	for(int j=0;j<bef2.length;j++) {
        		hash_set.add(bef2[j]);
        	}
        	/*
        	for(String tmp : hash_set){
        		if(aft.contains(tmp)) {
        			cnt++;
        		}
        	}
        	*/
        	Iterator<String> iterator = hash_set.iterator();
        	for (int k=0;k<hash_set.size();k++) {
        		if(aft.contains(iterator.next())) {
        			cnt++;
        		}
        	}
        	if (cnt >= max) {
        		max = cnt;
        	}
        }
        System.out.println(max);

    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {line = br.readLine();}
                s = line.split(reg, 0);
                i = 0;return s[i++];
            } catch (Exception e) {e.printStackTrace();}
            return null;
        }
        public int nextInt() {
            try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public double nextDouble() {
            try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public long nextLong()  {
            try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
    }
}


Measured memory_bytes: 22096
#include <stdio.h>
 
int main(void)
{
int i,w=0;
int a=0;
 
char s[1000]={};
 
scanf("%s",s);
scanf("%d",&w);

while(s[a]>='a'&& s[a]<='z'){
printf("%c",s[a]);
a = a + w;
}

printf("\n");
 
	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
int main(void)
{
	int a,b,c,d,flg;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	flg=0;
	if(a==b&&a==c&&a==d) flg=1;
	else if(a==b&&c==d) flg=1;
	else if(a==c&&b==d) flg=1;
	else if(a==d&&b==c) flg=1;
	if(flg!=0) printf("yes\n");
	else printf("no\n");
	return 0;
}	

Measured memory_bytes: 2588
import java.util.*;
	import java.lang.Math;
    public class Main
	{
		public static void main(String args[])
		{
			Scanner scan = new Scanner(System.in);
			int n = scan.nextInt();
			int[] a = new int[n];
			for(int i=0;i<n;i++)
			{
				a[i]=scan.nextInt();
			}
			int max=Integer.MAX_VALUE;
			int temp=0;
			for(int i=1; i<=100; i++)
			{
				temp=0;
				for(int j=0; j<n; j++)
				{
					temp+=(i-a[j])*(i-a[j]);
				}
            max=Math.min(max,temp);
			}
			System.out.println(max);
		}
    }

Measured memory_bytes: 21972
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;

#define ALLOC(size,type) ((type*)calloc((size),sizeof(type)))

void run (void) {
  i32 n;
  scanf ("%" SCNi32, &n);
  i32 *a = ALLOC (n + 1, i32);
  for (i32 i = 1; i <= n; ++i) {
    scanf ("%" SCNi32, a + i);
  }
  i32 m = 0;
  i32 *b = ALLOC (n + 1, i32);
  for (i32 i = n; i >= 1; --i) {
    i32 cnt = 0;
    for (i32 j = 2 * i; j <= n; j += i) {
      cnt ^= b[j];
    }
    b[i] = a[i] ^ cnt;
    m += b[i];
  }
  printf ("%" PRIi32 "\n", m);
  if (m == 0) return;
  for (i32 i = 1; i <= n; ++i) {
    if (b[i] > 0) {
      printf ("%" PRIi32 " ", i);
    }
  }
  puts ("");
}

int main (void) {
  run();
  return 0;
}


Measured memory_bytes: 2432
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>
#include <iomanip>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

int main() {
    ll N;
    cin >> N;
    vector<double> p(N);
    for(int i=0;i<N;i++) cin >> p[i];
    //dp[i][j]:i番目(0-indexed)まででj回表が出る.
    vector<vector<double>> dp(N+10,vector<double>(N+10));

    dp[0][0]=1-p[0];
    dp[0][1]=p[0];
    for(int i=1;i<N;i++){
        for(int j=0;j<=i+1;j++){
            dp[i][j]=dp[i-1][j]*(1-p[i]);
            if(j!=0)dp[i][j]+=dp[i-1][j-1]*p[i];
        }
    }
    double ans=0;
    for(int i=N/2+1;i<=N;i++){
        ans+=dp[N-1][i];
    }

    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}

Measured memory_bytes: 71168
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repR(i, n) for(int i = (n) - 1; i > -1; i--)
#define rep1(i, n) for(int i = 1; i < (int)(n + 1); i++)
#define rep1R(i, n) for(int i = (n); i > 0; i--)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main() {
  int A, B; cin >> A >> B;
  cout << max({A + B, A - B, A * B}) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <stdio.h>
#include <queue>
#include <cmath>
#include <utility>
#include <map>
#include <functional>

using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)




int main() {
	int i;
	int N;
	cin >> N;
	vector<int> A;
	vector<int> B;
	rep(i, 0, N) {
		int t;
		cin >> t;
		A.push_back(t);
		B.push_back(t);
	}
	sort(A.begin(),A.end());

	int cent1 = A[N/2-1], cent2 = A[N/2];

	rep(i, 0, N) {
		int t = B[i];
		if (t <= cent1) {
			cout << cent2;
		}
		else
			cout << cent1;

		cout << endl;
	}

	return 0;
}



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

int main() {

  int N;
  cin >> N;

  int l = 0;
  int r = 0;

  int sum = 0;

  for (int i = 0 ; i < N ; i++) {
    cin >> l >> r;
    sum += r - l + 1;
  }

  cout << sum << endl;

}



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

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

void solve() {
  int a, b, ans = 0, tax8, tax10;
  cin >> a >> b;
  while (ans <= 1080) {
    tax8 = ans * 0.08;
    tax10 = ans * 0.10;
    if (tax8 == a && tax10 == b) {
      break;
    }
    ans++;
  }
  if(ans > 1080) {
    cout << -1 << endl;
  }else{
    cout << ans << endl;
  }
}

signed main() {
  solve();

  return 0;
}

Measured memory_bytes: 256
// Author : Hardik Upadhyay
// college: SVNIT 
// slogan : Ab to phod dunga
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define rrep(i,a,b) for(int i = a ; i >= b; i--)
#define debug(x) cout << '>' << #x << ':' << x << endl;
#define sq(a) (a)*(a)
#define nl "\n"
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,
//tree_order_statistics_node_update> indexed_set;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef unsigned long long ull;
const int MAXN = 100005;
ll mod=1000000007;


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	vi a(n);
	vi gcd_before_me(n),gcd_after_me(n);
	rep(i,0,n-1){
		cin>>a[i];
	}
	gcd_after_me[n-2] = a[n-1];
	rrep(i,n-3,0){
		gcd_after_me[i] = __gcd(gcd_after_me[i+1],a[i+1]);
	}
	gcd_before_me[1] = a[0];
	rep(i,2,n-1){
		gcd_before_me[i] = __gcd(gcd_before_me[i-1],a[i-1]);
	}
	int mx = gcd_after_me[0];
	mx = max(mx,gcd_before_me[n-1]);
	rep(i,1,n-2){
		int  x = __gcd(gcd_before_me[i],gcd_after_me[i]);
		if(x > mx){
			mx =  x;
		}
	}
	cout<<mx<<nl;
	return 0;
}


Measured memory_bytes: 1408
var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var line = lines[0].split("");
    line = line.map((value, index) => {
        if (index === 4) { value = " " + value; return (value); }
        else { return (value); }
    });
    console.log(line.join(''));
});

Measured memory_bytes: 7500
import java.io.*;
import java.math.BigInteger;

public class Main  implements Runnable {
    static ContestScanner in;
    static Writer out;
    public static void main(String[] args) {
        new Thread(null, new Main(), "", 16 * 1024 * 1024).start();
    }

    public void run() {
        Main main = new Main();
        try {
            in = new ContestScanner();
            out = new Writer();
            main.solve();
            out.close();
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    void solve() throws IOException {
        long x = in.nextLong();
        long y = in.nextLong();
        long tx = x - Math.min(x, y);
        long ty = y - Math.min(x, y);
        System.out.println((tx + ty <= 1) ? "Brown" : "Alice");
    }
}

class Writer extends PrintWriter{
    public Writer(String filename)throws IOException
    {super(new BufferedWriter(new FileWriter(filename)));}
    public Writer()throws IOException {super(System.out);}
}
class ContestScanner implements Closeable {
    private BufferedReader in;private int c=-2;
    public ContestScanner()throws IOException
    {in=new BufferedReader(new InputStreamReader(System.in));}
    public ContestScanner(String filename)throws IOException
    {in=new BufferedReader(new InputStreamReader(new FileInputStream(filename)));}
    public String nextToken()throws IOException {
        StringBuilder sb=new StringBuilder();
        while((c=in.read())!=-1&&Character.isWhitespace(c));
        while(c!=-1&&!Character.isWhitespace(c)){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public String readLine()throws IOException{
        StringBuilder sb=new StringBuilder();if(c==-2)c=in.read();
        while(c!=-1&&c!='\n'&&c!='\r'){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public long nextLong()throws IOException,NumberFormatException
    {return Long.parseLong(nextToken());}
    public int nextInt()throws NumberFormatException,IOException
    {return(int)nextLong();}
    public double nextDouble()throws NumberFormatException,IOException
    {return Double.parseDouble(nextToken());}
    public void close() throws IOException {in.close();}
}

Measured memory_bytes: 27348
def main():
    import sys
    input = sys.stdin.buffer.readline
    _ = int(input())
    A = [int(i) for i in input().split()]
    sumA = sum(abs(a) for a in A)
    mi = len([a for a in A if a < 0])
    if 0 in A or mi % 2 == 0:
        print(sumA)
    else:
        print(sumA - 2*min(abs(a) for a in A))


if __name__ == '__main__':
    main()


Measured memory_bytes: 12524
#include<stdio.h>
#include<math.h>
#define PI 3.1415926535
int main(){
    double a, b, c;
    double deg, rad;
    double S, L, H;
    scanf("%lf %lf %lf", &a, &b, &deg);
    rad = deg*PI/180;
    S = a*b*sin(rad)/2;
    H = b*sin(rad);
    c = sqrt(a*a + b*b - 2*a*b*cos(rad));
    L = a + b + c;
    printf("%f\n%f\n%f\n", S, L, H);
    return 0;
}

Measured memory_bytes: 2960
////////////////////////////////////////////
///                                      ///
///         Template ver. 1 rapel        ///
/// Fear is Temporary, Regret is Forever ///
///          Must Try and Get AC         ///
///                                      ///
////////////////////////////////////////////
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <iomanip>

#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>

#include <math.h>
#include <complex>

#include <assert.h>
#include <time.h>
//#include <chrono>
//#include <random>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <bitset>

#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define endl '\n'
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

void desperate_optimization(int precision){
  	ios_base::sync_with_stdio(false);
  	cin.tie(0);
  	cout.tie(0);
  	cout.setf(ios::fixed);
  	cout.setf(ios::showpoint);
  	cout.precision(precision);
}

const int N = 3000;
int dp[N + 5][N + 5];
int nx[N + 5][N + 5];

string a,b;

int calc(int x,int y) {
	if(a.length() == x || b.length() == y) return 0;
	int &res = dp[x][y];
	if(res != -1) return res;
	res = -1;
	if(a[x] == b[y]) {
		nx[x][y] = 2;
		res = calc(x + 1,y + 1) + 1;
	}
	else {
		res = calc(x + 1,y);
		nx[x][y] = 0;
		int res2 = calc(x, y + 1);
		if(res < res2) {
			res = res2;
			nx[x][y] = 1;
		}
	}
	return res;
}

void print(int x,int y) {
	if(a.length() == x || b.length() == y) return ;
	if(nx[x][y] == 2) {
		cout<<a[x];
		print(x + 1,y + 1);
	} else if(nx[x][y] == 1) print(x, y + 1);
	else print(x + 1,y);
}

void hora(int tc) {
	cin>>a>>b;
	memset(dp,-1,sizeof dp);
	cerr<<calc(0,0)<<endl;
	print(0,0);
}

int main(){
	desperate_optimization(10);
	int ntc = 1;
	//cin>>ntc;
	for(int tc = 1;tc <= ntc;tc++) hora(tc);
	return 0;
}



Measured memory_bytes: 71040
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func next() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func main() {
	scanner.Split(bufio.ScanWords)

	n := nextInt()
	k := nextInt()
	x := nextInt()
	y := nextInt()

	if n <= k {
		fmt.Println(n * x)
	} else {
		fmt.Println((k * x) + (n-k)*y)
	}
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const int dx[4] = { 0, -1, 1, 0 };
const int dy[4] = { -1, 0, 0, 1 };
const ll INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}

template<class T1, class T2> void chmin(T1 &a, T2 b) { if (a>b)a = b; }

template<class T1, class T2> void chmax(T1 &a, T2 b) { if (a<b)a = b; }
template<class T>
void Add(T &a, const T &b, const T &mod = 1000000007) {
	int val = ((a % mod) + (b % mod)) % mod;
	if (val < 0) { val += mod; }
	a = val;
}
////////////////////////////////////////

ll fac[510000], finv[510000], inv[510000];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < 510000; ++i) {
		fac[i] = fac[i - 1] * i%INF;//i!のmod INF
		inv[i] = INF - inv[INF%i] * (INF / i) % INF;
		finv[i] = finv[i - 1] * inv[i] % INF;
	}
}


int main() {
	int h, w, n; cin >> h >> w >> n;
	int key = max(h, w);
	if (n%key == 0) {
		cout << n / key << endl;
	}
	else {
		cout << n / key + 1 << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
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 Set>
struct Monoid
{
    using Op = function<Set(Set, Set)>;
    const Op f;
    const Set e;
    Monoid(const Op F, const Set E) : f(F), e(E)
    {
    }
};
template <typename Set>
struct SegmentTree
{
    using Op = function<Set(Set, Set)>;
    Monoid<Set> M;
    Set e;
    int size; //一番下以外の区間たち全部の数
    vector<Set> seg;
    SegmentTree(int n, const Monoid<Set> &M) : M(M)
    {
        size = 1;
        while (size < n)
        {
            size <<= 1;
        }
        e = M.e;
        seg.assign(2 * size, e);
    }
    void set(int k, const Set &x)
    {
        seg[k + size] = x;
    }
    void build()
    {
        for (int k = size - 1; k > 0; k--)
        {
            seg[k] = M.f(seg[2 * k + 0], seg[2 * k + 1]);
        }
    }
    void update(int k, const Set &x)
    {
        k += size;
        seg[k] = x;
        while (k >>= 1)
        {
            seg[k] = M.f(seg[2 * k + 0], seg[2 * k + 1]);
        }
    }
    Set query(int a, int b) //区間[a,b)に対して演算したやつを返す
    {
        Set L = e, R = e;
        for (a += size, b += size; a < b; a >>= 1, b >>= 1) //ループ一回ごとにa,bは親に向かう
        {
            if (a & 1) //a%2==1なら
            {
                L = M.f(L, seg[a++]);
            }
            if (b & 1)
            {
                R = M.f(seg[--b], R);
            }
        }
        return M.f(L, R);
    }
};
int main()
{
    Monoid<int> M([](int a, int b) { return __gcd(a, b); }, 0);
    int N;
    cin >> N;
    vint A(N);
    SegmentTree<int> seg(N, M);
    rep(i, N)
    {
        cin >> A[i];
        seg.update(i, A[i]);
    }
    int ans = 0;
    rep(i, N)
    {
        int tmp = __gcd(seg.query(0, i), seg.query(i + 1, N));
        ans = max(ans, tmp);
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 1664
#include "iostream"
#include <string>
int main()
{
    int aIn1 = 0;
    std::cin >> aIn1;
    int aIn2 = 0;
    std::cin >> aIn2;

        bool aAns1 = false;
        bool aAns2 = false;
        bool aAns3 = false;

        if(aIn1 == 1 || aIn2 == 1)
                aAns1 = true;
        if(aIn1 == 2 || aIn2 == 2)
                aAns2 = true;
        if(aIn1 == 3 || aIn2 == 3)
                aAns3 = true;

        if(! aAns1)
                std::cout << 1 << std::endl;
        if(! aAns2)
                std::cout << 2 << std::endl;
        if(! aAns3)
                std::cout << 3 << std::endl;
}

Measured memory_bytes: 256