akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include<stack>
#include <queue>
#include<map>
#include <set>
using namespace std;
#define int long long
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define INF 1000000007
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2)*pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int jo(int n) {
	int ans = 1;
	rep(i, n) {
		ans *= 2;
	}
	return ans;
}
signed main() {
	string s;
	cin >> s;
	rep(i, s.size()) {
		if (s[i] == ',') {
			cout << ' ';
		}
		else cout <<s[i];
	}
	cout << endl;
}


Measured memory_bytes: 256
N, M, X, Y = list(map(int,input().split(' ')))
x = list(map(int,input().split(' ')))
y = list(map(int,input().split(' ')))

ans = 'War'
for i in range(X,Y+1):
  if  max(x) < i <= min(y) and X < i <=Y:
    ans ='No War'
    break
    

print(ans)    
    
    
    
    
  


Measured memory_bytes: 2940
#include<iostream>
#include<algorithm>
#include<fstream>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<cctype>
#include<cmath>
#include<vector>
#include<climits>
#include<queue>

using namespace std;


int main()
{
    int i,ans,mask,d,g;
    int p[11],c[11];
    scanf("%d%d",&d,&g);
    for(i=0; i<d; ++i)
        scanf("%d%d",&p[i],&c[i]);
    ans=1e9;
    for(mask=0; mask < pow(2,d); ++mask)
    //for(mask=0; mask < (1 << d); ++mask)
    {
        int s=0,num=0,rest_max=-1;
        for(i=0; i<d; ++i)
        {
            int oo=mask/pow(2,i);
            if(oo%2==1)
            //if(mask >> i &1)
            {
                s+=100*(i+1)*p[i]+c[i];
                num+=p[i];
            }
            else
            {
                rest_max=i;
            }
        }
        if(s<g)
        {
            int s1=100*(rest_max+1);
            int need=(g-s+s1-1)/s1;
            if(need>=p[rest_max])
                continue;
            num+=need;
        }
        ans=min(ans,num);
    }
    printf("%d\n",ans);
    return 0;
}


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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

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

	int ans = 0;
	for (int i = 0; i < s.size()/2; ++i) {
		if (s[i] != s[s.size() - i - 1])
			++ans;
	}

	cout << ans << endl;

	return 0;
}

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

int main(){
    ll N;
    cin >> N;
    ll ans = N*(N-1)/2;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
let n=read_int()open Array;;let a=init n(fun _->Scanf.scanf"%d "(fun e->e))and b=make n 0and c=make 10001 0;;iter(fun e->c.(e)<-c.(e)+1)a;iteri(fun i _->if i<>0then c.(i)<-c.(i)+c.(i-1))c;for i=n-1downto 0do b.(c.(a.(i))-1)<-a.(i);c.(a.(i))<-c.(a.(i))-1;done;print_int b.(0);for i=1to n-1do print_string" ";print_int b.(i);done;print_newline()

Measured memory_bytes: 36196
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::{i32, i64, u32, u64, usize, f64};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::mem::{swap};

fn main() {
    input! {
        n: i32,
        y: i32,
    }
    for i in 0..y / 10000 + 1 {
        for j in 0..(y - 10000*i) / 5000 + 1 {
            if 10000*i + 5000*j + 1000*(n - i - j) == y {
                println!("{} {} {}", i, j, n - i - j);
                return;
            }
        }
    }
    println!("-1 -1 -1");
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    ll n;cin>>n;
    ll sum=0;
    ll a[n];
    rep(i,n){
        cin>>a[i];
        sum^=a[i];
    }
    rep(i,n) cout<<(sum^a[i])<<(i+1==n?"\n":" ");

    return 0;
}


Measured memory_bytes: 5176
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
  ifstream cin("in.txt");
#endif
  string S;
  while (cin >> S) {
    int a = 0, b = 0;
    for (char c : S) {
      if (c == '0') {
        ++a;
      } else {
        ++b;
      }
    }
    int res = S.size() - abs(a - b);
    cout << res << endl;
  }
  return 0;
}


Measured memory_bytes: 512
n = int(input())
a = list(map(int, input().split()))

check = True
for i in range(n):
    if a[i] % 2 == 0 and (a[i] % 3 != 0 and a[i] % 5 != 0):
        check = False
if check:
    print('APPROVED')
else:
    print('DENIED')


Measured memory_bytes: 2940
#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>

intmax_t f(std::vector<std::pair<intmax_t, intmax_t>> const& xv, intmax_t c) {
  size_t n = xv.size();
  intmax_t res = 0;
  std::vector<intmax_t> lf(n+1), rg(n+1);
  {
    intmax_t acc = 0;
    for (size_t i = 0; i < n; ++i) {
      acc += xv[i].second;
      lf[i+1] = std::max(lf[i], acc - 2*xv[i].first);
      res = std::max(res, acc-xv[i].first);
    }
  }
  {
    intmax_t acc = 0;
    for (size_t i = n; i--;) {
      acc += xv[i].second;
      rg[i] = std::max(rg[i+1], acc - (c-xv[i].first));
    }
  }
  for (size_t i = 0; i <= n; ++i)
    res = std::max(res, lf[i]+rg[i]);

  return res;
}

int main() {
  size_t n;
  intmax_t c;
  scanf("%zu %jd", &n, &c);

  std::vector<std::pair<intmax_t, intmax_t>> xv(n);
  for (auto& p: xv)
    scanf("%jd %jd", &p.first, &p.second);

  intmax_t res = f(xv, c);
  std::reverse(xv.begin(), xv.end());
  for (auto& p: xv) p.first = c - p.first;
  res = std::max(res, f(xv, c));
  printf("%jd\n", res);
}


Measured memory_bytes: 3328
// Copyright (C) 2017 Sayutin Dmitry.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; version 3

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; If not, see <http://www.gnu.org/licenses/>.

#include <iostream>
#include <vector>
#include <stdint.h>
#include <algorithm>
#include <set>
#include <map>
#include <array>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <string>
#include <assert.h>
#include <iterator>
#include <cstdint>
#include <cinttypes>
#include <string.h>
#include <random>
#include <numeric>
#include <tuple>


using std::cin;
using std::cout;
using std::cerr;

using std::vector;
using std::map;
using std::array;
using std::set;
using std::string;

using std::pair;
using std::make_pair;

using std::min;
using std::abs;
using std::max;

using std::unique;
using std::sort;
using std::generate;
using std::reverse;
using std::min_element;
using std::max_element;

#ifdef LOCAL
#define LASSERT(X) assert(X)
#else
#define LASSERT(X) {}
#endif

template <typename T>
T input() {
    T res;
    cin >> res;
    LASSERT(cin);
    return res;
}

template <typename IT>
void input_seq(IT b, IT e) {
    std::generate(b, e, input<typename std::remove_reference<decltype(*b)>::type>);
}

#define SZ(vec)         int((vec).size())
#define ALL(data)       data.begin(),data.end()
#define RALL(data)      data.rbegin(),data.rend()
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define TYPEMIN(type)   std::numeric_limits<type>::min()

#define pb push_back
#define eb emplace_back

int solve(const string& s) {
    vector<int> len = {0};
    vector<char> symb;

    for (char ch: s)
        if (ch == 'x')
            len.back() += 1;
        else
            symb.push_back(ch), len.push_back(0);

    int l = 0, r = SZ(symb) - 1;
    for (; l < r; ++l, --r)
        if (symb[l] != symb[r])
            return -1;
    
    l = 0;
    r = SZ(len) - 1;

    int ans = 0;
    for (; l < r; ++l, --r)
        ans += max(len[l], len[r]) - min(len[l], len[r]);
    return ans;
}

int main() {
    std::iostream::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    
    // code here.
    string s = input<string>();
    
    cout << solve(s) << "\n";
    
    return 0;
}


Measured memory_bytes: 972
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		Console.WriteLine("{0}",n>=30?"Yes":"No");
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),int.Parse);}
	public int[] Ia3(int a){return Array.ConvertAll((Console.ReadLine()+" "+a.ToString()).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),long.Parse);}
	public long[] La3(int a){return Array.ConvertAll((Console.ReadLine()+" "+a.ToString()).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 27352
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <complex>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define EPS 1e-8
#define DEB 0


const double inf = 9999999999.0;
double dp[1<<8][32];
int node[32][32];

class state{
  public:
	int id,ticket;
	double cost;
	state(int _id, int _t, double _c){
		id = _id;
		ticket = _t;
		cost = _c;
	}
	bool operator<(const state& a)const{
		return cost > a.cost;
	}
};

int main(){
	int n,m,p,s,g;
	int ticket[8];
	while(scanf("%d%d%d%d%d",&n,&m,&p,&s,&g),n|m|p|s|g){
		rep(i,1<<8)rep(j,32)dp[i][j]=inf;
		rep(i,32)rep(j,32)node[i][j]=0;
		rep(i,n){
			scanf("%d",ticket+i);
		}
		rep(i,p){
			int x,y,z; scanf("%d%d%d",&x,&y,&z);
			node[x][y] = node[y][x] = z;
		}
#if DEB		
		rep(i,n){
			printf("ticket:%d\n",ticket[i]);
		}
		rep(i,m){
			rep(j,m){
				printf("%d ",node[i][j]);
			}
			puts("");
		}
		puts("");
#endif		
		
		priority_queue<state> q;
		q.push(state(s, 0, 0.0));
		double ans = inf;
		while( !q.empty() ){
			int id = q.top().id;
			int ti = q.top().ticket;
			double cost = q.top().cost;

			if( cost > ans )break;
			q.pop();
			REP(i,1,m+1)if( node[id][i] ){
				rep(j,n)if( !((1<<j)&ti) ){
					double dist = (double)node[id][i]/(double)ticket[j];
					if( dp[ti|(1<<j)][i] > dist+cost ){
						dp[ti|(1<<j)][i] = dist+cost;
						q.push(state(i, ti|(1<<j), dist+cost));
						if( i==g ){
							if( ans > dist+cost ){
								ans = dist+cost;
							}
						}
					}
				}
			}
		}
		if( ans==inf ){
			puts("Impossible");
		}else{
			printf("%lf\n",ans);
		}
	}
	return 0;
}

Measured memory_bytes: 1816
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> ii;
typedef tuple<int,int,int> iii;
#define ll long long
#define iiMPQ priority_queue<ii,vector<ii>,greater<ii> >
#define MPQ priority_queue<int,vector<int>,greater<int> >
#define PQ priority_queue<int>
#define iiPQ priority_queue<ii>
#define US unordered_set<int>
#define UMS unordered_multiset<int>
#define UM unordered_map<int>
#define iiUS unordered_set<ii>
#define ST stack<int>
#define MS multiset<int>
#define scan1(n) cin>>n
#define scan2(a,b) cin>>a>>b
#define scan3(a,b,c) cin>>a>>b>>c
#define print(n) cout<<n
#define println(n) cout<<n<<"\n"
#define vi vector<int>
#define vii vector<ii>
#define viii vector<iii>
#define fi first
#define se second
#define REP(i,n) for(int i=0;i<n;++i)
#define REPR(i,s,e) for(int i=s;i<e;++i)
#define REPS(i,s,e,st) for(int i=s;i<e;i+=st)
#define rep(i,n) for(int i=n-1;i>=0;--i)
#define repr(i,s,e) for(int i=s;i>=e;--i)
#define reps(i,s,e,st) for(int i=s;i>=e;i-=st)
#define SET(arr,k) memset(arr,k,sizeof arr)
#define speed ios::sync_with_stdio(0); cin.tie(0);
#define mp make_pair
#define pb push_back
#define Qu queue
#define Vt vector
#define Dq deque
#define prints(n) cout << n << " ";

void m1(){
  int n, k, t;
  cin >> n >> k >> t;
  cout << (n+k-1)/k * t;
}
/* 
void m2(){
  int t; scan1(t);
  while(t--) m1();
}
*/
 
signed main(){
  speed;
  //freopen("in.txt","r",stdin);
  m1();
  //m2();
}


Measured memory_bytes: 3636
#include <stdio.h>

int main(void){
  int A,B,C;
  scanf("%d",&A);
  scanf("%d",&B);
  scanf("%d",&C);
  if(A+B<C){
    printf("%d\n",A+B+B+1);
  }else{
    printf("%d\n",B+C);
  }
}


Measured memory_bytes: 128
#include <cstdio>
#include <cstring>

#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cassert>

using namespace std;

#define SZ(a) int((a).size())
#define REP(i,n) for(int i=0,_n=(n);i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)

typedef long long llong;
typedef vector<int> VI;
typedef vector<VI> VVI;


double W[1004][1004];

llong dist2(llong x0, llong y0, llong x1, llong y1) {
   return (x0-x1)*(x0-x1) +
          (y0-y1)*(y0-y1);
}

struct Circle {
   int x, y, r;
};

struct State {
   int node;
   double dist;
   bool operator<(const State& s) const {
      if (dist != s.dist) return dist > s.dist;
      return node < s.node;
   }
};

double dijkstra(int N, int src, int dst) {
   vector<double> D(N, 1e14);
   D[src] = 0;
   priority_queue<State> pq;
   pq.push({src, 0.0});
   while (!pq.empty()) {
      State cur = pq.top(); pq.pop();
      if (cur.node == dst)
         return D[dst];
      if (cur.dist > D[dst])
         continue;
      for (int v = 0; v < N; ++v) {
         State nxt = {v, D[cur.node] + W[cur.node][v]};
         if (nxt.dist < D[nxt.node]) {
            D[nxt.node] = nxt.dist;
            pq.push(nxt);
         }
      }
   }
   return 1e14;
}

int main(int argc, char* argv[]) {
   int xs, ys, xt, yt;
   scanf("%d %d %d %d", &xs, &ys, &xt, &yt);

   vector<Circle> circles;
   circles.push_back({xs, ys, 0});
   circles.push_back({xt, yt, 0});

   int N;
   scanf("%d", &N);
   for (int i = 0; i < N; ++i) {
      int x, y, r;
      scanf("%d %d %d", &x, &y, &r);
      circles.push_back({x, y, r});
   }

   REP(i, SZ(circles)) {
      REP(j, i) {
         llong sum_radii = circles[i].r + circles[j].r;
         llong center_dist2 = dist2(circles[i].x, circles[i].y,
                                    circles[j].x, circles[j].y);
         long double cost = center_dist2 <= sum_radii*sum_radii ?
                          0.0 :
                          sqrt((long double) center_dist2) - sum_radii;
      // fprintf(stderr, "%d %d %.6f\n", i, j, cost);
         if (cost < 0)
            cost = 0.0;
         W[i][j] = W[j][i] = cost;
      }
   }

   double res = dijkstra(SZ(circles), 0, 1);
   printf("%.10f\n", res);

   return 0;
}


Measured memory_bytes: 12280
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

const int mod = 1000000007;
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 { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
mint fact(int n) {
  if(n == 1 || n == 0) return 1;
  mint res = n;
  return res * fact(n - 1);
}

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n = 1) : n(n), f(n + 1) {
    f[0] = f[1] = -1;
    for(ll i = 2; i <= n; ++i) {
      if(f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for(ll j = i * i; j <= n; j += i) {
        if(!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x; }
  vector<int> factorList(int x) {
    vector<int> res;
    while(x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if(fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for(int p : fl) {
      if(res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
};

int main() {
  ll n;
  cin >> n;
  vl a(n);
  rep(i, n) cin >> a[i];
  Sieve s(1e6 + 1);
  map<ll, ll> mp;
  rep(i, n) {
    auto p = s.factor(a[i]);
    for(auto v : p) mp[v.first] = max(mp[v.first], ll(v.second));
  }
  mint l = 1;
  for(auto v : mp) {
    mint f = v.first;
    l *= f.pow(v.second);
  }
  mint ans = 0;
  rep(i, n) {
    mint b = 1;
    b /= a[i];
    ans += b;
  }
  ans *= l;
  cout << ans << endl;
}

Measured memory_bytes: 5112
#include <iostream>
#include <cstring>


using namespace std;

int main(void){
    int K;
    int i,l;
    string S;
    string Sout;
    cin>>K;
    cin>>S;

    l=0;
    while(S[l]!='\0'){
        l++;
    }

    if(l <= K){
        cout<<S<<endl;
    }else{
        cout<<S.erase(K)+"..."<<endl;
        }
        return 0;
}
    

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

typedef long long ll;


int main() {
	ll k;
	cin >> k;
	
	ll ans = -1;
	
	ll a = 7;
	for (ll i = 1; i < 10e6 + 100; i++) {
		if (a % k == 0) {
			ans = i;
			break;
		}
		a = (a * 10 + 7) % k;
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}

int main(){
	int N;
	cin>>N;
	vector<int> ds;
	map<int,int> cnt;
	rep(i,N){
		int d;
		cin>>d;
		if(d==0){
			puts("0");
			return 0;
		}
		ds.pb(d);
		cnt[d]++;
	}
	sort(all(ds));
	ds.erase(unique(ds.begin(),ds.end()),ds.end());

	for(auto it:cnt) if(it.sc>=3){
		puts("0");
		return 0;
	}

	N = ds.size();
	int ans = 0;
	rep(i,1<<N){
		vector<int> v;
		v.pb(0);
		rep(j,N){
			if(cnt[ds[j]]==2){
				v.pb(ds[j]);
				v.pb(24-ds[j]);
			}else{
				if((i>>j)&1){
					v.pb(ds[j]);
				}else{
					v.pb(24-ds[j]);
				}
			}
		}
		int s = 24;
		int K = v.size();
		rep(i,K) rep(j,i){
			chmin(s,min(abs(v[i]-v[j]),24-abs(v[i]-v[j])));
		}
		chmax(ans,s);
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 256
///                                                     ببِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم
#include <bits/stdc++.h>
//#define off  exit( 0 )
//#define cn   continue
#define rt   return/*
#define sc   scanf
#define pr   printf
#define pb   push_back
#define pf   push_front
#define p_f  pop_front
#define p_b  pop_back
#define ff   first
#define ss   second
#define vec  vector
#define gcd  __gcd
#define pi   acos( -1 )*/
#define ll   long long
/*#define ld   long double
#define N    2256
#define M    1000000007
#define I    1000000000000000000
#define pdd  pair < ld, ld >
#define pll  pair < ll, ll >
#define pii  pair < int, int >
#define rep( a, b, c, d )  for( int a = b; a <= c; a += d )
#define rvv( a, b, c, d )  for( int a = b; a >= c; a -= d )
#define en                 printf( "\n" )
#define sqr( a )           a * a
#define all( c )           c.begin(), c.end()
#define srt( c )           sort( all( c ) )
#define rev( c )           reverse( all( c ) )
#define srtr( c )          sort( c.rbegin(), c.rend() )
#define numcounts          __builtin_popcount
#define mxn( x, y, z )     max( x, min( y, z ) )
#define mnx( x, y, z )     min( x, max( y, z ) )
const int dx[ ] = { 1, -1, 0, 0 };
const int dy[ ] = { 0, 0, -1, 1 };*/
using namespace std;
ll ttt = 1;
ll a, b, c;
void solve()
{
    cin >> a >> b >> c;
    if(a + b + c >= 22)cout << "bust";
    else cout << "win";
}
int main()
{
    //sc( "%I64d", &ttt );
    for(int i = 0; i < ttt; i ++ )
        solve();
}


Measured memory_bytes: 256
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif

#include <iostream>
#include <vector>
#include <algorithm>
#include <chrono>
using namespace std;
using namespace chrono;

//  https://ja.wikipedia.org/wiki/Xorshift
int xor64(void) {
	static unsigned long long x = 88172645463325252ULL;
	x ^= x << 13;
	x ^= x >> 7;
	x ^= x << 17;
	return int(x & 0x7fffffff);
}

int main()
{
	//  入力
	int D;
	cin >> D;
	vector<int> C(26);
	for (int &c : C)
		cin >> c;
	vector<vector<int>> S(D, vector<int>(26));
	for (auto &s : S)
		for (auto &x : s)
			cin >> x;

	auto start = system_clock::now();

	//  選んだコンテスト
	vector<int> T(D, -1);

	int score = 0;
	for (int t = 0; t < 26; t++)
		score -= C[t] * D*(D + 1) / 2;

	//  d日目にコンテストtを開く
	auto add = [&](int d, int t)
	{
		int d0 = d;
		while (d0 >= 0 && T[d0] != t)
			d0--;
		int d1 = d;
		while (d1 < D && T[d1] != t)
			d1++;
		score += C[t] * (d - d0)*(d1 - d);
		score += S[d][t];
		T[d] = t;
	};

	//  d日目のコンテストを止める
	auto remove = [&](int d)
	{
		int t = T[d];
		T[d] = -1;
		int d0 = d;
		while (d0 >= 0 && T[d0] != t)
			d0--;
		int d1 = d;
		while (d1 < D && T[d1] != t)
			d1++;
		score -= C[t] * (d - d0)*(d1 - d);
		score -= S[d][t];
	};

	for (int d = 0; d < D; d++)
		add(d, d % 26);

	double time = 0.0;
	double limit = 1.8;

	int step;
	for (step = 0; time < limit; step++)
	{
		if (step % 10000 == 0)
			time = duration_cast<microseconds>(system_clock::now() - start).count() * 1e-6;

		if (step % 2 == 0)
		{
			//  1日のコンテストの種類を変えてみる
			int d = xor64() % D;
			int t = xor64() % 26;
			int old_score = score;
			int old_t = T[d];
			remove(d);
			add(d, t);

			//  悪くなったら戻す
			if (score < old_score)
			{
				remove(d);
				add(d, old_t);
			}
		}
		else
		{
			//  1週間以内のコンテストを交換してみる
			int d0 = xor64() % D;
			int d1 = d0 + xor64() % 15 - 7;
			if (d1 != d0 && 0 <= d1 && d1 < D)
			{
				int old_score = score;
				int t0 = T[d0];
				int t1 = T[d1];
				remove(d0);
				remove(d1);
				add(d0, t1);
				add(d1, t0);

				//  悪くなったら戻す
				//  ただし、ある程度までは許容する
				//  許容範囲は時間とともに狭める（焼きなまし）
				if (score < old_score - int(10000 * (limit - time) / limit))
				{
					remove(d0);
					remove(d1);
					add(d0, t0);
					add(d1, t1);
				}
			}
		}
	}

	for (int t : T)
		cout << t + 1 << endl;

	cerr << "score: " << max(0, score + 1000000) << endl;
	cerr << "step: " << step << endl;
}


Measured memory_bytes: 3664
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ff first
#define ss second
#define eb emplace_back
#define MP make_pair
#define pb push_back
#define pf push_front
#define ins insert
#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define mset(m,v) memset(m,v,sizeof(m))
#define tr(c,it) for(auto it=c.begin();it!=c.end();it++)
#define fr(i,n) for(lli i=0;i<(n);i++)
#define inc(i,a,b) for(lli i=a;i<=b;i++)
#define dec(i,a,b) for(lli i=a;i>=b;i--)
#define fr2(i,n) for(int i=0;i<(n);i++)
#define inc2(i,a,b) for(int i=a;i<=b;i++)
#define dec2(i,a,b) for(int i=a;i>=b;i--)
#define ymin(a,b)  (a=min((a),(b)))
#define ymax(a,b)  (a=max((a),(b)))
#define sz(x) (lli)(x).size()
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr<< *it << " = " << a << endl;
	err(++it, args...);
}

typedef long long int lli;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<lli,lli> plli;
typedef vector<lli> vlli;
typedef vector<int> vi;
//typedef  vector<vector<lli> >ncr(1001,vector<lli>(1001,0))
typedef vector<plli> vplli;
long long MOD=1000000009;
#define addm(x,y) (x+y>=MOD? (x+y-MOD):(x+y))
int main()
{
	// 	#ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	IOS
	
	// int t;
	// cin>>t;
	// for(int i=1;i<=t;i++)
	// {
	// 	cout<<"Case #"<<i<<": ";
	// 	solve();

	// }
	
	lli n,m,tt;
	cin>>n>>m>>tt;
	//vector<plli>tar(tt);
	lli cnt1[n+1]={0},cnt2[m+1]={0};
	set<plli>st;
	fr(i,tt)
	{
		lli x,y;
		cin>>x>>y;
		x--;
		y--;
		cnt1[x]++;
		cnt2[y]++;
		st.insert({x,y});
		///tar[i]={x,y};
	}
	lli mx1=0,mx2=0;
	vector<lli> a1,a2;
	fr(i,n)
	{
		if(cnt1[i]>=mx1)
		{
			//a1.eb(i);
			mx1=cnt1[i];

		}


	}
	fr(i,m)
	{
		if(cnt2[i]>=mx2)
		{
			//a2=i;
			mx2=cnt2[i];

		}


	}
	fr(i,n)
	{
		if(cnt1[i]==mx1)
			a1.eb(i);
	}
	fr(i,m)
	{
		if(cnt2[i]==mx2)
			a2.eb(i);
	}
	// for(auto i:a1)
	// 	cout<<i<<" ";
	// cout<<endl;
	// for(auto i:a2)
	// 	cout<<i<<" ";

	// lli f=0;
	// fr(i,tt)
	// {
	// 	if(tar[i].ff==a1 && tar[i].ss==a2)
// 		{
// 			f=1;
// 			break;
// 		}
// 	}
// 	if(f==0)
// 	cout<<mx1+mx2<<endl;
// else
// 	cout<<mx1+mx2-1<<endl;
	for(lli i=0;i<sz(a1);i++)
	{
		for(lli j=0;j<sz(a2);j++)
		{
			if(st.find({a1[i],a2[j]})==st.end())
			{
				cout<<mx1+mx2<<endl;
				return 0;
			}
		}
	}
	cout<<mx1+mx2-1<<endl;

	
	
	
}


Measured memory_bytes: 35008
#include <stdio.h>

#define yukichi 10000
#define higuchi 5000
#define noguchi 1000
     
int main(void){
     
  int N,M;
     
  scanf("%d %d",&N, &M);
  int i=0,j=0,k=N;
  int res = 0;
  char flag=0;
     
  while( k != -1 ){
    j = res;
    i = 0;
    while( j != -1 ){
      if( M == (yukichi*i) + (higuchi*j) + (noguchi*k) ){
    	flag = 1;
    	break;
      }
      j--;
      i++;
    }
    if( flag == 1){
      break;
    }
    k--;
    res = N - k;
  }
     
  if(flag != 1){
    i = -1;
    j = -1;
    k = -1;
  }
      
  printf("%d %d %d\n",i,j,k);
     
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define f(i,x,n) for(int i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 5e5 + 10;
const int LINF = LLONG_MAX;

pair<int,int>a[N];
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    map<int,int>maps;
    f(i,1,n+1){
        cin >> a[i].first;
        a[i].second = i;
    }
    int ans = 0;
    f(i,1,n+1){
        ans += maps[i-a[i].first];
        maps[i + a[i].first]++;
    }
    cout << ans << "\n";
    return 0;
}
 

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

#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define pb(n) push_back(n);


main() {
    int a;
    cin >> a;
    if (a==3||a==5||a==7) cout << "YES" << endl;
    else cout << "NO" << endl;
}


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


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


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

ll gcd(ll x,ll y){
    while(y > 0){
        ll tmp = y;
        y = x % y;
        x = tmp;
    }
    return x;
}

ll lcm(ll x, ll y){
    return x / gcd(x,y) * y;
}

int main(){
    ll X;
    cin>>X;
    cout<<lcm(X,360)/X<<endl;
    return 0;
}

Measured memory_bytes: 3632
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

arr = [read_int()[0] for _ in range(5)]
arm = [arr[i] % 10 for i in range(5)]

def solve():
    ans = 0
    for i in range(5):
        ans += arr[i] - arm[i]
    arm.sort()
    initial = True
    for i in range(5):
        if arm[i] == 0:
            continue
        if initial:
            initial = False
            ans += arm[i]
        else:
            ans += 10
    return ans

if __name__ == "__main__":
    print(solve())


Measured memory_bytes: 3768
#include <stdio.h>

int main(void){
  int a[3] = { 0 };
  int b, c, temp;
  scanf("%d %d", &b, &c);
  a[0] = b + c;
  a[1] = b - c;
  a[2] = b * c;
  for(int i = 0; i < 3; i++){
    for(int j = i + 1; j < 3; j++){
      if(a[i] < a[j]){
	temp = a[i];
	a[i] = a[j];
	a[j] = temp;
      }
    }
  }
  printf("%d\n", a[0]);
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,s,n) for(int i=s;i<n;i++)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define int long long
using namespace std;
using P=pair<int,int>;
using Graph=vector<vector<int>>;
using ll=long long;


ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}
bool root(string s){
    int n=s.length();
    if(n==2){
        if(s[0]==s[1]){
            return true;
        }
        else return false;
    }
    if(n==3){
        if(s[0]==s[2]){
            return true;
        }
        else return false;
    }
 
    return false;
}
 
 
//深さ優先
vector<int> seen;
vector<ll> h;
 
//普通の深さ優先探索seenを返す感じ
void dfs(const Graph &G,int v){

    seen[v] = 0; //v探索済み
 
    P good=make_pair(v,h[v]);
    for(auto next_v :G[v]){
        if(seen[next_v]!=-1) continue;//もう探索していた
        if(h[next_v]>good.second){
            good=make_pair(next_v,h[next_v]);
        }
        dfs(G,next_v);
    }
 
    if(!(h[v]==good.second && v==good.first)){
        seen[good.first]=1;
    }
}


int n;

void dfs(string s, char mx){
    if(s.length()==n){
        cout<<s<<endl;
    }else{
        for(char c='a';c<=mx;c++){
            dfs(s+c,((c==mx) ? (char)(mx+1) : mx));
        }
    }
}


int mod = 1000000007;
int m,k;

int dfs(int cnt,int pred, int sk){
    int sum=0;
    if(cnt==n){
        return 1LL;
    }
    for(int i=1;i<=m;i++){
        if(i==pred){
            if(sk+1<=k){
                sum+=dfs(cnt+1,i,sk+1)%mod;
            }
        }else{
            sum+=dfs(cnt+1,i,sk)%mod;
        }
    }

    return sum;
}

int num(int n,int a,int b){
    return n-(n/a)-(n/b)+(n/(a/gcd(a,b)*b));
}

vector<pair<int,int>> soinsuu(int n){
    vector<pair<int,int>> ret;
    for(int i=2;i*i<=n;i++){
        if(n%i !=0) continue;
        int ex=0;
        while(n%i ==0){
            ex++;
            n /= i; //n変更することで、それ以降の約数で割り切れることはない
        }
        ret.push_back(make_pair(i,ex));
    }
    //nが素数だった場合
    if(n!=1) ret.push_back(make_pair(n,1));
    return ret;
}


signed main(){ 
    string t;
    cin>>t;
    int l=t.size();

    int res=0;
    char pred=t[0];
    if(pred=='?'){
        res++;
        t[0]='D';
    }

    for(int i=1;i<l;i++){
        if(t[i]=='P'){
            t[i]='P';
        }else if(t[i]=='D'){
            res++;
            if(t[i-1]=='P') res++;
            t[i]='D';
        }else if(t[i]=='?'){
            res++;
            if(t[i-1]=='P') res++;
            t[i]='D';
        }
    }

    cout<<t<<endl;
}  

Measured memory_bytes: 3760
// @supudo
// clang++ -Wall -std=c++14 atcoder_abc129_balance.cpp -o ./build/atcoder_abc129_balance -DLOCAL

#include <iostream>
#include <vector>
#include <string>
#include <sstream>

#define loop(var, from, to) for (int var=from; var<to; ++var)

using namespace std;

int main() {
  int elements;
  vector<int> times;
#ifdef LOCAL
  cout << "Enter number of elements:" << endl;
#endif
  cin >> elements;
  cin.ignore();

#ifdef LOCAL
  cout << "Enter weights:" << endl;
#endif
  string line;
  getline(cin, line, '\n');
  stringstream nss(line);
  int number;
  vector<int> weights;
  while (nss >> number)
    weights.push_back(number);
  cout << endl;

  int result = 99999999;
  for (int i=0; i<elements; i++) {
    int wsum1 = 0;
    int wsum2 = 0;
    for (int j=0; j<i; j++) {
      wsum1 += weights[j];
    }
    for (int j=i; j<elements; j++) {
      wsum2 += weights[j];
    }
    result = min(result, abs(wsum1 - wsum2));
  }

#ifdef LOCAL
  cout << "Final result:" << endl;
#endif
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
N = int(input())
lst = list(map(int, input().split()))

a = sorted(lst)
center_m = a[N//2 - 1]
center_p = a[N//2]

#print (center_m, center_p)

for i in lst:
    if i <= center_m:
        print (center_p)
    else:
        print (center_m)

Measured memory_bytes: 25556
import math
import itertools
from itertools import combinations
N = int(input())
A = [[]] * N
A = input().split()
list = [int(n) for n in A]
a = 0
for v in itertools.combinations(list, 3):
    u = sorted(v)
    if u[0] != u[1] != u[2]:
        if u[2] < u[1]+u[0] and u[1]-u[0] < u[2]:
            a = a+1
        else:
            continue
    else:
        continue
print(a)

Measured memory_bytes: 9072
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        String line = bufferedReader.readLine();
        String[] honList = new String[]{"2", "4", "5", "7", "9"};
        String[] ponList = new String[]{"0", "1", "6", "8"};
        String[] bonList = new String[]{"3"};
        for (String h : honList)
            if (line.endsWith(h)) {
                System.out.println("hon");
                return;
            }
        for (String p: ponList)
            if (line.endsWith(p)) {
                System.out.println("pon");
                return;
            }
        for (String b : bonList)
            if (line.endsWith(b)) {
                System.out.println("bon");
                return;
            }
    }
}


Measured memory_bytes: 32496
//includes
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#include<numeric>
#include<assert.h>
#include<cstring>
#include<unordered_map>
#include<bitset>

//macros and consts
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define FORE(i,a) for(auto &i : a)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define accm accumulate
#define Fi first
#define Se second
#define INF 1e9
#define llINF (1LL<<60)
#define mINF -1e9
#define mllINF -(1LL<<60)
#define endl "\n"
#define CONT continue
#define BRK break
#define modulo(n, m) (((n)%(m)+(m))%m)

//shorter types
using namespace std;
using ll = long long;
using vi = std::vector<int>;
using vc = std::vector<char>;
using vll = std::vector<long long>;
using vs = std::vector<string>;
using Mi = map<int,int>;
using Mll = map<ll,ll>;
using UMi = unordered_map<int,int>;
using UMll = unordered_map<ll,ll>;
using Pi = pair<int,int>;
using Pll = pair<ll,ll>;
using vPi = vector<Pi>;
using vPll = vector<Pll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using pqgi = priority_queue<int,vector<int>,greater<int>>;
using pqsi = priority_queue<int,vector<int>,less<int>>;
using pqgll = priority_queue<int,vector<int>,greater<int>>;
using pssll = priority_queue<int,vector<int>,less<int>>;
template<class T>
using vec = vector<T>;
#define int long long


//here begins your code
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  string S,T;
  cin >> S >> T;
  cout << T + S << endl;
  //check types
  //do not eb if you resize
  //resize before you access by idx
  return 0;
} 

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
A_new = sorted(A, reverse=True)
A_feel = []
sum = 0
for i in range(N):
  if A_feel == []:
    count = 1
  else:
    count = 2
  for j in range(count):
    A_feel.append(A_new[i])

for i in range(N-1):
  sum += A_feel[i]
  
print(sum)

Measured memory_bytes: 112828
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,f[200009],lef,rig,mid,pas;
bool bo[200009];
int main(){
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>a;
	a=a*2-1;
	for(b=1; b<=a; b++) cin>>f[b];
	lef=0;
	rig=a+1;
	while(1){
		if(lef+1>=rig) break;
		mid=(lef+rig)/2;
		//cout<<mid<<endl;
		for(b=1; b<=a; b++) bo[b]=!(f[b]<mid);
		if(bo[a/2+1]==bo[a/2]||bo[a/2+1]==bo[a/2+2]){
			if(bo[a/2+1]==0){
				rig=mid;
			}else{
				lef=mid;
				pas=mid;
			}
			continue;
		}
		c=0;
		for(b=2; b<=a; b++){
			if(bo[b]==bo[b-1]){
				c=1;
				break;
			}
		}
		d=0;
		if(c==0){
			if((a+1)/2%2==0){
				d=!bo[a/2+1];
			}else{
				d=bo[a/2+1];
			}
			if(d==0){
				rig=mid;
			}else{
				lef=mid;
				pas=mid;
			}
		}else{
			c=a+4;
			d=0;
			for(b=2; b<=a/2+1; b++){
				if(bo[b]==bo[b-1]){
					c=a/2+1-b;
					d=bo[b];
				}
			}
			for(b=a-1; b>=a/2+1; b--){
				if(bo[b]==bo[b+1]){
					if(b-a/2-1<c){
						c=b-a/2-1;
						d=bo[b];
					}
				}
			}
			if(d==0){
				rig=mid;
			}else{
				lef=mid;
				pas=mid;
			}
		}
	}
	cout<<pas;
	return 0;
}

Measured memory_bytes: 1280
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	LL n; cin >> n;
	vector<LL> a(5);

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

	LL mi = INF2;
	LL idx = 0;
	for (int i = 0; i < 5; i++) {
		if (a[i] < mi) {
			mi = a[i];
			idx = i;
		}
	}

	if (mi >= n) {
		cout << 5 << endl;
		return 0;
	}

	LL cnt = (LL)(n + mi - (LL)1) / mi;
	LL ans = (LL)4+ cnt;

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gya[200010];
ll kai[200010];
ll beki(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k%2==1){
            ret*=now;
            ret%=mod;
        }
        now*=now;
        now%=mod;
        k/=2;
    }
    return ret;
}
ll gyaku(ll n){
    return beki(n,mod-2);
}
void nckinit(ll n){
    kai[0]=1;
    kai[1]=1;
    for(int i=2;i<=n;i++){
        kai[i]=kai[i-1]*i;
        kai[i]%=mod;
    }
    gya[n]=gyaku(kai[n]);
    for(int i=n-1;i>=1;i--){
        gya[i]=gya[i+1]*(i+1);
        gya[i]%=mod;
    }
    gya[0]=1;
}
ll nck(ll n,ll k){
    if(k<0)return 0;
    if(k==0||n==k)return 1;
    ll ret=kai[n];
    ret*=gya[n-k];
    ret%=mod;
    ret*=gya[k];
    ret%=mod;
    return ret;
}
ll npk(ll n,ll k){
    if(k<0)return 0;
    if(k==0)return 1;
    ll ret=kai[n];
    ret*=gya[n-k];
    ret%=mod;
    return ret;
}
int main(){
    string s;cin>>s;
    ll n=s.size();
    ll dp[n][3];
    memset(dp,0,sizeof dp);
    dp[0][0]=1;
    dp[0][1]=1;
    dp[0][2]=1;
    ll ans=beki(3,n-1);
    rep(i,0,n-1){
        if(s[i]=='1'){
            if(s[i+1]=='1'){
                rep(j,0,3){
                    dp[i+1][j]+=dp[i][1];
                    dp[i+1][j]+=dp[i][2];
                    dp[i+1][j]%=mod;
                }
            }
            else{
                dp[i+1][0]+=dp[i][1]+dp[i][2];
                dp[i+1][0]%=mod;
            }
        }
        else{
            if(s[i+1]=='1'){
                rep(j,0,3){
                    dp[i+1][j]+=dp[i][1];
                    dp[i+1][j]+=dp[i][2];
                    dp[i+1][j]+=dp[i][0];
                    dp[i+1][j]%=mod;
                }
            }
            else{
                dp[i+1][0]+=dp[i][1]+dp[i][2]+dp[i][0];
                dp[i+1][0]%=mod;
            }
        }
        if(s[i+1]=='1'){
            ans+=(beki(3,n-2-i)*dp[i+1][0])%mod;
            ans%=mod;
        }
    }
    ans+=dp[n-1][1]+dp[n-1][2];
    if(s[n-1]=='0')ans+=dp[n-1][0];
    cout<<ans%mod<<endl;
}


Measured memory_bytes: 2816