akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,0,n+1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
const int MOD=1e9+7;
const int INF=1e18;

signed main(){
    string S,T;cin>>S>>T;
    S=S+S;
    vector<set<int>> pls;
    pls.assign(26,set<int>({INF}));
    REP(i,S.size()){
        pls[S[i]-'a'].insert(i);
    }
  	bool ok=true;
    REP(i,T.size()){
        if(*pls[T[i]-'a'].lower_bound(0)==INF){
            ok=false;
            break;
        }
    }
    int piyo=-1;
  	int count=0;
    if(ok){
        REP(i,T.size()){
            int d=*pls[T[i]-'a'].lower_bound(piyo+1);
      	    if(d!=INF)piyo=d;
      	    else{
                count++;
                piyo=-1;
                i--;
            }
        }
    }
  	if(ok)cout<<1+piyo+count*S.size()<<endl;
  	else cout<<-1<<endl;
}

Measured memory_bytes: 9984
n,m,c = map(int,input().split())
b = list(map(int,input().split()))

ans = 0
for _ in range(n):
	num = 0
	a = list(map(int,input().split()))
	for i in range(m):
		num += a[i] * b[i]
	if num + c > 0:
		ans += 1

print(ans)



Measured memory_bytes: 3060
io = STDIN
n=io.gets.to_i
ar=io.gets.split.map(&:to_i)
q=io.gets.to_i
tally=ar.tally
tally.default=0
sum=ar.sum
q.times do 
  b,c=io.gets.split.map(&:to_i)
    cnt=tally[b]
    sum=sum+cnt*(c-b)
  puts sum
    tally[b]=0
  tally[c]=tally[c]+cnt
end


Measured memory_bytes: 25888
#define C
typedef long long readtype;

/* Header {{{ */
#ifdef C
#include <stdio.h>
#include <math.h>
#include <string.h>
#define isdigit(a) ((a) >= '0' && (a) <= '9' ? true : false)
template<typename type> type abs(type a) { return a < 0 ? -a : a; }
template<typename type> type min(type a, type b) { return a < b ? a : b; }
template<typename type> type beMin(type &a, type b) { return a = (a < b ? a : b); }
template<typename type> type max(type a, type b) { return a > b ? a : b; }
template<typename type> type beMax(type &a, type b) { return a = (a > b ? a : b); }
template<typename type> void swap(type &a, type &b) { type c; c = a; a = b; b = c; }
#endif

#ifdef Cpp
#include <bits/stdc++.h>
using namespace std;
#endif

typedef long long var;

readtype read() {
  readtype a = 0, c = getchar(), s = 0;
  while (!isdigit(c)) s |= c == '-', c = getchar();
  while (isdigit(c)) a = a * 10 + c - 48, c = getchar();
  return s ? -a : a;
}
/* }}} */

const int N = 210005;
const int SIZE = 2000;
const int MOD = 1e9 + 7;
const int inv2 = 500000004;

int n, a[N], b[N];
var val[SIZE << 1 | 1][SIZE << 1 | 1], f[SIZE << 1 | 1][SIZE << 1 | 1];

int main() {
  /*
#ifndef ONLINE_JUDGE
  freopen("source.in", "r", stdin);
  freopen("source.out", "w", stdout);
#endif
  */
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &a[i], &b[i]);
    f[SIZE - a[i]][SIZE - b[i]]++;
  }
  val[0][0] = 1;
  for (int i = 0; i <= SIZE << 1; ++i) {
    for (int j = 0; j <= SIZE << 1; ++j) {
      if (i) {
        (f[i][j] += f[i - 1][j]) %= MOD;
        (val[i][j] += val[i - 1][j]) %= MOD;
      }
      if (j) {
        (f[i][j] += f[i][j - 1]) %= MOD;
        (val[i][j] += val[i][j - 1]) %= MOD;
      }
    }
  }
  var res = 0;
  for (int i = 1; i <= n; ++i) {
    (res += f[SIZE + a[i]][SIZE + b[i]]) %= MOD;
    (res += MOD - val[a[i] + a[i]][b[i] + b[i]]) %= MOD;
  }
  printf("%lld\n", (res * inv2) % MOD);
  return 0;
}


Measured memory_bytes: 251904
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e16+7;
int mod = 1e9+7;
int dx[4] = {1,-1, 0, 0};
int dy[4] = {0, 0, 1,-1};
signed main() {
    int N;
    cin >> N;
    vector<int>b(N);
    for(int i = 0; i < N; i++) {
        cin >> b[i];
    }
    vector<int>ans;
    while(N--) {
        for(int i = b.size()-1; i >= 0; i--) {
            if(b[i] == i+1) {
                ans.push_back(b[i]);
                b.erase(b.begin()+i);
                goto home;
            }
        }
        cout << -1 << endl;
        return 0;
    home:;
    }
    reverse(ans.begin(),ans.end());
    for(int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
}


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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

vector<pair<long long, long long>> prime_factorize(long long N)
{
    vector<pair<long long, long long>> res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0)
            continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({ a, ex });
    }

    // 最後に残った数について
    if (N != 1)
        res.push_back({ N, 1 });
    return res;
}

ll bunkatu(ll x)
{
    ll i = 1;
    while (x > 0) {
        x = x - i;
        if (x <= i) {
            return i;
        }
        i++;
    }
    return i;
}

int main()
{
    long long N;
    cin >> N;
    if (N == 1) {
        cout << 0 << endl;
        return 0;
    }
    const auto& res = prime_factorize(N);

    ll ans = 0;
    for (auto p : res) {
        ll e = p.second;
        ans += bunkatu(e);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3632
// Problem : A - Payment
// Contest : AtCoder - AtCoder Beginner Contest 173
// URL : https://atcoder.jp/contests/abc173/tasks/abc173_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;
		
signed main()
{
    io
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		int n;
		cin>>n;
		if(n%1000)
		{
			cout<<1000-(n%1000);
		}		
		else
		{
			cout<<0;
		}
    }
    return 0;
}


Measured memory_bytes: 3664
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 31) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

map<int, int> prime_facter(ll n) {
	map<int, int> res;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) {
			++res[i];
			n /= i;
		}
	}
	if (n != 1)res[n] = 1;
	return res;
}

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

ll p, q;

int main() {
	cin >> p >> q;
	map<int, int> mii = prime_facter(q / gcd(p, q));
	int ans = 1;
	for (auto it : mii) {
		ans *= it.first;
	}
	cout << ans << endl;
}

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


int main()
{
	long long n;
	long long ans=0,s=1,c;
	cin>>n;
	if(n==2) {
		printf("1");
		return 0;
	}
	long long maxx=sqrt(n);
	long long t=n-1;
	for(int i=2;i<=maxx;++i) {
		if(t%i==0) {
			c=1;
			while(t%i==0) t/=i,c++;
			s*=c;
		}
	}
	if(t!=1) s*=2;
	for(int i=2;i<=maxx;++i) {
		if(n%i==0) {
			long long t=n;
			while(t%i==0) t/=i;
			if(t%i==1) ans++;
		}
	}
	cout<<ans+s;
}

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

using namespace std;

const long MOD = 1000000007;
typedef pair<int, int> P;
typedef long long ll;

const int MAX_N = 100005;
int par[MAX_N];
int rn[MAX_N];

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

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

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

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

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

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

    int X[M], Y[M], Z[M];
    for(int i=0; i<M; i++){
        cin >> X[i] >> Y[i] >> Z[i];
        X[i]--;Y[i]--;
    }

    init(N);

    for(int i=0; i<M; i++){
        unite(X[i], Y[i]);
    }

    map<int, int> m;
    int ans = 0;
    for(int i=0; i<N; i++){
        int root = find(i);
        if(m.count(root) == 0){
            ans++;
            m[root] = 1;
        }
    }

    cout << ans << endl;

    return 0;
}


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

int main() {
  int N, A = 0,B = 0,G = 0;
  cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; i++){
     cin >> v.at(i);
  }
  for (int i = 0; i < N; i++){
    int MAX = 0,TOP = 0;
    for (int b = 0; b < N; b++){
      if (v.at(b) > MAX){
        MAX = v.at(b);
        TOP = b;
      }
    }
    G++;
    if (G % 2 == 1){
        A += MAX;
        v.at(TOP) = -1;
      }else{
        v.at(TOP) = -1;
        B += MAX;
      }
  }
  cout << A - B << endl;
}

Measured memory_bytes: 256
/*
 * b.cc: 
 */

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

using namespace std;

/* constant */

const int MAX_N = 100;

/* typedef */

typedef vector<int> vi;

/* global variables */

vi nbrs[MAX_N];
int ds[MAX_N], fs[MAX_N];

/* subroutines */

int dfs(int u, int t) {
  ds[u] = ++t;

  for (int i = 0; i < nbrs[u].size(); i++) {
    int &v = nbrs[u][i];
    if (! ds[v]) t = dfs(v, t);
  }

  return (fs[u] = ++t);
}

/* main */

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

  for (int i = 0; i < n; i++) {
    int u, k;
    cin >> u >> k;
    u--;

    for (int j = 0; j < k; j++) {
      int v;
      cin >> v;
      v--;
      nbrs[u].push_back(v);
    }
  }

  int t = 0;
  for (int i = 0; i < n; i++)
    if (! ds[i]) t = dfs(i, t);

  for (int i = 0; i < n; i++)
    printf("%d %d %d\n", i + 1, ds[i], fs[i]);

  return 0;
}

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

int main() {
	string s, t;
	cin >> s >> t;
	sort(s.begin(), s.end());
	sort(t.begin(), t.end(), greater<char>());
	int a = (int)s.size();
	int b = (int)t.size();
	bool ok = false;
	rep(i, b) {
		if (s[i] < t[i]) {
			ok = true;
			break;
		}
		if (s[i] > t[i]) {
			ok = false;
			break;
		}
		if (s[i] == t[i] && i == a) {
			ok = false;
			break;
		}
	}
	if (ok) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3600
#include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
void init(void);
void print(void);
void dfs(void);
void dfs_s(int);

int n, time;
int graph[N][N], color[N], d[N], f[N];

int main() {
  int i, j, l, m, in;

  init();

  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &l, &m);
    for (j = 0; j < m; j++) {
      scanf("%d", &in);
      graph[l - 1][in - 1] = 1;
    }
  }

  dfs();
  print();

  return 0;
}
void dfs(void) {
  int i, j;
  
  for (i = 0; i < n; i++) {
    if (color[i] == WHITE) dfs_s(i);
  }
  
  return ;
}
void dfs_s(int u) {
  int i, j;
  
  color[u] = GRAY;
  d[u] = ++time;
  
  for (i = 0; i < n; i++) {
    if (graph[u][i] == 1 && color[i] == WHITE) {
      dfs_s(i);
    }
  }
  
  color[u] = BLACK;
  f[u] = ++time;
}
  

void init(void) {
  int i, j;

  time = 0;
  for (i = 0; i < N; i++) {
    color[i] = WHITE;
    for (j = 0; j < N; j++) {
      graph[i][j] = 0;
    }
  }
  return ;
}
void print(void) {
  int i, j;
  
  for (i = 0; i < n; i++) {
    printf("%d %d %d\n", i + 1, d[i], f[i]);
  }
  return ;
}

Measured memory_bytes: 640
#include <iostream>
#include <set>
using namespace std;
set<string> st;
string t,s[102];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>t;
		st.insert(t);
		s[i]=t;
	}
	if(st.size()!=n){
		cout<<"No";
		return 0;
	}
	for(int i=1;i<n;i++)
		if(s[i-1][s[i-1].length()-1]!=s[i][0]){
		cout<<"No";
		return 0;
		}
		cout<<"Yes";
		return 0;
	}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
double a, b, c, d, e, f;

int main(){

  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> a >> b >> c >> d >> e >> f;

  double par = 0;
  int atotal = 0, asugar = 0;
  double apar = -1;

  for (int x = 0; x * a * 100 <= f; x++) {
    for (int y = 0; (x > 0 || y > 0) && 100 * (x * a + y * b) <= f; y++) {
      for (int z = 0; 100 * (x * a + y * b) + z * c<= f; z++) {
        for (int w = 0; 100 * (x * a + y * b) + z * c + w * d <= f; w++){
          int water = 100 * (x * a + y * b);
          int sugar = z * c + w * d;
          if (water * e >= sugar * 100) {
            if ((double)sugar / (sugar + water) > apar) {
              apar = (double)sugar / (sugar + water);
              atotal = sugar + water;
              asugar = sugar;
            }
          }
        }
      }
    }
  }

  cout << atotal << " " << asugar << '\n';

  return 0;
}


Measured memory_bytes: 256
N = int(input())
foods = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

satisfaction = 0
previous_food = -1

for food in foods:
    satisfaction += B[food-1]
    if food == previous_food+1:
        satisfaction += C[previous_food-1]
    previous_food = food

print(satisfaction)


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

using namespace std;
typedef pair<int,int> pii;
typedef long long int ll;

#define INF 1 << 29
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)



vector<bool> gen_sosuu(vector<bool> sosuu){
  int size = sosuu.size();
  REP(i,size){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(size)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<size;j++){
      sosuu[i*j] =false;
    }
  }
  return sosuu;
}

int a,b,h;

int main(){
  cin >>a>>b>>h;
  cout << (a+b)*h/2;
}


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

using namespace std;

typedef long long int ll;
typedef long double ld;
typedef string str;
typedef vector<char> vc;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define all(a) a.begin(), a.end()

template <typename T>
T Sum(vector<T> n, ll a = 0, ll b = 0)
{
  if (b == 0)
  {
    return (accumulate(n.begin() + a, n.end(), 0));
  }
  else
  {
    return (accumulate(n.begin() + a, n.begin() + b, 0));
  }
}
template <>
ld Sum(vector<ld> n, ll a, ll b)
{
  if (b == 0)
  {
    return (accumulate(n.begin() + a, n.end(), 0));
  }
  else
  {
    return (accumulate(n.begin() + a, n.begin() + b, 0));
  }
}

template <typename T>
void Sort(T &n, ll a = 0, ll b = 0)
{
  if (b == 0)
  {
    return (sort(n.begin() + a, n.end()));
  }
  else
  {
    return (sort(n.begin() + a, n.begin() + b));
  }
}

template <typename T>
void Reve(T &n, ll a = 0, ll b = 0)
{
  if (b == 0)
  {
    return (reverse(n.begin() + a, n.end()));
  }
  else
  {
    return (reverse(n.begin() + a, n.begin() + b));
  }
}

template <typename T>
void V(T &n)
{
  for (ll i = 0; i < n.size(); i++)
  {
    cin >> n[i];
  }
}

template <typename T, typename U>
void V2(T &n, U &m)
{
  for (ll i = 0; i < n.size(); i++)
  {
    cin >> n[i] >> m[i];
  }
}

template <typename T, typename U, typename W>
void V3(T &n, U &m, W &p)
{
  for (ll i = 0; i < n.size(); i++)
  {
    cin >> n[i] >> m[i] >> p[i];
  }
}

void fYn(bool a)
{
  if (a)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  exit(0);
}
//最大公約数
ll gcd(ll a, ll b)
{
  return b ? gcd(b, a % b) : a;
}
//最小公倍数
ll lcm(ll a, ll b)
{
  return a * b / gcd(a, b);
}
//複数個の最小公倍数
ll nlcm(vector<ll> numbers)
{
  ll res;
  res = numbers[0];
  for (ll i = 1; i < numbers.size(); i++)
  {
    res = lcm(res, numbers[i]);
  }
  return res;
}
//累乗(xのn乗%mod)
ll mod_pow(ll x, ll n, ll mod = MAX)
{
  ll res = 1;
  while (n > 0)
  {
    if (n & 1)
      res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}

//大文字->小文字(+32)
//少数はなるべく整数に

void Main()
{
  ll a, b;
  cin >> a >> b;
  if((a + b) % 2 == 0) fin((a + b) / 2)
  else fin("IMPOSSIBLE")
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  Main();
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
using ll = long long;
using ld = long double;
using namespace std;

const int N = 2e5 + 64;
int n;
char s[N];
int p[N];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	cin >> s;
	reverse(s, s + n);
	for (int i = 0; i < n; ++i) {
		p[i + 1] = p[i] + (s[i] == '#');
	}
	int answer = (int)1e9;
	for (int i = 0; i <= n; ++i) {
		int w = i - p[i];
		int b = p[n] - p[i];
		answer = min(answer, w + b);
	}
	cout << answer << "\n";
	return 0;
}



Measured memory_bytes: 1280
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// 所要時間のリスト
		int[] times = new int[5];
		input(times);

		// 0〜4の順列を生成
		List<int[]> sequences = sequence(new int[] { 0, 1, 2, 3, 4 });
//		sequences.stream().map(e -> Arrays.toString(e)).forEach(System.out::println);

		int minTime = Integer.MAX_VALUE;
		int[] order = new int[5];
		for (int[] seq : sequences) {
			for (int i = 0; i < order.length; i++) {
				order[i] = times[seq[i]];
			}
			int time = calcTime(order, minTime);
			minTime = (time < minTime) ? time : minTime;
//			System.out.printf("%s => %d\n", Arrays.toString(order), time);
		}
		System.out.println(minTime);
	}

	/**
	 * 配列で与えられた要素の順列を返す
	 * 
	 * @param members
	 * @return
	 */
	private static List<int[]> sequence(int[] members) {
		List<int[]> sequences = new ArrayList<>();
		sequence0(members, new int[members.length], 0, sequences);
		return sequences;
	}

	private static void sequence0(int[] members, int[] array, int digit, List<int[]> seq) {
		for (int m : members) {
			array[digit] = m;
			if (digit == array.length - 1) {
				seq.add(Arrays.copyOf(array, array.length));
			} else {
				sequence0(subArray(m, members), array, digit + 1, seq);
			}
		}
	}

	// memnbers の要素から m を除いた配列を返す
	private static int[] subArray(int m, int[] members) {
		int[] ret = new int[members.length - 1];
		for (int i = 0, j = 0; i < members.length; i++) {
			if (members[i] != m) {
				ret[j++] = members[i];
			}
		}
		return ret;
	}

	private static void input(int[] times) {
		try (Scanner scan = new Scanner(System.in)) {
			for (int i = 0; i < 5; i++) {
				times[i] = scan.nextInt();
			}
		}
	}

	// order は注文する料理の所要時間配列
	private static int calcTime(int[] order, int maxTime) {
		int t = 0;
		for (int i = 0; i < order.length; i++) {
			t += order[i]; // 完成時刻
			if ((i != order.length - 1) && (t % 10 != 0)) {
				t += (10 - (t % 10));
			}
			// 最大時間を越えたらそれ以上計算しない
			if(t >= maxTime) {
				return t;
			}
		}
		return t;
	}
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

const ll inf = LONG_LONG_MAX / 2 - 1;
ll n;
vector<ll> a, cost;
vector<vector<ll>> dp;

ll f(ll l, ll r) {
    if (dp[l][r] != inf) return dp[l][r];
    if (l == r) return 0;
    ll mv = LONG_LONG_MAX;
    reps(i, l, r) {
        mv = min(mv, f(l, i) + f(i + 1, r));
    }
    return dp[l][r] = mv + (cost[r + 1] - cost[l]);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    cin >> n;
    a.resize(n);
    rep(i, n) cin >> a[i];
    cost.resize(n + 1, 0);
    rep(i, n) cost[i + 1] = cost[i] + a[i];
    dp.resize(n, vector<ll>(n, inf));
    cout << f(0, n - 1) << endl;
    return 0;
}


Measured memory_bytes: 1536
"""
author : halo2halo
date : 31, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A,B,C,D=map(int,readline().split())
print(A*B if A*B>=C*D else C*D)


Measured memory_bytes: 3060
#pragma GCC optimize ("-O3")
    #include <bits/stdc++.h>  
     
    using namespace std;
     
    typedef long long ll;
    typedef long double ld;
    typedef pair<int,int> p32;
    typedef pair<ll,ll> p64;
    typedef pair<double,double> pdd;
    typedef vector<ll> v64;
    typedef vector<int> v32;
    typedef vector<vector<int> > vv32;
    typedef vector<vector<ll> > vv64;
    typedef vector<vector<p64> > vvp64;
    typedef vector<p64> vp64;
    typedef vector<p32> vp32;
    ll MOD = 998244353;
    #define forn(i,e) for(ll i = 0; i < e; i++)
    #define forsn(i,s,e) for(int i = s; i < e; i++)
    #define rforn(i,s) for(ll i = s; i >= 0; i--)
    #define rforsn(i,s,e) for(ll i = s; i >= e; i--)
    #define ln "\n"
    #define dbg(x) cout<<#x<<" = "<<x<<ln
    #define mp make_pair
    #define pb push_back
    #define fi first
    #define se second
    #define INF 1e18
    #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
    #define all(x) (x).begin(), (x).end()
    #define sz(x) ((ll)(x).size())
     
    ll mpow(ll a, ll b){
        if(b >= (MOD-1)) b %= (MOD-1);
        if(b==0) return 1;
        ll t1 = mpow(a,b/2);
        t1 *= t1;
        t1 %= MOD;
        if(b%2) t1 *= a;
        t1 %= MOD;
        return t1;
    }
     
    ll mpow(ll a, ll b, ll p){
        if(b==0) return 1;
        ll t1 = mpow(a,b/2,p);   t1 *= t1;
        t1 %= p;
        if(b%2) t1 *= a;
        t1 %= p;
        return t1;
    }
    ll modinverse(ll a, ll m){
        ll m0 = m; 
        ll y = 0, x = 1; 
        if (m == 1) return 0; 
        while (a > 1){
            ll q = a / m; 
            ll t = m; 
            m = a % m, a = t; 
            t = y; 
            y = x - q * y; 
            x = t; 
        }
        if (x < 0) x += m0; 
        return x; 
    }
    ll range(ll l, ll r){
        return l + rand()%(r-l+1);
    }

    int main()
    {
        string s,t;
        cin>>s>>t;
        t.pop_back();
        if(s==t)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;

        
        return 0;
    }

Measured memory_bytes: 3632
#define _GLIBCXX_DEBUG
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;

int P[10010];
void init(int n){
    for(int i=0;i<n;++i)P[i]=i;
}
int root(int a) {
    if(P[a]==a)return a;
    return (P[a]=root(P[a]));
}
bool is_same_set(int a,int b){
    return root(a) == root(b);
}
void unite(int a,int b){
    P[root(a)]=root(b);
}//対グラフ

double dot_product(xy_t a, xy_t b) { return (conj(a)*b).real(); }//内積
double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }//外積
xy_t projection(xy_t p, xy_t b) { return b*dot_product(p,b)/norm(b); }//投影
//対図形

const ll mod=1e9+7;

int main(){
    int n;
    cin >>n;
    ll a[n];
    ll min=mod;
    ll sum=0;
    int k=0;
    rep(i,n){
        cin>>a[i];
        sum+=abs(a[i]);
        if(a[i]<0){
            k++;
        }
        if(min>abs(a[i])){
            min=abs(a[i]);
        }
    }
    if(k%2==0){
        cout<<sum<<endl;
    }else{
        cout<<sum-2*min<<endl;
    }
    return 0;
}

Measured memory_bytes: 1024
def draw(h, w):
    for i in range(h):
        s = ""
        for j in range(w):
            s += ("#" if (i+j)%2 == 0 else ".")
        print(s)
    print("")

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)

Measured memory_bytes: 4228
X , Y =input().split()
letrs=[ 'A', 'B', 'C', 'D', 'E', 'F']
nums= [ 10, 11, 12, 13, 14, 15]

x= letrs.index(X)
y= letrs.index(Y)

if(x> y) :
    print(">")
elif(x ==y ):
    print("=")
else:
    print("<")



Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using V = vector<ll>;
#define _GLIBCXX_DEBUG
#define rep(i, a) for(int i = 0; i < a; i++)
#define ALL(v) v.begin(), v.end()

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


Measured memory_bytes: 256
while line = STDIN.gets

	len = line.length

	while !(line =~ /(the|this|that)/)
	
		for i in 0..len-1 do
			if( line[i,1] =~ /[a-z]/)
				if(line[i,1] =~ /z/)
					line[i] = "a"
				else
					line[i] = line[i].succ
				end
			end
		end
	end
	
	puts line
	
end

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

using namespace std;
using ll = long long;

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

  string s;
  cin >> s;
  ll n = s.size();

  // 左からi+1文字目以降の数字をtiとし、
  // 各tiを調べて2019で割った時の余りが合計でいくつあるかを記録する
  map<int, ll> m;

  int t = 0;
  m[0]++;
  int p = 1;
  for (ll i = n - 1; i >= 0; i--) {
    t += p * (s[i] - '0');
    t %= 2019;
    p = p * 10 % 2019;
    m[t]++;
  }

  ll ans = 0;
  for (auto [k, v] : m) {
    ans += (v * (v - 1)) / 2;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int N; cin>>N;
    vector<int> A(N);
    rep(n,0,N) cin>>A.at(n);

    int ans=0;
    rep(i,0,N){
        if(i%2==0 && A.at(i)%2==1) ans++;
    }
    cout<<ans<<endl;
}

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

int main() {
	char S[20];
	string T;
	string p;
	string Q;
	double m;
	int a = 0;
	int A = 0;
	int b = 0;
	int B = 0;
	int c = 0;
	int C = 0;
	int q, w, z;
	int n = 0;
	int x = 0;
	int y = 0;
	int ans = 0;
	int X[100] = { 0 };
	cin >> x;
	cout << "Christmas";
	for (int i = 0; i < 25 - x; i++) {
		cout << " Eve";
	}
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int i;
	char str[20] = {0};
	while(scanf("%s", str) != EOF){
	for(i=19;i>=0;i--){
		if(str[i] !=0) printf("%c",str[i]);
	}
	printf("\n");
	}
	return 0;
}

Measured memory_bytes: 520
#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)

const int MOD = 1000000007;

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

    LL H, W;
    cin >> H >> W;

    LL ans = (H==1 || W==1) ? 1 : (H*W+1)/2;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

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

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextDouble();
			u[i] = sc.next();
		}

		double sum = 0;

		for (int i = 0; i < N; i++) {
			if (u[i].equals("JPY")) {
				sum += x[i];
			} else {
				sum += 380000.0* x[i];
			}
		}
		BigDecimal ans = new BigDecimal(Double.toString(sum));
		ans = ans.setScale(4,RoundingMode.HALF_UP);
		System.out.println(ans);
	}
}


Measured memory_bytes: 24532
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio();cin.tie();cout.tie();
using namespace std;
ll n;
string a[200005];
map<string,ll>m;
map<string,ll>cnt;
vector<string>v;
int32_t main(){
CODE_START;
cin>>n;
for(ll i=0;i<n;i++){
    cin>>a[i];
    cnt[a[i]]++;
}
ll mx=0;
for(ll i=0;i<n;i++)
    mx=max(mx,cnt[a[i]]);
for(ll i=0;i<n;i++)
{
    if(m[a[i]]==0&&cnt[a[i]]==mx){
        v.pb(a[i]);
        m[a[i]]=1;
    }
}
sort(v.begin(),v.end());
for(ll i=0;i<v.size();i++)
    cout<<v[i]<<endl;
}






Measured memory_bytes: 40816
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	// エラトステネスのふるい(n以下の素数を求める)
	public static boolean[] sieve (int n) {
		boolean[] isPrime = new boolean[n + 1];
		Arrays.fill(isPrime, true);
		for (int i = 4; i < isPrime.length; i += 2)
			isPrime[i] = false;
		for (int i = 3; i * i <= n; i += 2) {
			for (int j = 3; i * j <= n; j += 2)
				isPrime[i * j] = false;
		}
		return isPrime;
	}

	public static void main(String[] args) throws IOException {

		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));

		boolean[] primes = sieve(1000000);

		while (true) {
			int n = Integer.parseInt(br.readLine());
			if (n == 0) break;
			int sum = 0, cnt = 0;
			for (int i = 2; cnt < n; i++) {
				if (primes[i]) {
					sum += i;
					cnt++;
				}
			}
			System.out.println(sum);
		}

	}

}

Measured memory_bytes: 21704
import java.util.Scanner;
import java.math.*;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        double r = scan.nextDouble();
        String S = String.format("%.6f", r * r * Math.PI);
        String L = String.format("%.6f", 2 * r * Math.PI);
        System.out.println(S + " " + L);
    }
}


Measured memory_bytes: 28296
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int n,k;
  cin>>n>>k;
  int a[n];
  for(int i = 0 ;i  <  n; i++){
    cin>>a[i];
  }
  sort(a,a+n);
  int sum=0;
  for(int i = 0 ; i < k ;i++){
    sum+=a[i];
  }
  cout<<sum<<endl;
  return 0;
}


Measured memory_bytes: 3640
#include<stdio.h>
#include<string.h>
int main()
{
    char a[4],p=0;
    int i;
    for(i=0;i<4;i++){
        scanf("%c",&a);

    if(a[0]=='+'){
        p++;
    }
    else if(a[0]=='-'){
        p--;
    }
    if(a[1]=='+'){
        p++;
    }
    else if(a[1]=='-'){
        p--;
    }
    if(a[2]=='+'){
        p++;
    }
    else if(a[2]=='-'){
        p--;
    }
    if(a[3]=='+'){
        p++;
    }
    else if(a[3]=='-'){
        p--;
    }
    }
    printf("%d",p);
    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
 
		String x= sc.next();
		String y= sc.next();
		if(x.charAt(0) > y.charAt(0)) {
			System.out.println(">");
		}
		else if(x.charAt(0) < y.charAt(0)) {
			System.out.println("<");	
		}
		else {
			System.out.println("=");
		}
	}
}

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

int main() 
{ 
	long double a,b,c;
	cin>>a>>b>>c;
	
	//long double a1 = sqrtl(a);
	//long double b1 = sqrtl(b);
	//long double c1 = sqrtl(c);
	if(c > (a+b)){
		c = c -(a+b);
		long double che = 2*(sqrtl(a*b));
		if(c > (che)){
			cout<<"Yes\n";
		}
		else{
			cout<<"No\n";
		}
	}
	else{
		cout<<"No\n";
	}
	return 0; 
} 


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

int id[2222];
int zero[2222];
int one[2222];


int N;
string bit;

int gen(int x,int pos,int dep){
	if(	dep == 0 ){
		zero[x] = (bit[pos]=='0'?-1:-2);
		one[x]  = (bit[pos+1]=='0'?-1:-2);
		return 0;
	}
	zero[x] = 2*x+1;
 	 one[x] = 2*x+2;
	gen(2*x+1,pos,dep-1); //zero
	gen(2*x+2,pos+(1<<dep),dep-1); //zero
}

int next(int x){
	if( x < 0 ) return x;
	if( id[x] != x ) return id[x]=next(id[x]);
	return x;
}

int hens(int x){
	int ans = 0;
	x++;
	while(x){
		ans++;
		x/=2;
	}
	return ans;
}

int main(){
	for(int i = 0 ; i < 2222 ; i++) id[i] = i;
	cin >> N;
	cin >> bit;
	gen(0,0,N-1);

	while(1){
		int flag=0;
		for(int i = 0 ; i < (1<<N) - 1 ; i++){
			if( next(id[i]) < 0 ) continue;
			if( next(zero[id[i]]) == next(one[id[i]]) ){
				if( next(id[i]) != next(zero[id[i]]) ){flag=1;}
				id[i]=next(zero[i]);
			}
		}
		map< pair<int,int> , int> gr[20];
		for(int i = 0 ; i < (1<<N) - 1 ; i++){
			if( next(id[i]) < 0 ) continue;
			pair<int,int> key = make_pair(next(zero[id[i]]),next(one[id[i]]));
			int h = hens(next(id[i]));
			if( gr[h].count(key) ){
				if( next(id[i]) != next(gr[h][key]) ) flag=1;
				id[i]=next(gr[h][key]);
			}else{
				gr[h][key] = next(id[i]);
			}
		}
		if(!flag) break;
	}
	set<int> w;
	for(int i = 0 ; i < (1<<N) - 1 ; i++){
		if( next(id[i]) >= 0 ){
			
			w.insert(next(id[i]));
		}
	}
	cout << w.size() << endl;
}

Measured memory_bytes: 1268
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>; 
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
constexpr long long LINF = 1001001001001001001;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
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; }


int main(){
    string s; cin >> s;
    int len = s.size(); bool fg = true;
    if(s.back()=='1')fg = false;
    if(s[0] == '0' || s[len-2] == '0')fg = false;
    s.pop_back(); int num = len/2;
    string a = s.substr(0, num);
    if(len%2==0)num--;
    string b = s.substr(num);
    reverse(all(b));
    if(a != b)fg = false;

    vector<int> vec;
    rep(i, len-1)if(s[i]=='1')vec.push_back(i + 1);
    vector<pii> res;
    int par = 1, child = 2, index = 0;
    if(fg){
    for(int siz = 1; siz < len; siz++){
        //cout << "siz:" << siz << " vec:" << vec[index] << ln;
        if(siz <= vec[index]){
            res.push_back({par, child});
            child++;
        }else{
            par = child - 1;
            res.push_back({par, child});
            child++;
            index++;
        }
    }
        for(auto p: res){
            cout << p.first << " " << p.second << ln;
    }
    }else{
        cout << -1 << ln;
    }
}


Measured memory_bytes: 4876
#include <bits/stdc++.h>
using namespace std ;
//#define int long long
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define loop(it, v) for (auto it = v.begin(); it != v.end(); it++)
#define cont(i, x) for (int i = head[x]; i; i = e[i].nxt)
#define clr(a) memset(a, 0, sizeof(a))
#define ass(a, sum) memset(a, sum, sizeof(a))
#define lowbit(x) (x & -x)
#define all(x) x.begin(), x.end()
#define SC(t, x) static_cast <t> (x)
#define ub upper_bound
#define lb lower_bound
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define pof pop_front
#define pob pop_back
#define fi first
#define se second
#define y1 y1_
#define Pi acos(-1.0)
#define iv inline void
#define enter cout << endl
#define siz(x) ((int)x.size())
#define file(x) freopen(x".in", "r", stdin),freopen(x".out", "w", stdout)
typedef long double ld ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair <int, int> pii ;
typedef pair <ll, int> pli ;
typedef pair<int, pii> tri ;
typedef vector <int> vi ;
typedef vector <pii> vii ;
typedef vector <vi> vvi ;
typedef vector <string> vst ;
typedef queue <int> qi ;
typedef queue <pii> qii ;
typedef set <int> si ;
typedef map <int, int> mii ;
typedef map <string, int> msi ;
const int N = 5010 ;
const int INF = 0x3f3f3f3f ;
const int iinf = 1 << 30 ;
const ll linf = 2e18 ;
const int mod = 1000000007 ;
const double eps = 1e-7 ;
void douout(double x){ printf("%lf\n", x + 0.0000000001) ; }
template <class T> void print(T a) { cout << a << endl ; exit(0) ; }
template <class T> void chmin(T &a, T b) { if (a > b) a = b ; }
template <class T> void chmax(T &a, T b) { if (a < b) a = b ; }
template <class T> void Tmin(T &a, T &b, T &c) { return min(a, min(b, c)) ; }
template <class T> void Tmax(T &a, T &b, T &c) { return max(a, max(b, c)) ; }
void add(int &a, int b) { a = a + b < mod ? a + b : a + b - mod ; }
void sub(int &a, int b) { a = (a - b + mod) % mod ; }
void mul(int &a, int b) { a = (ll) a * b % mod ; }
int addv(int a, int b) { return (a += b) >= mod ? a -= mod : a ; }
int subv(int a, int b) { return (a -= b) < 0 ? a += mod : a ; }
int mulv(int a, int b) { return (ll) a * b % mod ; }
int read() {
    int f = 1, x = 0 ;
    char ch = getchar() ;
    while (!isdigit(ch)) { if (ch == '-') f = -1 ; ch = getchar() ; }
    while (isdigit(ch)) { x = x * 10 + ch -'0' ; ch = getchar() ; }
    return x * f ;
}
int pw(int a, int b) {
    int s = 1 ;
    for (; b; b >>= 1, a = (ll) a * a % mod)
    if (b & 1) s = (ll) s * a % mod ;
    return s ;
}

int n, ans ;
string s ;
int g[N][N] ;

signed main() {
	scanf("%d", &n) ;
	cin >> s ; s = ' ' + s ;
	rep(i, 1, n)
	rep(j, i + 1, n)
	if (s[i] == s[j]) {
		g[i][j] = g[j][i] = 1 ;
	}
	rep(i, 1, n)
	rep(j, i + 1, n) 
	if (g[i][j]) {
		int len = 0 ;
		while (i + len < j && g[i + len][j + len]) g[i + len][j + len] = 0, len++ ;
		chmax(ans, len) ;
	}
	printf("%d\n", ans) ;
	return 0 ;
} 

Measured memory_bytes: 98176
n,y=map(int,input().split())
y//=1000
for i in range(y//10+1):
  for j in range(y//5+1):
    if 9*i+4*j+n==y and i+j<=n:
      print(i,j,n-i-j);exit()
print("-1 -1 -1")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ull unsigned long long
# define lli long long int
# define ulli unsigned long long int
#define ll long long
#define db double
#define ldb long double
#define vi vector<int>
#define vull vector<ull>
#define vll vector<ll>
#define pb push_back
#define eb emplace_back
#define si set<int>
#define sll set<ll>
#define ins insert
#define rep(i,n) for(int i=0;i<n;i++)
#define vpp vector<pair<int,int>>
#define mp make_pair
#define ft first
#define sc second
#define MAX 9999999
#define MOD 1000000007
using namespace std;
//ll prime[9999999];
// //Modular Exponentiation
// ll fastExpo(ll x, ll n) {
//   if (n == 0) return 1;
//   if ((n & 1) == 0) return fastExpo((x * x) % MOD, n / 2) % MOD;
//   return ((x % MOD) * fastExpo((x * x) % MOD, (n - 1) / 2)) % MOD;
// }
//   //Euclidean Algorithm
// ll gcd(ll a, ll b) {
//   return (b == 0) ? a : gcd(b, a % b);
// }
//  // Extended Euclidean Algorithm
//   ll exgcd(ll a,ll b,ll &x, ll &y){
//   if(b==0){
//     x=1,y=0;
//     return a;
//   }
//    ll x1,y1;
//     ll d=exgcd(b,a%b,x1,y1);
//    x=y1;
//    y=x1-y1*(a/b);
//    return d;
//  }

// void sieve() {
//   prime[0] = 0;
//   prime[1] = 0;
//   for (int i = 2; i < 9999999; i++) {
//     prime[i] = 1;
//   }
//   for (int i = 2; i * i < 9999999; i++) {
//     if (prime[i] == 1) {
//       for (int j = i * i; j < 9999999; j += i) {
//         prime[j] = 0;
//       }
//     }
//   }
// }
// int fi[10009];
// void fun(){
//   for(int i=0;i<10009;i++)fi[i]=i;
//   for(int i=2;i<10009;i++)
//   {   if(fi[i]==i)
//       {
//         for(int j=i;j vt<10009;j+=i)
//         fi[j]=fi[j]*(i-1)/i;
//       }
//   }
//

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  //  cout << fixed;
  // cout.precision(2);

  ll n, k, t;
  cin >> n >> k >> t;
  ll ans = ceil((double)n / k) * t;
  cout << ans << "\n";
  return 0;
}







Measured memory_bytes: 3648
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
bool minimize(T)(ref T x, T y) { if (x > y) { x = y; return true; } else { return false; } }
bool maximize(T)(ref T x, T y) { if (x < y) { x = y; return true; } else { return false; } }

long mod = 10^^9 + 7;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto N = RD;
	long[] arr;
	arr ~= RD;
	arr ~= RD;
	arr ~= RD;
	arr ~= RD;
	arr ~= RD;

	long ans;
	long cnt;
	foreach (i; 0..5)
	{
		if (i != 0)
		{
			arr[i] = min(arr[i], arr[i-1]);
		}
		if (i == 4)
		{
			cnt += N / arr[i];
			cnt += N % arr[i] != 0 ? 1 : 0;
		}
	}
	
	writeln(cnt + 4);
	stdout.flush();
	debug readln();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VB = vector<bool>;
using VS = vector<string>;
using graph = vector<vector<int>>;

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

Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
using namespace std;

#define int long long

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

    sort(v.begin(), v.end());

    int ans = 0;
    for(int i = 0; i < n - 2; i++) {
        for(int j = i + 1; j < n - 1; j++) {
            for(int k = j + 1; k < n; k++) {
                if(v[i] != v[j] && v[j] != v[k] && v[k] != v[i]) {
                    if(v[i] + v[j] > v[k]) ans++;
                }
            }
        }
    }

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

Measured memory_bytes: 3632
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;

void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    ll ans=0;
    rep(i,n) rep(j,n) {
        if(i==j) continue;
        else{
            ans+=a[i]*a[j];
        }
    }
    cout << ans/2;
    return 0;
}

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

using namespace std;
namespace mod {

template <class T, int M>
class MInt;

template <class T, int M>
MInt<T, M> Pow(const MInt<T, M> &base, T exp);

template <class T, int M>
MInt<T, M> Inv(const MInt<T, M> &n);

template <class T, int M>
class MInt {
  T n_;

 public:
  MInt() : n_(0) {}
  MInt(T n) : n_((n % M + M) % M) {}

  MInt &operator+=(const MInt &rhs) {
    n_ += rhs.n_;
    if (n_ >= M) {
      n_ -= M;
    }

    return *this;
  }

  MInt &operator-=(const MInt &rhs) {
    n_ += M - rhs.n_;
    if (n_ >= M) {
      n_ -= M;
    }

    return *this;
  }

  MInt &operator*=(const MInt &rhs) {
    n_ = n_ * rhs.n_ % M;
    return *this;
  }

  MInt &operator/=(const MInt &rhs) { return (*this) *= Inv(rhs); }

  T Get() { return n_; }
};

template <class T, int M>
MInt<T, M> operator-(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res -= rhs;
}

template <class T, int M>
MInt<T, M> operator+(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res += rhs;
}

template <class T, int M>
MInt<T, M> operator*(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res *= rhs;
}

template <class T, int M>
MInt<T, M> operator/(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res /= rhs;
}

template <class T, int M>
MInt<T, M> Pow(const MInt<T, M> &base, T exp) {
  if (exp == 0) {
    return 1;
  }

  auto a = Pow(base, exp / 2);
  a *= a;
  if (exp % 2 == 1) {
    a *= base;
  }

  return a;
}

template <class T, int M>
MInt<T, M> Inv(const MInt<T, M> &n) {
  return Pow(n, static_cast<T>(M - 2));
}
}  // namespace mod

const int md = 1e9 + 7;
using MInt = mod::MInt<long long, md>;
class BinCoef {
  vector<MInt> f;

 public:
  BinCoef(int n) : f(n + 1) {
    f[0] = f[1] = 1;
    for (int i = 2; i <= n; i++) {
      f[i] = MInt(i) * f[i - 1];
    }
  }

  MInt NCM(int n, int m) {
    if (n < m) {
      return 0;
    }
    return f[n] * mod::Inv(f[m] * f[n - m]);
  }

  MInt HCM(int n, int m) { return NCM(n + m - 1, m); }
};

int main(int argc, const char *argv[]) {
  int s;
  cin >> s;
  BinCoef bc(s);
  MInt ans(0);

  for (int i = 1; i <= s; ++i) {
    if (i * 3 > s) {
      break;
    }

    int s2 = s - 3 * i;
    ans += bc.NCM(s2 + i - 1, i - 1);
  }
  cout << ans.Get() << '\n';
  return 0;
}

Measured memory_bytes: 3636