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

#define MOD 1e9+7
#define ll long long int

int main(void){
	char s[100005];
	cin>>s;
	
	int sl=0;
	for(sl=0;s[sl]!='\0';sl++){

	}
	int count = 0;
	int ans;
	if(sl%2==1){
		for(count=0;count<=sl/2&&s[sl/2]==s[sl/2-count]&&s[sl/2]==s[sl/2+count];count++){}
		ans = count+sl/2;
	}else{
		for(count=0;count<sl/2&&s[sl/2]==s[sl/2-1-count]&&s[sl/2]==s[sl/2+count];count++){}
		ans = count+sl/2;
	}

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

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF= 1LL << 60;
#define REP(i,n) for(ll i=0; i<n; i++)
#define FOR(i,a,n) for(ll i=a; i<n; i++)
#define tl 1'000'000'007
int mmax=10000;
void erasuru(vector<ll> &A){
    A[0] = 0; // 0は素数ではない
    A[1] = 0; // 1は素数ではない
    
    for(size_t i=2; i*i<=mmax; ++i) // 0からsqrt(max)まで調べる
        if(A[i]) // iが素数ならば
            for(size_t j=2; i*j<=mmax; ++j) // (max以下の)iの倍数は
                A[i*j] = 0;      // 素数ではない
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    
    vector<ll>A(mmax,1);
    erasuru(A);
    ll ans= 1;
    
    REP(i,mmax){
        if(A[i]){
            ll cc= 0;
            ll x;
            for(ll j=2; j<=n; j++){ 
                x= j;
                while(x%i==0){
                    cc++;
                    x/=i;
                }
            }
            // cout << cc << endl;
            ans*= cc+1;
            ans%= tl;
        }
    }
    cout << ans << endl;

}

Measured memory_bytes: 384
dp = [[[0 for _ in range(2)] for _ in range(4)] for _ in range(105)]

s = input()
n = len(s)
K = int(input())

dp[0][0][0] = 1
for i in range(n):
    for j in range(4):
        for k in range(2):
            nd = int(s[i])
            for d in range(10):
                ni, nj, nk = i + 1, j, k
                if d != 0:
                    nj += 1
                if nj > K:
                    continue
                if 0 == k:
                    if d > nd:
                        continue
                    if d < nd:
                        nk = 1
                dp[ni][nj][nk] += dp[i][j][k]
print(dp[n][K][0] + dp[n][K][1])


Measured memory_bytes: 3064
#include <stdio.h>
int main(void){
  int a,b,c,d,data,count=0;
  while(1){
    scanf("%d",&data);
    if(feof(stdin))break;
    count=0;
    for(a=0;a<10;a++){
      for(b=0;b<10;b++){
	for(c=0;c<10;c++){
	  for(d=0;d<10;d++){
	    if((a+b+c+d)==data)count++;
	  }
	}
      }
    }
    printf("%d\n",count);
  }
  return(0);
}

Measured memory_bytes: 0
import java.util.Scanner;

class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String s = sc.next();
        if (s.contains("a") && s.contains("b") && s.contains("c")) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 22228
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int n, p; cin >> n >> p;
	vector<ll> dp(2);
	dp[0] = 1;
	rep(i, n){
		int x; cin >> x;
		if(x % 2) dp[0] = dp[1] = dp[0] + dp[1];
		else dp[0] *= 2, dp[1] *= 2;
	}
	cout << dp[p] << endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

int main() {
	string s;
	cin >> s;
	if (s == "AAA" || s == "BBB")
		cout << "No";
	else
		cout << "Yes";
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

const pid_t pid = getpid();
// Problem Specific Parameter:

const ll mod = 1000000007;
const int limit = 21;
int ok[limit][limit];
ll dp[limit + 1][1 << limit];

int main(void){
	int n;
	cin >> n;
	rep(i,n)rep(j,n) cin >> ok[i][j];

	dp[0][0] = 1LL;
	rep(i,n)rep(mask, 1 << n){
		if(dp[i][mask] == 0LL) continue;
		dp[i][mask] %= mod;
		rep(j,n){
			if(mask & (1 << j)) continue;
			if(ok[i][j] == false) continue;
			dp[i + 1][mask | (1 << j)] += dp[i][mask];
		}
	}

	cout << dp[n][(1 << n) - 1] % mod << endl;

	return 0;
}

Measured memory_bytes: 309504
#include <stdio.h>
int main(){
  long a,b;
  char input[5];
  
  scanf("%ld %s",&a,input);
  b=(input[0]-'0')*100;
  b+=(input[2]-'0')*10;
  b+=(input[3]-'0');
  
  printf("%ld",(a*b)/100);
}


Measured memory_bytes: 1732
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};


int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	while(1){
		int n,m,k;
		cin>>n>>m>>k;
		if(n==0) break;
		vd a(m*n+1);
		a[0]=1;
		for(int i=0;i<n;i++){
			vd b(m*n+1);
			for(int j=0;j<=m*n;j++) if(a[j]>eps){
				for(int k=1;k<=m;k++) b[j+k]+=a[j]/m;
			}
			a=b;
		}
		double res=0;
		for(int i=0;i<=m*n;i++) res+=max(1,i-k)*a[i];
		cout<<syosu(9)<<res<<endl;
	}
}


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

int main(){
	int n,a[4][3][10],b,c,d,e;
	cin>>n;
	for(int x=0;x<4;x++) for(int y=0;y<3;y++) for(int z=0;z<10;z++) a[x][y][z]=0;
	for(int i=0;i<n;i++){
		cin>>b>>c>>d>>e;
		a[b-1][c-1][d-1]+=e;
	}
	for(int x=0;x<4;x++){
		for(int y=0;y<3;y++){
			for(int z=0;z<10;z++) cout<<" "<<a[x][y][z];
			cout<<endl;
		}
		if(x<3) cout<<"####################"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3100
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    int n;
    string s;
    cin >> n >> s;

    int r = 0;
    for (int d = 1; d < n; d++) {
        int l = 0, k = 0;
        for (int i = d; i < n; i++) {
            if (s[i] == s[i - d]) {
                k++;
                l = max(l, k);
            } else {
                k = 0;
            }
        }
        r = max(r, min(l, d));
    }

    cout << r << endl;

    //l1とl2の差が決まっていれば、一致する文字を列挙できる

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long ll;
ll m=1e9+7;
int main(void){
    int n;
    ll a[30];
    string s;
    cin>>n>>s;
    fill(a, a+26, 0);
    for(int i=0;i<n;i++){
        a[s[i]-'a']++;
    }
    ll z=a[0]+1;
    for(int i=1;i<26;i++){
        z=(z*(a[i]+1))%m;
    }
    cout<<z-1<<endl;
}


Measured memory_bytes: 512
#include<cstdio>
#include<algorithm>
#include<map>
using namespace std;
int n,m,q;
long long ans[15];
map<int,map<int,int> >mp;
int main()
{
	scanf("%d%d%d",&n,&m,&q);
	while(q--)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		for(int i=max(2,x-1);i<=min(n-1,x+1);i++)
			for(int j=max(2,y-1);j<=min(m-1,y+1);j++)
			{
				ans[mp[i][j]]-=1ll;
				mp[i][j]++;
				ans[mp[i][j]]+=1ll;
			}
	}
	ans[0]+=1ll*(n-2)*(m-2);
	for(int i=0;i<=9;i++)
		printf("%lld\n",ans[i]);
	return 0;
}

Measured memory_bytes: 70528
//#include <bits/stdc++.h>
//#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>

using namespace std;
using ll=long long;
using intpair=pair<int,int>;
using intpv=vector<intpair>;
using llpair=pair<ll,ll>;
using llpv=vector<llpair>;
using intvec=vector<int>;
using llvec=vector<ll>;
using intq=queue<int>;
using llq=queue<ll>;
using intmat=vector<intvec>;
using llmat=vector<llvec>;
using pairmat=vector<llpv>;

template<typename T>
using matrix=vector<vector<T>>;
template<typename T>
using pque=priority_queue<T>;
template<typename T>
using lpque=priority_queue<T,vector<T>,greater<T>>;

#define PI 3.141592653589793
#define INTINF 1<<30
#define LLINF 1LL<<60
#define MPRIME 1000000007
#define MPRIME9 998244353

#define len length()
#define pushb push_back
#define fi first
#define se second

#define setpr fixed<<setprecision(15)
#define all(name) name.begin(),name.end()
#define rall(name) name.rbegin(),name.rend()
#define gsort(vbeg,vend) sort(vbeg,vend,greater<>())
#define matin(mat,H,W) for(int i__=0; i__<H; i__++)for(int j__=0; j__<W; j__++) cin>>mat[i__][j__]
#define out(n) cout<<n<<endl

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

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

template<class T>
inline void outmat(T& a, int y, int x) {
	for(int i=0; i<y; i++) {
		for(int j=0; j<x; j++) cout<<a[i][j]<<" ";
		cout<<endl;
	}
}

template<class T>
inline void init(T& v) {
	for(auto &a__: v) cin>>a__;
}
template<class T, class N>
inline void init(T& v, N n) {
	v.resize(n);
	for(auto &a__: v) cin>>a__;
}

template<class N> void resiz(N n) {} // empty
template<class N, class T, class... U>
void resiz(N n, T&& hd, U&&... tl) {
	hd.resize(n);
	resiz(n,forward<U>(tl)...);
}

ll GCD(ll a, ll b) { //最大公約数
	if(a==0||b==0) return 0;
	if(a<b) swap(a,b);
	ll tmp = a%b;
	while(tmp!=0) {
		a = b;
		b = tmp;
		tmp = a%b;
	}
	return b;
}

ll binpow(ll a, ll ex, ll p) { //繰り返し二乗法
	ll result=1;
	while(ex>0) {
		if(ex&1) result=result*a%p;
		ex>>=1;
		a=a*a%p;
	}
	return result;
}

ll Fact(ll x, ll p) { //階乗
	ll f=1;
	for(ll i=2; i<=x; i++) {
		f*=i;
		f%=p;
	}
	return f;
}

int DigitNum(ll n) { //桁数
	int digit=0;
	ll div=1LL;
	while(n/div) {
		digit++;
		div*=10;
	}
	return digit;
}


int N;
intvec A,B;
int mn,mx;
int res=0;

void input() {
	cin>>N;
	resiz(N,A,B);
	for(int i=0; i<N; i++) cin>>A[i]>>B[i];
}

void solve() {
	sort(all(A)); sort(all(B));
	if(N%2) {
		mx=B[N/2];
		mn=A[N/2];
		cout<<mx-mn+1<<endl;
	}
	else {
		mx=(B[N/2]+B[N/2-1])/2;
		res+=(B[N/2]+B[N/2-1])%2;
		mn=(A[N/2]+A[N/2-1])/2+(A[N/2]+A[N/2-1])%2;
		res+=(A[N/2]+A[N/2-1])%2;
		res+=(mx-mn)*2+1;
		cout<<res<<endl;
	}
}

int main() {
	while(1) {
		input();
		solve();
		break;
	}
}


Measured memory_bytes: 4816
// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;
#define int long long
const int N = (int) 1e5 + 5, mod = (int) 0;
int a[N];
int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    int step = n * (n + 1) / 2, sum = 0;
    for (int j = 0; j < n; ++j)
        cin >> a[j], sum += a[j];
    int cnt = 0;
    if (sum % step != 0) {
        cout << "NO";
        return 0;
    }
    cnt = sum / step;
    int z = 0;
    for (int j = 0; j < n; ++j) {
        int nx = (j + 1) % n;
        int diff = a[nx] - cnt - a[j];
        diff = -diff;
        if (diff < 0) {
            cout << "NO\n";
            return 0;
        }
        if (diff % n != 0) {
            cout << "NO";
            return 0;
        }
        diff /= n;
        z += diff;

    }
    z = abs(z);
    if (z == cnt) cout << "YES";
    else cout << "NO";
}



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

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);


using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using mint = map<int, int>;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
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);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powmod(ll b, ll e){ll r=1;while(e>0){if(e&1)r=(r%MOD)*(b%MOD)%MOD;b=(b%MOD)*(b%MOD)%MOD;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    s << '[';
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len-1) s << ", ";
    }
    s << ']';
    return s;
}

struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);
    };
}fastio;

int main(){

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


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


int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
        a[i]--;
    }
    set<int> st;
    int ans=0;
    int pos=0;
    bool ok=1;
    st.insert(pos);
    while(true){
        ans++;
        if(a[pos]==1) break;
        if(st.count(a[pos])){
            ok=0;
            break;
        }
        st.insert(a[pos]);
        pos=a[pos];
    }
    cout<<(ok?ans:-1)<<endl;
}

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

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;

int cn[200005];

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	int n;
	cin >> n;
	forn (i, n - 1) {
		int a;
		cin >> a;
		cn[a]++;
	}

	forn (i, n) cout << cn[i + 1] << endl;

	return 0;
}


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

namespace competitive_programming
{
    class Program
    {
        static void Main(string[] args)
        {
            var main = new Program();
            main.solve();
        }

        void solve()
        {
            long N = int.Parse(Console.ReadLine());
            long[] levels = Console.ReadLine().Split(' ').Select(val => long.Parse(val)).ToArray();
            Array.Sort(levels);
            Console.WriteLine(levels[N / 2] - levels[N / 2 - 1]);
        }
    }

    struct Vector2
    {
        public Vector2(long x, long y)
        {
            this.x = x;
            this.y = y;
        }
        public long x;
        public long y;
    }

    struct Vector3
    {
        public int x;
        public int y;
        public int z;
    }
}


Measured memory_bytes: 19424
N = int(input())
A = list(map(int, input().split()))
ans = 10**10

for item in A:
    if item % 2 == 1:
        ans = 0
        break
    tmp = 0
    while item % 2 == 0:
        tmp += 1
        item //= 2
    ans = min(ans, tmp)

print(ans)


Measured memory_bytes: 2940
#include<stdio.h>
#include<stdlib.h>
#include<memory.h>
int cmp(const void *x, const void *y)
{
	return *(int*)x - *(int*)y;
}
int main()
{
	int c[5], n[13], nn[5], i;
	while (scanf("%d", c)>0) {
		for (i = 1; i < 5; i ++)
			scanf(",%d", c+i);
		qsort(c, 5, sizeof(int), cmp);
		memset(n, 0, sizeof(n));
		for (i = 0; i < 5; i ++)
			n[c[i]-1] ++;
		memset(nn, 0, sizeof(nn));
		for (i = 0; i < 13; i ++)
			nn[n[i]] ++;
		if (nn[4])
			puts("four card");
		else if (nn[3] && nn[2])
			puts("full house");
		else if (c[1]+1==c[2] && c[1]+2==c[3] && c[1]+3==c[4] && (c[1]-1==c[0] || (c[0]==1 && c[1]==10)))
			puts("straight");
		else if (nn[3])
			puts("three card");
		else if (nn[2] == 2)
			puts("two pair");
		else if (nn[2])
			puts("one pair");
		else
			puts("null");
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>

using namespace std;

const int seconds = 60;
const int minutes = 60;
const int hours = 24;
const int day = seconds*minutes*hours;

vector<string> split(string s, char delimeter){
    string t = "";
    vector<string> ret;
    for(int i=0; i<s.length(); i++){
        if(s[i] != delimeter){
            t += s[i];
        }else{
            ret.push_back(t);
            t = "";
        } 
    }
    if (t != "")ret.push_back(t);
    return ret;
}

int intTime(string stime){
    vector<string> time = split(stime, ':');

    int h = ((time[0][0]-'0')*10 + (time[0][1]-'0'))*minutes*seconds;
    int m = ((time[1][0]-'0')*10 + (time[1][1]-'0'))*seconds;
    int s = ((time[2][0]-'0')*10 + (time[2][1]-'0'));

    return h+m+s;
}

int main(){
    vector<int> ans;

    while(true){
        int n;
        cin >> n;

        if(n == 0) break;

        int sum[day+1];
        fill(sum, sum+day, 0);

        string a, b;
        for(int i=0; i<n; i++){
            cin >> a >> b;
            sum[intTime(a)]++;
            sum[intTime(b)]--;
        }

        int ret = sum[0];
        for(int i=0; i<day-1; i++){
            sum[i+1] += sum[i];
            if(ret < sum[i+1]) ret = sum[i+1];
        }
        ans.push_back(ret);
    }

    for(int i=0; i<ans.size(); i++){
        cout << ans[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 3392
import math

x, y = map(int, input().split())
mod = 10 ** 9 + 7
a = (2 * y - x) / 3
b = (2 * x - y) / 3

if (not a.is_integer()) or (not b.is_integer()) or \
    (a < 0) or (b < 0):
    print(0)
else:
    a, b = int(a), int(b)
    I = [1] * (a + b + 1)
    for n in range(1, a+b+1):
        I[n] = I[n-1] * n
        I[n] %= mod
    i, j, k = I[a+b], I[a], I[b]
    j = pow(j, mod-2, mod)
    k = pow(k, mod-2, mod)

    ans = i * j * k
    ans %= mod
    print(ans)

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

int main(){
  string S;
  cin>>S;
  int A = S[0]- '0';
  int B = S[1]- '0';
  int C = S[2]- '0';
  int D = S[3]- '0';

  for(int i=0;i<2;i++){
    for(int j=0;j<2;j++){
      for(int k=0;k<2;k++){
        int ans=A;
        char a,b,c;
        if(i==0){ans +=B; a ='+';}
        else {ans -=B; a ='-';}

        if(j==0){ans +=C; b='+';}
        else{ans -=C; b ='-';}

        if(k==0){ans +=D; c='+';}
        else{ans -=D;c='-';}

        if(ans==7){
          cout<<A<<a<<B<<b<<C<<c<<D<<"=7"<<endl;
          return 0;
        }
      }
    }
  }

}


Measured memory_bytes: 256
n,m = map(int,input().split())
rule = [list(map(int,input().split())) for i in range(m)]
jj = 0
if n == 1:
    for i in range(0,10**n):
        jud = 0
        for j in range(m):
            if int(str(i)[rule[j][0]-1]) != rule[j][1]:
                jud =1
        if jud == 0:
            print(i)
            jj = 1
            break
else:
    for i in range(10**(n-1),10**n):
        jud = 0
        for j in range(m):
            if int(str(i)[rule[j][0]-1]) != rule[j][1]:
                jud =1
        if jud == 0:
            print(i)
            jj = 1
            break
if jj == 0:
    print(-1)


Measured memory_bytes: 9100
#include <bits/stdc++.h>
 
const double pi = 3.141592653589793238462643383279;
 
 
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
 
 
//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 SQ(a) ((a)*(a))
#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 SORT(c) sort((c).begin(),(c).end())
 
 
//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
 
 
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const double EPS = 1E-8;
 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)

// ここから編集

auto build_SA(string s){

    vector<pair<string, int>> v;

    int len = s.size();
    string t = "$";
    v.emplace_back(t, len--);
    for(int i=s.size()-1; i>=0; i--){
        t = s[i] + t;
        v.emplace_back(t, len--);
    }

    sort(all(v));

    vector<int> SA;
    for(int i=0; i<v.size(); i++) SA.push_back(v[i].second);

    for(auto e: SA) cout << e << endl;
    return SA;
}
void BWT(string s){

    auto SA = build_SA(s);

    vector<char> v;
    for(int i=0; i<SA.size(); i++){
        if(SA[i] == 0){
            v.push_back('$');
        }else{
            v.push_back(s[SA[i]-1]);
        }
    }
    
    for(int i=0; i<v.size(); i++){
        cout << SA[i] << " " << v[i] << endl;
    }
}

int N;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    
    int n,a,b;
    cin >>n >> a >> b;
    cout << min(b, a*n) << endl;


    return 0;
}


Measured memory_bytes: 3676
import { readFileSync } from 'fs'

function main(input: string[]) {
  let [H, W, K] = input[0].split(' ').map(v=>parseInt(v, 10))
  let c : string[] = input.slice(1, input.length);

  let ans = 0
  for (let bitH = 0; bitH < 1 << H; bitH++) {
    for (let bitW = 0; bitW < 1 << W; bitW++) {
      let ansOne = 0
      for (let i = 0; i < H; i++) {
        for (let j = 0; j < W; j++) {
          if (!(bitH & 1 << i)) {
            if (!(bitW & 1 << j)) {
              if (c[i][j] == '#') {
                ansOne++
              }
            }
          }
        }
      }
      if (ansOne == K) {
        ans++
      }
    }
  }

  console.log(ans.toString())
}

let lines: string[] = [];
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', function (line: string) {
  lines.push(line);
});
reader.on('close', function () {
  main(lines)
});


Measured memory_bytes: 32992
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    VL a(x), b(y), c(z);
    REP(i,x) a[i] = lin();
    REP(i,y) b[i] = lin();
    REP(i,z) c[i] = lin();
    sort(ALL(a));
    sort(ALL(b));
    sort(ALL(c));
    set<int> st;
    st.insert(x - 1 + 1000 * (y - 1) + 1000000 * (z - 1));
    priority_queue<PL> que;
    que.push(PL(a[x-1] + b[y-1] + c[z-1], x - 1 + 1000 * (y - 1) + 1000000 * (z - 1)));
    VL ans;
    while (ans.size() < k){
        PL p = que.top();
        que.pop();
        int xx = p.second % 1000;
        int yy = (p.second / 1000) % 1000;
        int zz = p.second / 1000000;
        VI t({xx, yy, zz});
        ans.push_back(p.first);
        REP(i,3){
            if (t[i] == 0) continue;
            t[i]--;
            int tmp = t[0] + 1000*t[1] + 1000000*t[2];
            if (!st.count(tmp)){
                ll s = a[t[0]] + b[t[1]] + c[t[2]];
                st.insert(tmp);
                que.push(PL(s, tmp));
            }
            t[i]++;
        }
    }
    REP(i,k) cout << ans[i] << endl;
    return 0;
}


Measured memory_bytes: 768
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// const ll INF = 1LL <<60;
const int INF = 10000;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}
// ここから開始

int main(){
  int n;
  cin>>n;
  vector<int> a(n), b(n),c(n);
  for(int i = 0; i < n; i++) cin>>a[i];
  for(int i = 0; i < n; i++) cin>>b[i];
  for(int i = 0; i < n; i++) cin>>c[i];
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  sort(c.begin(),c.end());

  ll ans = 0;
  
  for(int i = 0; i < n; i++){
    ll pre = lower_bound(a.begin(),a.end(),b[i])-a.begin();
    ll over = c.end() - upper_bound(c.begin(),c.end(),b[i]);
    ans+=pre*over;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
int n;
long long a[305][305];
long long ans = 0;
 
int main()
{
	cin>>n;
	for (int i=1;i<=n; i++){
		for (int j=1;j<=n;j++) {
			cin>>a[i][j];
		}
	}
		
	for (int i=1;i<=n;i++)
		for (int j=1;j<=i;j++) {
			int k;
			for (k=1;k<=n;k++) {
				if (i==k||j == k) continue;
				if(a[i][k]+a[k][j]<a[i][j]){
					cout<<"-1"<<endl;
					return 0;
				}
				if(a[i][k]+a[k][j]==a[i][j]){
					break;
				}
			}
			if (k==n+1) {
				ans += a[i][j];
			}
		}
	cout<<ans<<endl;
 
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define ll long long
//#define cccgift
//#define getchar()(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
//char buf[1<<21],*p1=buf,*p2=buf;
template<typename T>
inline void read(T &x)
{
    static char ch;bool f=1;
    for(x=0,ch=getchar();!isdigit(ch);ch=getchar()) if(ch=='-') f=0;
    for(;isdigit(ch);x=(x<<1)+(x<<3)+(ch^48),ch=getchar());x=f?x:-x;
}
template<typename T>
void print(T x)
{
    if (x<0) x=-x,putchar('-');
    if (x>9) print(x/10);
    putchar(x%10+48);
}
template<typename T>
inline void print(T x,char ap) {print(x);if (ap) putchar(ap);}
template<typename T>
inline void chkmax(T &x,const T &y) {x=x<y?y:x;}
template<typename T>
inline void chkmin(T &x,const T &y) {x=x<y?x:y;}

int main()
{
	ios::sync_with_stdio(false);
	int a,b;
	cin>>a>>b;
	if(a>b) swap(a,b);
	while(b--) cout<<a;cout<<'\n';
	cout<<flush;
	return 0;
}
/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do something instead of nothing and stay organized
*/ 

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

#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#define endl "\n"
#define all(V) V.begin( ), V.end( )
#define Unique(V) sort( all( V ) ), V.erase( unique( all( V ) ), V.end() )
#define Check( N , p ) ( !( ( N & ( 1LL << p ) ) == 0 ) )
#define ON( N , p ) ( N = N | ( 1LL << p ) )
#define OFF( N , p ) ( N = N & ~( 1LL << p ) )
std::mt19937 rng( chrono::steady_clock::now().time_since_epoch().count() );
#define rnd(a, b) ((((rand() << 15) ^ rand()) % ((b) - (a) + 1)) + (a))
#define ran(a, b) rng() % ( (b) - (a) + 1 ) + (a)
#define trace(...) __f( #__VA_ARGS__ , __VA_ARGS__ )
template < typename Arg1 >
void __f( const char* name , Arg1&& arg1 ) { cerr << name << " : " << arg1 << "\n"; }
template < typename Arg1 , typename... Args >
void __f( const char* names , Arg1&& arg1 , Args&&... args ) {
const char* comma = strchr( names + 1 , ',' );
cerr.write( names , comma - names ) << " : " << arg1 << " , " ; __f( comma + 1 , args... ); }
typedef long long int LL;
typedef pair <int,int> pii;
typedef pair <long long,long long> pll;
const int MOD = 1e9 + 7;
const double EPS = 1e-8;
const int N = 1e5 + 5;
const int inf = 1e9;
const long long INF = 1e18;


int main( int argc , char const *argv[] ) {
        ios_base::sync_with_stdio( false ); cin.tie( nullptr );
        int n;
        cin >> n;
        priority_queue <LL,vector <LL>, greater <LL>> Q;
        LL g;
        for( int i = 1; i <= n; i++ ) {
                LL val;
                cin >> val;
                if( i == 1 ) g = val;
                else g = __gcd( g , val );
        }
        cout << g << endl;
        return 0;
}














Measured memory_bytes: 256
#pragma G++ optimize (2)
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f, mod=1000000007;
int x[1010],y[1010],sum[1010], a[1010];

void read(int &x)
{
    char ch; bool ok;
    for(ok=0,ch=getchar(); !isdigit(ch); ch=getchar()) if(ch=='-') ok=1;
    for(x=0; isdigit(ch); x=x*10+ch-'0',ch=getchar()); if(ok) x=-x;
}

int main()
{
    int n; read(n); int maxn=0;
    for (int i=1; i<=n; i++) 
        read(x[i]), read(y[i]), 
        sum[i]=abs(x[i]+y[i]), maxn=max(sum[i],maxn);
    for (int i=1; i<=n-1; i++) 
        if ((sum[i]&1)!=(sum[i+1]&1)) {printf("-1\n"); return 0;}
    int tmp=1, cnt=0; if (!(sum[1]&1)) a[++cnt]=1, maxn--;
    while (tmp-1<=maxn)
    {
        a[++cnt]=tmp; tmp*=2;
    }
    printf("%d\n",cnt);
    for (int i=cnt; i>=1; i--) printf("%d ",a[i]); printf("\n");
    for (int i=1; i<=n; i++)
    {
        int nx=0, ny=0;
        for (int j=cnt; j>=1; j--)
        {
            int tx=x[i]-nx, ty=y[i]-ny;
            if (abs(tx)>abs(ty))
                if (tx>0) printf("R"), nx+=a[j];
                    else printf("L"), nx-=a[j];
            else
                if (ty>0) printf("U"), ny+=a[j];
                    else printf("D"), ny-=a[j];
        }
        printf("\n");
    }
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){

  int a,b,c,i;

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

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

    if(a*i%b ==	c){

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

    }

  }

  printf("NO\n");

  return 0;

}


Measured memory_bytes: 128
import sys

def cmb(n, r, mod):#コンビネーションの高速計算　
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 2*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


input=sys.stdin.readline
write=sys.stdout.write

N=int(input())
hen={i:[] for i in range(1,N+1)}
for i in range(0,N-1):
    a,b=map(int,input().split())
    hen[a].append(b)
    hen[b].append(a)

parent={i:-1 for i in range(1,N+1)}
parent[1]=0
q=[]
q.append(1)
sub=[]
while q!=[]:
    while q!=[]:
        x=q.pop()
        for p in hen[x]:
            if parent[p]==-1:
                parent[p]=x
                sub.append(p)
        #何らかの操作
        #ここでsubキューに次に使うものを格納
        if q==[]:
            q=sub
            sub=[]
            break

ans={i:1 for i in range(1,N+1)}
subtreesize={i:1 for i in range(1,N+1)}
flag={i:0 for i in range(0,N+1)}
q=[]
for i in range(1,N+1):
    if i!=1 and len(hen[i])==1:
        q.append(i)


sub=[]
while q!=[]:
    while q!=[]:
        x=q.pop()
        p=parent[x]
        if p!=1:
            ans[p]=(ans[p]*ans[x]*g2[subtreesize[x]])%mod
            subtreesize[p]+=subtreesize[x]
            flag[p]+=1
            if flag[p]==len(hen[p])-1:
                ans[p]=(ans[p]*g1[subtreesize[p]-1])%mod
                sub.append(p)
        else:
            subtreesize[1]+=subtreesize[x]
            ans[1]=(ans[1]*ans[x]*g2[subtreesize[x]])%mod
            flag[1]+=1
            if flag[1]==len(hen[1]):
                ans[1]=(ans[1]*g1[subtreesize[1]-1])%mod
        #何らかの操作
        #ここでsubキューに次に使うものを格納
        if q==[]:
            q=sub
            sub=[]
            break

q=[1]
flag2={i:0 for i in range(1,N+1)}
flag2[1]=1
sub=[]
while q!=[]:
    while q!=[]:
        x=q.pop()
        for p in hen[x]:
            if flag2[p]==0:
                if len(hen[p])!=1:
                    ans[p]=(ans[x]*pow(N-subtreesize[p],mod-2,mod)*g1[subtreesize[p]]*g2[subtreesize[p]-1])%mod
                    flag2[p]=1
                    sub.append(p)
                else:
                    ans[p]=(ans[x]*pow(N-1,mod-2,mod))%mod

        #何らかの操作
        #ここでsubキューに次に使うものを格納
        if q==[]:
            q=sub
            sub=[]
            break

for i in range(1,N+1):
    print(ans[i])

Measured memory_bytes: 169136
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;} 
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll N;
        cin >> N;
        vll A(N+1);
        rep(i, 0, N) cin >> A[i];

        sort(all(A));
        ll ans = 0;
        rep(i, 1, N) ans += A[N - i/2];
        cout << ans << endl;
}

Measured memory_bytes: 4800
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
#include <iomanip>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 2;
const int MOD = 1000000007;

int main() {
	ll N;
	cin >> N;
	
	FOR(h, 1, 3500) {
		FOR(w, 1, 3500) {
			ll a = N*h*w;
			ll b = 4 * h*w - N*(w + h);
			if (b != 0 && a%b == 0) {
				ll n = a / b;
				if (n > 0) {
					cout << h << " " << n << " " << w << endl;
					return 0;
				}
			}
		}
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>


#define REP(i,N) for(auto i = 0; i <N; i++)

using namespace std;
typedef long long ll;


int in(){
    int temp;
    scanf("%d",&temp);
    return temp;
}

ll lin(){
    ll temp;
    scanf("%lld",&temp);
    return temp;
}



int main() {

    string S;
    cin >> S;
    
    int A  =S[0];
    int B = S[1];
    int C = S[2];
    int D = S[3];
    
    string out;
    
    int val;
    int op;
    
    for(int i = 0; i<8; i++){
        
        out.clear();
        val = 0;
        
        out.push_back(A);
        
        val += A - '0';
        
        if ((i >> 0) %2 == 0){
            out.push_back('+');
            op = 1;
        }else{
            out.push_back('-');
            op = -1;
        }
        
        val += (op)*(B - '0');
        out.push_back(B);
        
        if ((i >> 1) %2 == 0){
            out.push_back('+');
            op = 1;
        }else{
            out.push_back('-');
            op = -1;
        }
        
        val += (op)*(C - '0');
        
        out.push_back(C);
        if ((i >> 2) %2 == 0){
            out.push_back('+');
            op = 1;
        }else{
            out.push_back('-');
            op = -1;
        }
        
        out.push_back(D);
        
        val += (op)*(D - '0');
        
        if (val == 7){
            break;
        }
        
        
    }
                          
    cout << out;
    cout << "=7"<<endl;
    
    return 0;
}


                          
                        




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

int main() {
	long long n;
	cin>>n;
	long long a[n],b[n],c[n];
	long long dp[n][3];
	for(long long i=0;i<n;i++){
	        cin>>a[i]>>b[i]>>c[i];
	}dp[0][0]=a[0];
	dp[0][1]=b[0];
	dp[0][2]=c[0];
	for(long long i=1;i<n;i++){
	    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i];
	    dp[i][1]=max(dp[i-1][0],dp[i-1][2])+b[i];
	    dp[i][2]=max(dp[i-1][0],dp[i-1][1])+c[i];
	}long long ans=0;
	ans=max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]);
	cout<<ans;
	
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i = (int)j;i <= (int)k;i ++)
#define debug(x) cerr<<#x<<":"<<x<<endl
const int maxn=(int)1e6+5;
typedef double db;
const db pi=acos(-1.);
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    db r;cin>>r;
    cout<<2*r*pi<<endl;
}

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

#define NG -1
#define TRUE 1
#define FALSE 0

void cal(int a,int b,int c,int d,int *flag,char *tmp); 

int main(){

	int i,j,k,l,no[4],flag;
	char ans[20];

	while(scanf("%d %d %d %d",&no[0],&no[1],&no[2],&no[3])!=EOF){
		if(!no[0] && !no[1] && !no[2] && !no[3]) break;
		flag=FALSE;
		for(i=0;i<4;i++){
			for(j=0;j<4;j++){
				if(i!=j){
					for(k=0;k<4;k++){
						if(k!=i && k!=j){
							for(l=0;l<4;l++){
								if(l!=i && l!=j && l!=k) cal(no[i],no[j],no[k],no[l],&flag,ans);
								if(flag==TRUE) break;
							}
						}
						if(flag==TRUE) break;
					}
				}
				if(flag==TRUE) break;
			}
			if(flag==TRUE) break;
		}
		if(flag==TRUE){
			printf("%s\n",ans);
			continue;
		}
		printf("0\n");
	}





	return 0;

}

void cal(int a,int b,int c,int d,int *flag,char *tmp){

	int i,j,k,tmp1,tmp2,tmp3;
	char op[3]={'+','-','*'};

	for(i=0;i<3;i++){
		switch(i){
			case 0:
				tmp1=a+b;
				break;
			case 1:
				tmp1=a-b;
				break;
			case 2:
				tmp1=a*b;
		}
		for(j=0;j<3;j++){
			switch(j){
				case 0:
					tmp2=tmp1+c;
					break;
				case 1:
					tmp2=tmp1-c;
					break;
				case 2:
					tmp2=tmp1*c;
			}
			for(k=0;k<3;k++){
				switch(k){
					case 0:
						tmp3=tmp2+d;
						break;
					case 1:
						tmp3=tmp2-d;
						break;
					case 2:
						tmp3=tmp2*d;
				}
				if(tmp3==10){
					sprintf(tmp,"(((%d%c%d)%c%d)%c%d)",a,op[i],b,op[j],c,op[k],d);
					*flag=TRUE;
					return;
				}
			}
		}
	}

	for(i=0;i<3;i++){
		switch(i){
			case 0:
				tmp1=a+b;
				break;
			case 1:
				tmp1=a-b;
				break;
			case 2:
				tmp1=a*b;
		}
		for(j=0;j<3;j++){
			switch(j){
				case 0:
					tmp2=c+d;
					break;
				case 1:
					tmp2=c-d;
					break;
				case 2:
					tmp2=c*d;
			}
			for(k=0;k<3;k++){
				switch(k){
					case 0:
						tmp3=tmp1+tmp2;
						break;
					case 1:
						tmp3=tmp1-tmp2;
						break;
					case 2:
						tmp3=tmp1*tmp2;
				}
				if(tmp3==10){
					sprintf(tmp,"((%d%c%d)%c(%d%c%d))",a,op[i],b,op[k],c,op[j],d);
					*flag=TRUE;
					return;
				}
			}
		}
	}
	*flag=FALSE;
	sprintf(tmp,"NG");
	return;
}

Measured memory_bytes: 616
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,C,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;


int main(){
    cin>>N;
    ll last = -1, temp = 0, ans = 0;
    rep(i,N){
        cin>>A;
        if(last < A){
            ans = max(ans,temp);
            temp = 0;
        }else{
            ++temp;
        }
        last = A;
    }
    ans = max(ans,temp);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define speed() cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
// #define exit(a, b) return cout << a, b;

#define loop(i,a,b) for(ll i=a;i<b;i++)
#define all(v) v.begin(), v.end() 

#define print(stuff) cout << stuff << endl
#define printc(stuff) for(auto x: stuff) cout << x << " "; cout << endl;
#define printPrec(stuff) cout << fixed << setprecision(15) << stuff << endl;
#define debug(stuff) cout << #stuff << ": " << stuff <<endl
#define debugc(stuff) cout << #stuff << ": "; for(auto x: stuff) cout << x << " "; cout << endl;
#define len length
#define ret0 return 0
#define ret return 

#define ll long long
#define ld long double
#define fi first
#define endl '\n'
#define se second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define fill(ar, x) memset(ar, x, sizeof ar)

#define vl vector<ll> 
#define sl set<ll>
#define pll pair<ll, ll>
#define mll map<ll, ll> 
#define pq priority_queue<ll>

// typedef tree<ll,null_type,less<ll>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;

#define inf (long long int) 1e18
#define eps 0.000001
#define mod 1000000007
#define mod1 998244353
#define MAXN (ll)1e5+5

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

    ll n;
    cin>>n;
    ll a[n];
    ll val=0;
    loop(i,0,n){
        cin>>a[i];
        val=val^a[i];
    }
    if(val==0) print("Yes");
    else print("No");
        
    
}



Measured memory_bytes: 1024