akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <array>
#include <cmath>

using namespace std;

using ll = long long int;

// GCDを計算します
template <typename NumType>
NumType calcGCD(NumType a, NumType b) {
    if (a < b) {
        NumType tmp = a;
        a = b;
        b = tmp; 
    }

    NumType r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

// 約数を数えます
template <typename NumType>
NumType cntDivisor(const NumType & num) {
    NumType cnt = 0;
    for(NumType i = 1; i * i <= num; ++i) {
        if(num % i == 0) {
            cnt++;
            if(i * i != num) cnt++;
        }
    }

    return cnt;
}

// [beg, end)の範囲を，添え字indexでループするfor文に置換します
#define FOR_RANGE(index, beg, end)     for (ll index = beg; index < N; ++index)

#define DEBUG(x)     std::cout << #x << " : " << x << "\n"

template<class T>
T min(T a, T b) {
    return (a < b) ? a : b;
}

template<class T>
T max(T a, T b) {
    return (a > b) ? a : b;
}

int main() {
    int A, B;

    cin >> A >> B;

    if ((A + B) % 2 == 0)
        cout << (A + B)/2;
    else
        cout << "IMPOSSIBLE";

    return 0;
}



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

int main(){
    int n,A,B;
    cin >> n >> A >> B;
    string s;
    cin >> s;
    int count_all = 0;
    int count_b = 0;
    for(int i=0;i < n; i++){
        if(s[i]=='a' && count_all < A + B){
            cout << "Yes" << endl;
            count_all++;
        }else if(s[i] == 'b' && count_all < A + B && count_b < B){
            cout << "Yes" << endl;
            count_all++;
            count_b++;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <utility>
#include <vector>
#include <cmath>
#include <map>
#include <string>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define pb push_back
#define mp make_pair
#define F first
#define S second

int main()
{
    string ans = "Yes";

    ll n;
    cin >> n;

    vector<ll> h(n);
    rep (i, n) {
        cin >> h[i];
    }

    for (int i = n - 1; i >= 1; i--) {
        if (h[i - 1] <= h[i]) continue;
        if (h[i - 1] == h[i] + 1) {
            h[i - 1] -= 1;
            continue;
        }
        ans = "No";
        break;
    }

    cout << ans << "\n";

    return 0;
}


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

int top,S[1000];

void push(int x)
{
  S[++top] = x;
}
int pop()
{
  top--;
  return S[top + 1];
}

int main(){
  int a,b;
  char s[100];
  top = 0;

  while(scanf("%s", s) != EOF){
    if(s[0] == '+'){
      a = pop();
      b = pop();
      push(a + b);
    }
    else if(s[0] == '-'){
      b = pop();
      a = pop();
      push(a - b);
    }
    else if(s[0] == '*'){
      a = pop();
      b = pop();
      push(a * b);
    }
    else{
      push(atoi(s));
    }
  }

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

  return 0;
}



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

int h, w, k;
int a[10][3];
long long b[111][10];
long long mod = 1e9+7;

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	cin >> h >> w >> k;
	for(int i=0; i<1<<(w-1); ++i){
		bool f = true;
		for(int j=0; j<w-2; ++j)
			if((i>>j & i>>(j+1)) == 1)
				f = false;
		if(!f) continue;
		if((i & 1) == 1) ++a[1][2];
		else ++a[1][0];
		if(w != 1){
			if((i>>(w-2) & 1) == 1) ++a[w][1];
			else ++a[w][0];
		}
		for(int j=2; j<=w-1; ++j){
			if((i>>(j-2) & 1) == 1){
				++a[j][1];
			}else{
				if((i>>(j-1) & 1) == 1) ++a[j][2];
				else ++a[j][0];
			}
		}
	}
//	for(int i=1; i<=w; ++i)
//		cout << a[i][0] << " " << a[i][1] << " " << a[i][2] << "\n";
	b[0][1] = 1;
	for(int i=0; i<h; ++i)
		for(int j=1; j<=w; ++j){
			b[i+1][j] += b[i][j] * a[j][0] % mod;
			b[i+1][j] %= mod;
			if(j != 1){
				b[i+1][j-1] += b[i][j] * a[j][1] % mod;
				b[i+1][j-1] %= mod;
			}
			if(j != w){
				b[i+1][j+1] += b[i][j] * a[j][2] % mod;
				b[i+1][j+1] %= mod;
			}
		}
	cout << b[h][k] << "\n";
}

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

int main()
{
    int n, s[15000], t, m[1000], count = 0;
    cin >> n;
    for(int i=0; i<n; i++)
        cin >> s[i];
    cin >> t;
    for(int i=0; i<t; i++)
    {
        cin >> m[i];
        for(int j=0; j<n; j++)
        {
            if(m[i] == s[j])
            {
                count++;
                break;
            }
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3136
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
typedef long long int ld;
typedef unsigned long long int lu;
typedef vector< int > vi;
typedef vector < ld > vd;
typedef set <ld> sd;
typedef vector< vi > vvi;
typedef vector< vd > vvd;
typedef pair< int,int > ii;
typedef pair< ld,ld > id;
#define sz(a) ld((a).size())
#define test(t) ll t;cin>>t;while(t--)
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define Vi vector
#define pr pair
#define mpr make_pair
#define fi first
#define se second
#define isnum(a) (a>=48 && a<=57)
#define isS(a) (a>='a' && a<='z')
#define isU(a) (a>='A' && a<='Z')
#define toS(a) (isU(a)?a+32:a)
#define toU(a) (isS(a)?a-32:a)
#define toC(a) a&15

set <ld> s[100005];
ld d[100005];

vector<char> prime (100000+1, true);
void sieve(ld n)
{	
	//O(nloglogn) time
	prime[0] = prime[1] = false;
	for (ld i=2; i<=n; ++i)
	{
		if (prime[i])
		{
			s[i].insert(i);			
			for (ld j=2*i; j<=n; j+=i)
			{
				prime[j] = false;
				s[j].insert(i);
			}
		}
	}
}
#define forn(i,e) for(int i = 0; i < e; i++)
#define rep(i,a,b) for(i=a;i<b;i++)
#define REP(i,a,b) for(i=a;i<=b;i++)
#define reprev(i,a,b) for(i=a;i>=b;i--)

#define leadzero(a) __builtin_clz(a) //count leading zeros
#define trailzero(a) __builtin_ctz(a) //count trailing zeros
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln cout<<"\n"
#define sp cout<<" "
#define maxe(a) *max_element(a.begin(),a.end())
#define maxi(a) max_element(a.begin(),a.end())-a.begin()
#define mine(a) *min_element(a.begin(),a.end())
#define mini(a) min_element(a.begin(),a.end())-a.begin()
ld gcd(ld a, ld b) { if(b == 0) return a; return gcd(b, a % b); }
ld fastpowMOD(ld a, ld p,ld MOD){ if(p==0) return 1; ld z = fastpowMOD(a,p/2,MOD); z = (z*z)%MOD; if(p%2) z = (z*a)%MOD; return z; }
ld fastpow(ld a, ld p){ if(p==0) return 1; ld z = fastpow(a,p/2); z = (z*z); if(p%2) z = (z*a); return z; }
ld a,b;

ld search1(ld a[], ld f,ld n)
{
	ld left=1;
	ld right=n+1;
	while(right-left>1)
	{
		ld mid = left + (right-left)/2;
		if(a[mid]<f)
		{
			left=mid;
		}
		else right=mid;
	}
	return a[left];
}


int main(){
	ld n,i,j,k;
	cin >> n;
	ld h[n];
	ld a[n];
	ld base = 1;
	while(base<=n)
	{
		base=base*2;
	}
	vector<ld> tree(2*base,0);
	rep(i,0,n)cin >> h[i];
	rep(i,0,n)cin >> a[i];
	ld dp[n+1];
	memset(dp,0,sizeof(dp));
	for(i=0;i<n;i++)
	{
		ld x = base+h[i];
		while(x>1)
		{
			if(x%2==1)dp[h[i]]=max(dp[h[i]],tree[x-1]+a[i]);
			x/=2;
		}
		for(j=base+h[i];j>=1;j/=2)
		{
			tree[j]=max(tree[j],dp[h[i]]);
		}	
	}
	cout << *max_element(dp,dp+n+1) << endl;
	return 0;
}
/*
for(j=0;j<h[i];j++)
{
	dp[h[i]]=max(dp[h[i]],dp[j]+a[i]);
}
*/

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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

string N;

int dp[100][4][2];

int recurse(int pos, int rem, bool lessthan) {
	if (pos == N.length()) return (rem == 0);
	if (rem == 0) return recurse(pos + 1, rem, lessthan);
	

	if (dp[pos][rem][lessthan] != -1) return dp[pos][rem][lessthan];

	int ans = 0;
	if (lessthan) {
		// use digit
		ans += 9 * recurse(pos + 1, rem - 1, true);
		
		// dont use digit
		ans += recurse(pos + 1, rem, true);
	} else {
		// use digit
		for (int i = 1; i <= 9; ++i) {
			if (i < N[pos] - '0') {
				ans += recurse(pos + 1, rem - 1, true);
			} else if (i == N[pos] - '0') {
				ans += recurse(pos + 1, rem - 1, false);
			}
		}

		// dont use digit
		if (N[pos] == '0') {
			ans += recurse(pos + 1, rem, false);
		} else {
			ans += recurse(pos + 1, rem, true);
		}
	}

	dp[pos][rem][lessthan] = ans;
	return ans;
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> N;
	int orig_length = N.length();
	for (int i = 0; i < 100 - orig_length; ++i) {
		N = "0" + N;
	}

	int K; cin >> K;

	for (int i = 0; i < 100; ++i) {
		for (int j = 0; j <= 3; ++j) {
			for (int k = 0; k < 2; ++k) {
				dp[i][j][k] = -1;
			}
		}
	}

	
	print(recurse(0, K, false));
}

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

m = 0
pre = 0
for j in range(K):
    pre += l[j]
m = pre

if K>1 and N>K:
  for i in range(N-K):
    temp = pre
    temp += l[i+K]
    temp -= l[i]
    if temp > m:
      m = temp
    pre = temp

if K==1:
  for i in range(N):
    if l[i] > m:
      m = l[i]


print((m+K)/2)

Measured memory_bytes: 24804
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
// #include <atcoder/all>

using boost::multiprecision::cpp_int;
using namespace std;
// using namespace atcoder;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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; }

typedef long long ll;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = int(s.size());
  if(s[n-1] == 's') cout << s << "es" << endl;
  else cout << s << "s" <<endl;
}


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

int main(){
  long n,a,b;
  cin >> n >> a >> b;
  for(int i=1;i<n;i++){
    long c,d;
    cin >> c >> d;
    long e = max((a+c-1)/c,(b+d-1)/d);
    a = e*c;
    b = e*d;
  }
  cout << a+b << endl;
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

#define REP(k, n) for (ll k = 0; k < (ll)(n); ++k)
#define REPREV(k, n) for (ll k = (ll)(n)-1; k >= 0; --k)
#define FOR(k, a, b) for (ll k = (ll)(a); k < (ll)(b); ++k)
#define FORREV(k, a, b) for (ll k = (ll)(b)-1; k >= (ll)(a); --k)
#define FOREACH(e, v) for (auto e : v)

#define TGET(t, i) get<i>(t)
#define TSET(t, i, a) get<i>(t) = a
// MinHeap - priority_queue<ll, vll, greater<ll>> pq;

#define EVEN(n) ((n)&1) == 0
#define ODD(n) ((n)&1) == 1
#define MOD(x, m) ((x) % (m) + (m)) % (m)

#define SORT(v) sort(v.begin(), v.end())
#define SORTREV(v) sort(v.rbegin(), v.rend())
#define SHUFFLE(v) random_shuffle(v.begin(), v.end())
//srand(unsigned(time(0)));

#define REMOVEAT(v, i) v.erase(v.begin() + i)
#define REVERSE(v) reverse(v.begin(), v.end())

template <typename T>
void join(vector<T>& arr, string sep) {
    bool first = true;
    for (auto t : arr) {
        if (first) {
            first = false;
            cout << t;
        } else {
            cout << sep << t;
        }
    }
    cout << "\n";
}

#define POS "POSSIBLE"
#define IMPOS "IMPOSSIBLE"

// #define INF LLONG_MAX
// #define MINF LLONG_MIN
#define INF 9e18
#define MINF -INF

void solve() {
    ll x, n;
    cin >> x >> n;
    set<ll> a;
    REP(i, n) {
        ll b;
        cin >> b;
        a.insert(b);
    }
    if (n == 0) {
        cout << x << "\n";
        return;
    }
    ll nearest;
    REP(i, 102) {
        if (!a.count(x-i)) {
            nearest = x-i;
            break;
        }
    }

    REP(i, 102) {
        if (!a.count(x+i)) {
            if (abs(nearest-x) > abs(i))
            nearest = x+i;
            break;
        }
    }

    cout << nearest << "\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int tt = 1;
    // cin >> tt;
    for (int t = 1; t <= tt; t++) {
        // cout << "Case #" << t << ": ";
        solve();
    }

    return 0;
}

Measured memory_bytes: 3648
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;


void solve(std::string S){
    ll N = S.length();
    vll a(N, 0);
    REP(i, N){
        if(S[i]=='B')
            a[i]=1;
    }
    vll sum(N+1, 0);
    REP(i, N){
        sum[i+1] = sum[i]+a[i];
    }
    ll cnt = 0;
    REP(i, N){
        if(S[i]=='W'){
            cnt += sum[i];
        }
    }
    cout << cnt << endl;
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 3844
#include<iostream>
#include<string>
#include<utility>
#include<vector>
using namespace std;
void swa(pair<string, int>& a, pair<string, int>& b) {
  pair<string, int> t = a;
  a = b;
  b = t;
}
void wap(int& a, int& b) {
  int t = a;
  a = b;
  b = t;
}
int main () {
  int N;
  cin >> N;
  vector<pair<string, int>>res(N);
  for (int i = 0; i < N; i ++) {
    string S;
    int k;
    cin >> S >> k;
    res[i] = make_pair(S, k);
  }
  vector<int>ans(N);
  for (int i = 0; i < N; i ++) ans[i] = i + 1;
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < N - 1; j ++) {
      if (res[j].first > res[j + 1].first) {
        swa(res[j], res[j + 1]);
        wap(ans[j], ans[j + 1]);
      }
      if (res[j].first == res[j + 1].first && res[j].second < res[j + 1].second) {
        swa(res[j], res[j + 1]);
        wap(ans[j], ans[j + 1]);
      }
    }
  }
  for (int i = 0; i < N; i ++) cout << ans[i] << endl;
}
  



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const ll inf = 1e17, N = 2000007;

int main()
{
    ll n, a, b, c;
    cin>>a>>b>>c;
    swap(a, b), swap(a, c);
    cout<<a<<" "<<b<<" "<<c<<"\n";
    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <iomanip>
#include <vector>
#include <stack>
#include <string>
#include <bitset>
#include <queue>
#include <iostream>
#include <cmath>
#define cz size_t
#define fx(x) << fixed;cout << setprecision(x)
#define u unsigned
#define ll long long
using namespace std;
int a, n, in, r, t, c = 0, k, mx, b, j = 1, m, l, y, rd;
double pi = 3.1415926535;
vector<int > f;
vector<vector<int>> g;
bitset<13> bt(0x0);
string s;
bool ch = true;
stack<cz> q, ans;
vector<bool> used;

int main()
{
	cin.tie();
	cout.tie();
	ios::sync_with_stdio(false);
	//freopen("aquarium.out", "w", stdout); freopen("aquarium.in", "r", stdin);
	cin >> n;
	f.resize(n);
	for (cz i = 1; i < n; i++)
	{
		cin >> a;
		f[a - 1]++;
	}
	for (cz i = 0; i < n; i++)
		cout << f[i] << "\n";
	return 0;
}





Measured memory_bytes: 4000
#include<iostream>
#include<vector>
using namespace std;
int main(){
    int N,count=0;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++)
    {
        cin >> a.at(i);
        if (i%2 == 0 && a.at(i)%2 == 1)
        {
            count++;
        }
        
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int>P;
#define PI 3.14159265359
#define MOD 1000000007
const int MAX = 510000;


int main(){
  int N;
  cin >>N;
  int A[N];
  int B[N-1];
  int sum=0;
  rep(i,N-1){cin >>B[i];}
  rep(i,N){
  	if(i==0){A[i]=B[i];}
    else if(i==N-1){A[i]=B[i-1];}
    else{A[i]=min(B[i],B[i-1]);}
  }
  rep(i,N){sum+=A[i];}
  cout<<sum;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#include<bits/stdc++.h>
#define lli long long int
int main(){
  string s;
  cin>>s;
  lli k=s.size();
  lli s0=count(s.begin(),s.end(),'0');
  lli s1=count(s.begin(),s.end(),'1');
  cout<<k-(abs(s0-s1));
  return 0;
}

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

int main(){
    int a,b;
    cin>>a>>b;
    int t,ans=-1;
    for(int i=1;i<=100000;i++){
        int A,B;
        A=i*8/100;
        B=i/10;
        if(A!=0&&B!=0){
        if(a==A&&b==B){
            ans=i;
            break;
            }
        }
        }
    cout<<ans<<endl;
    }


Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)


func main() {
	var n int
	_, _ = fmt.Scan(&n)
	l := make([]int, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Scan(&l[i])
	}
	sort.Ints(l)

	count := 0
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			//a + b
			t := l[i] + l[j]
			tmpL := l[j+1:]
			min, max := -1, len(tmpL)

			for min + 1 < max {
				if mid := (min + max) / 2; tmpL[mid] < t {
					min = mid
				} else {
					max = mid
				}
			}
			count += min + 1
		}
	}
	fmt.Println(count)
}


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

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < 10; ++i)
    if (n / i < 10 && n / i * i == n) {
      puts("Yes");
      return 0;
    }
  puts("No");
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++)a[i] = sc.nextInt();
		int sum = 0;
		for(int i=0;i<n;i++) {
			sum += a[i];
		}
		System.out.println(sum - n); 
	}
}


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

int main() {
  ll a,b;
  cin >> a >> b;
  if (b % a == 0) {
    cout << a + b << endl;
  } else {
    cout << b - a << endl;
  }
}

/*　【提出前に確認すること】
・コンパイルできるか
・テストケース試したか
・オーバーフローあるか
*/


Measured memory_bytes: 256
/*
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
typedef mp::cpp_int mint; //*/
#include <bits/stdc++.h>
#define  re(i,j,n) for(li i=(j);i<(n);i++)
#define  rep(i,n) re(i,0,(n))
#define  red(i,n) for(li i=n-1;i>=0;i--)
#define  all(a) begin(a),end(a)
#define  pb(a) push_back(a)
using namespace std;
typedef long int li;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<li> vli;
typedef vector<string> vs;


int main()
{
    li n,ans=1;
    cin>>n;
    rep(i,n) ans*=i+1,ans%=1000000007;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <algorithm>
#include <assert.h>
using namespace std;
typedef long long ll;

#define REP(j,n) for (int (j)=0; j<(int)(n); ++j)
#define FOR(j,k,n) for (int (j)=(k); j<(int)(n); ++j)
#define FOREQ(j,k,n) for (int (j)=(k); j<=(int)(n); ++j)

#define MEMSET(z,val) memset(z,val,sizeof(z))

int n, m;
int x[30000];
int c[100];
int memo[20010][260];

inline ll square(ll x) { return x * x; }

ll calc(int depth, int color) {
    assert(0 <= color && color <= 255);
    if (memo[depth][color] != -1) { return memo[depth][color]; }
    if (depth == n) { return memo[depth][color] = 0; }
    ll ret = 1LL << 60;
    REP(i, m) {
        int ncolor = color + c[i];
        ncolor = max(0, min(255, ncolor));
        int cost = square(abs(x[depth + 1] - ncolor));
        ret = min(ret, calc(depth + 1, ncolor) + cost);
    }
    return memo[depth][color] = ret;
}

int main() {
    while (scanf("%d %d", &n, &m), n|m) {
        MEMSET(memo, -1);
        REP(i, m) {
            scanf("%d", &c[i]);
        }
        REP(i, n) {
            scanf("%d", &x[i + 1]);
        }
        printf("%lld\n", calc(0, 128));
    }
}

Measured memory_bytes: 22000
#pragma GCC optimize("O2")
// #include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
using namespace std;
#define MOD 1000000007


int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	long long  x;
	cin >> x ;
	long long cnt = 100 ;
	long long ans = 0 ;
	while (cnt < x) {
		cnt += cnt / 100 ;
		ans++;
	}
	cout << ans << "\n";

	return 0 ;
}



Measured memory_bytes: 3616
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

//nCr mod m
#define MOD 1000000007
#define M 2200000
vector<ll> fact;
bool h=false;
void init(){
	h=true;
	fact=vector<ll>(M);
	fact[0]=fact[1]=1;
	loop(i,2,M)fact[i]=fact[i-1]*i%MOD;
}
// a^b mod MOD
ll powmod(ll a,ll b,ll m=MOD){
	ll out=1;
	ll p=a%m;
	while(b){
		if(b&1)out=out*p%m;
		p=p*p%m;
		b>>=1;
	}
	return out;
}
//nCr
ll nCr(ll n,ll r,ll m=MOD){
	if(!h)init();
	if(n<0||r<0||n<r)return 1;//??????
	ll out=fact[n]*powmod(fact[r]*fact[n-r]%m,m-2,m)%m;
	return out;
}

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

	int a,b;
	cin>>a>>b;
	if(a<b)swap(a,b);
	cout<<string(a,'0'+b)<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,N) for(int i=0;i<N;i++)
#define print(S) cout<<S<<endl
using namespace std;

int main() {
	int N;
	long long int A,B,count=0;
	cin>>N>>A>>B;
	int X[N];
	cin>>X[0];
	REP(i,N-1){
		cin>>X[i+1];
		if(B>(X[i+1]-X[i])*A){
			count+=(X[i+1]-X[i])*A;
		}else{
			count+=B;
		}
	}
	print(count);
	return 0;
}

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

int d12, d13, d23, T;

void comparar () {
    int t1=d12+d23;
    int t2=d13+d23;
    int t3=d12+d13;
    if (t1>=t2) {
        T=min(t3,t2);
    } else {
        T=min(t1,t3);    
    }
}

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>d12>>d13>>d23;
    comparar();
    cout<<T;
        
   return 0;
}


Measured memory_bytes: 3588
import itertools
import math
n = int(input())
a = [ int(x) for x in range(1,n+1)]
jun = list(itertools.permutations(a))
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]


sum = 0
for i in jun:
    for j in range(n-1):
        sum +=  math.sqrt((x[i[j]-1]-x[i[j+1]-1])**2 + (y[i[j]-1]-y[i[j+1]-1])**2)
print(sum/len(jun))




Measured memory_bytes: 7972
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
    sc.Scan()
    i, e := strconv.Atoi(sc.Text())
    if e != nil {
        panic(e)
    }
    return i
}

func main() {
    sc.Split(bufio.ScanWords)
    a := nextInt()
    b := nextInt()
    c := nextInt()
    array := []int{a, b, c}
    sort.Sort(sort.IntSlice(array))
    fmt.Printf("%d %d %d\n", array[0], array[1], array[2])
}


Measured memory_bytes: 1108
#include<stdio.h>

int main (void){

   int i,j,t,max,maxj;
   int array[5]={0};

   for(i=0;i<5;i++){
    scanf("%d",&array[i]);
   }

  for(i=0;i<5;i++){
   max=0;
   maxj=i;
   for(j=i;j<5;j++){
     if(max<array[j]){
         max = array[j];
         maxj = j;
     }
   }
  t = array[i];
  array[i] = array[maxj];
  array[maxj] = t;
 
  }

  printf("%d %d %d %d %d\n",array[0],array[1],array[2],array[3],array[4]);


return 0;
}

Measured memory_bytes: 596
#include<iostream>
using namespace std;
main()
{
	int q;cin>>q;
	for(;q--;)
	{
		long a,b;cin>>a>>b;
		if(a>b)a^=b^=a^=b;
		if(a==b||a+1==b)
		{
			cout<<2*a-2<<endl;
		}
		else
		{
			long f=0,l=1e9;
			for(int i=0;i<99;i++)
			{
				long m=(f+l)/2;
				if(m*m<a*b)f=m;
				else l=m;
			}
			if(f*(f+1)>=a*b)
			{
				cout<<2*f-2<<endl;
			}
			else
			{
				cout<<2*f-1<<endl;
			}
		}
	}
}

Measured memory_bytes: 256
N, K = map(int,input().split())
ans = 0
a = K + 1

if K != 0:
    for i in range(K, N):
        s = N % a
        t = N - s
        p = t // a * (a - K)
        q = max(0, s - (K - 1))
        ans += (p + q)
        a += 1
else:
    ans = N ** 2
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define mod 100000000L

int main() {
	int N, P;
	int *A;
	int i;
	int count = 0;
	long ans1 = 1, ans2 = 0;
	scanf("%d %d", &N, &P);
	A = (int*)malloc(sizeof(int)*N);
	for (i = 0; i < N; i++) {
		scanf("%d", &A[i]);
		if (A[i] % 2) {
			count++;
			break;
		}
	}
	if (count == 0 && P == 1) {
		printf("0\n");
		return 0;
	}
	P = N - 1;
	if (count == 0)P++;
	for (i = 0; i < P; i++) {
		ans1 *= 2;
		ans2 *= 2;
		ans2 += ans1 / mod;
		ans1 %= mod;
	}
	if(ans2)printf("%ld%07ld\n", ans2, ans1);
	else printf("%ld\n", ans1);
	return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
constexpr ll mod = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v) {
  int sz = v.size();
  for (int i = 0; i < sz; i++) {
    cout << v[i] << " \n"[i == sz - 1];
  }
}

ll mypow(ll a, ll b) {
  if (b == 0) return 1;
  ll tmp = mypow(a, b / 2);
  if (b % 2)
    return (((tmp * tmp) % mod) * a) % mod;
  else
    return (tmp * tmp) % mod;
}

long long comb(int n, int k) {
  static bool initiated = false;
  static std::vector<long long> fact(200010, 1), inv(200010, 1);
  if (!initiated) {
    initiated = true;
    for (int i = 2; i <= 200000; i++) {
      fact[i] = fact[i - 1] * i % mod;
      inv[i] = mypow(fact[i], (long long)mod - 2);
    }
  }
  if (k < 0 || n < k) {
    return 0;
  }
  long long ret = fact[n] * inv[k] % mod;
  ret = ret * inv[n - k] % mod;
  return ret;
}

using Graph = vector<vector<int>>;
constexpr int MAX_N = 200010;
Graph g(MAX_N);
vector<int> sub(MAX_N);
vector<ll> dp1(MAX_N), ret(MAX_N, 1);
int n;

void dfs(int cur, int pre) {
  sub[cur] = 1;
  for (auto nxt : g[cur]) {
    if (nxt == pre) continue;
    dfs(nxt, cur);
    sub[cur] += sub[nxt];
  }
  dp1[cur] = 1;
  ll sum = sub[cur] - 1;
  for (auto nxt : g[cur]) {
    if (nxt == pre) continue;
    dp1[cur] = dp1[cur] * comb(sum, sub[nxt]) % mod;
    sum -= sub[nxt];
    dp1[cur] = dp1[cur] * dp1[nxt] % mod;
  }
}

void dfs2(int cur, int pre, ll val) {
  //cout << "cur: " << cur << " " << dp1[cur] << endl;
  if (cur != 0) {
    ret[cur] = val * comb(n - 1, n - sub[cur]) % mod;
    ll sum = sub[cur] - 1;
    for (auto nxt : g[cur]) {
      if (nxt == pre) continue;
      ret[cur] = ret[cur] * comb(sum, sub[nxt]) % mod;
      sum -= sub[nxt];
      ret[cur] = ret[cur] * dp1[nxt] % mod;
    }
  }

  for (auto nxt : g[cur]) {
    if (nxt == pre) continue;
    ll tmp = ret[cur];
    tmp = tmp * mypow(comb(n - 1, sub[nxt]), mod - 2) % mod;
    tmp = tmp * mypow(dp1[nxt], mod - 2) % mod;
    dfs2(nxt, cur, tmp);
  }
}

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

  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0, -1);
  ret[0] = dp1[0];
  dfs2(0, -1, 0);
  for (int i = 0; i < n; i++) {
    cout << ret[i] << endl;
  }
}


Measured memory_bytes: 20980
#include<bits/stdc++.h>
#define in inline
#define re register
using namespace std;
in int read() {
	re int t=0;
	re char v=getchar();
	while(v<'0'||v>'9')v=getchar();
	while(v>='0'&&v<='9') {
		t=(t<<3)+(t<<1)+(v^48);
		v=getchar();
	}
	return t;
}
int n,m,ans,a[200002],head[200002],cnt;
struct edge{
	int to,next;
}e[400002];
inline void add(re int x,re int y){
	e[++cnt]=(edge){y,head[x]};
	head[x]=cnt;
}
signed main(){
	n=read();m=read();
	for(re int i=1;i<=n;++i)a[i]=read();
	for(re int i=1,x,y;i<=m;++i){
		x=read();y=read();
		add(x,y);
		add(y,x);
	}
	for(re int i=1;i<=n;++i){
		bool ia=1;
		for(re int j=head[i];j;j=e[j].next)if(a[i]<=a[e[j].to]){
			ia=0;
			break;
		}
		if(ia)++ans;
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 6032
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<cmath>
#include<stack>
#include<vector>
#include<cstdio>
using namespace std;
long long s[200005];
int main()
{
   int n;
   while(scanf("%d",&n)==1)
   {
      long long sum=0;
      s[0]=0;
      for(int i=1;i<=n;i++)
      {
         int a;
         scanf("%d",&a);
         sum+=a;
         s[i]=s[i-1]+a;
      }
      long long minn=300000000000000;
      for(int i=1;i<n;i++)
      {
         long long a=abs(sum-s[i]-s[i]);
         if(minn>a)
            minn=a;
      }
      cout<<minn<<endl;
   }
   return 0;
}


Measured memory_bytes: 1792
from collections import Counter
N=int(input())
d={chr(i):100 for i in range(ord("a"),ord("z")+1)}
for i in range(N):
  A={chr(i):0 for i in range(ord("a"),ord("z")+1)}
  A.update(Counter(list(input())))
  for i in A:
    if d[i]>A[i]:
      d[i]=A[i]
for i in d:
  if d[i]==100:
    d[i]=0
ans=""
key=sorted(d.keys())
for i in key:
  ans+=i*d[i]
print(ans)

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

long long s,x,y,x2,y2;

int main()
{
    scanf("%lld",&s);
    x=1e9;y=1;
    y2=s/x;
    if(s%x!=0) y2++;
    x2=x*y2-s;
    printf("0 0 %lld %lld %lld %lld",x,y,x2,y2);

    return 0;
}

Measured memory_bytes: 3752
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

#define int long long

const int N = 5004;
const int INF = 1e18 + 239;

int dp[2][N][N];
int cdp[2][N][N];

int a[N];
int sz[N];
vector<int> g[N];

//dp[0] - pos
//dp[1] - neg

void dfs(int cur, int P) {
	sz[cur] = 1;
	vector<int> sons;
	for (auto t : g[cur]) {
		if (t != P) {
			dfs(t, cur);
			sz[cur] += sz[t];
			sons.push_back(t);
		}
	}
	for (int i = 0; i <= (int)sons.size(); i++) {
		for (int j = 0; j < sz[cur]; j++) {
			cdp[0][i][j] = INF;
			cdp[1][i][j] = INF;
		}
	}
	if (a[cur] > 0) {
		cdp[0][0][0] = a[cur];
		cdp[1][0][0] = a[cur];
	} else {
		cdp[1][0][0] = a[cur];
	}
	int psz = 1;
	for (int i = 0; i < (int)sons.size(); i++) {
		int son = sons[i];
		for (int p = 0; p < psz; p++) {
			//0
			{
				for (int n = 0; n < sz[son]; n++) {
					if (dp[0][son][n] != INF) {
						cdp[0][i + 1][p + n] = min(cdp[0][i + 1][p + n], cdp[0][i][p] + dp[0][son][n]);
					}
					if (dp[1][son][n] < 0 || dp[0][son][n] != INF) {
						cdp[0][i + 1][p + n + 1] = min(cdp[0][i + 1][p + n + 1], cdp[0][i][p]);
					}
				}
			}
			//1
			{
				for (int n = 0; n < sz[son]; n++) {
					cdp[1][i + 1][p + n] = min(cdp[1][i + 1][p + n], cdp[1][i][p] + dp[1][son][n]);
					if (dp[0][son][n] != INF) {
						cdp[1][i + 1][p + n] = min(cdp[1][i + 1][p + n], cdp[1][i][p] + dp[0][son][n]);
					}
					if (dp[1][son][n] < 0 || dp[0][son][n] != INF) {
						cdp[1][i + 1][p + n + 1] = min(cdp[1][i + 1][p + n + 1], cdp[1][i][p]);
					}
				}
			}
		}
		psz += sz[son];
	}
	for (int i = 0; i < sz[cur]; i++) {
		dp[0][cur][i] = cdp[0][sons.size()][i];
		dp[1][cur][i] = cdp[1][sons.size()][i];
	}
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i + 1 < n; i++) {
		int u, v;
		cin >> u >> v;
		u--;
		v--;
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs(0, -1);
	int ans = n;
	for (int i = 0; i < n; i++) {
		if (dp[0][0][i] != INF) {
			ans = min(ans, i);
		}
	}
	for (int i = 0; i < n; i++) {
		if (dp[1][0][i] < 0) {
			ans = min(ans, i);
		}
	}
	cout << ans << '\n';
}


Measured memory_bytes: 434680
import java.util.Scanner;

class Main {
    final static Scanner IN = new Scanner(System.in);
    static int N = IN.nextInt();
    public static void main(String... args) {
        boolean flag = false;     
        for (int c = 0; c <= N; c += 4) {
            if ((N - c) % 7 == 0) {
                flag = true;
                break;
            }
        }
        System.out.println(flag ? "Yes" : "No");
    }
}

Measured memory_bytes: 21844
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
long long n;
int k = 0, flag = 1;
int main(){
    scanf("%lld", &n);
    while(n >= 10){
        flag &= (n % 10) == 9;
        n /= 10;
        k++;
    }
    printf("%d\n", (int)n + 9 * k - !flag);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}


//-------------------------------------------------
// メモ




//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n ;
  cin >> n ;
  vector<int> vec(8) ;
  int cntt =0 ;
  REP(i,n){
    int a ;
    cin >> a ;
    if(a<3200){
      vec.at(a/400)++ ;
    }
    else{
      cntt++ ;
    }
  }
  int cnt = 0 ;
  REP(i,8){
    if(vec.at(i)!=0){
      cnt++ ;
    }
  }
  
  cout << max(1,cnt) <<" " <<cnt+cntt<<endl ;
  
  
  
  return 0 ;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fs first
#define sc second
using namespace std;

typedef pair<int, int> P;

P operator +(const P& a, const P& b) {
  return {a.fs + b.fs, a.sc + b.sc};
}
P operator -(const P& a, const P& b) {
  return {a.fs - b.fs, a.sc - b.sc};
}

main() {
  P s, t, d;
  cin >> s.fs >> s.sc >> t.fs >> t.sc;
  d = t - s;
  cout << string(d.sc, 'U') << string(d.fs, 'R');
  cout << string(d.sc, 'D') << string(d.fs, 'L');
  d = d + P(1, 1);
  cout << 'L' << string(d.sc, 'U') << string(d.fs, 'R') << 'D';
  cout << 'R' << string(d.sc, 'D') << string(d.fs, 'L') << 'U';
  cout << endl;
}


Measured memory_bytes: 256
# import sys
# import math #sqrt
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # deque
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    x,y,z = map(int,input().split())
    print(z,x,y)
    return

if __name__=='__main__':
    main()

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define deb(x) cout << #x << " = "<< x << " ";

signed main()
{
	//freopen("in.txt", "r",stdin);
	//freopen("out.txt" ,"w", stdout);
	//ios:: sync_with_stdio(false); cin.tie(0);
	
	int x, y, a, b, c;
	cin >> x >> y >> a >> b >> c;
	int red[a], green[b], col_less[c];

	for(int i = 0; i < a; i++) cin >> red[i];
	for(int i = 0; i < b; i++) cin >> green[i];
	for(int i = 0; i < c; i++) cin >> col_less[i];

	sort(red, red+a, greater<int>());
	sort(green, green+b, greater<int>());
	sort(col_less, col_less+c, greater<int>());
	
	int arr[x+y+c];
	for(int i = 0; i < x; i++) arr[i] = red[i];
	for(int i = 0; i < y; i++) arr[x+i] = green[i];
	for(int i = 0; i < c; i++) arr[x+y+i] = col_less[i];

	sort(arr, arr+x+y+c, greater<int>());
	
	cout << accumulate(arr, arr+x+y, 0ll);
}

Measured memory_bytes: 4736
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <iomanip>

using namespace std;

const int maxn = 100002;

int n, mo;
vector<vector<int> > graph;
long long f[maxn], g[maxn], res[maxn];

void dfs(int u, int pre) {
	f[u] = 1;
	vector<int> vs;
	vector<long long> forward;

	for (int i = 0; i < graph[u].size(); ++i) {
		int v = graph[u][i];
		if (v != pre) {
			vs.push_back(v);
			forward.push_back(f[u]);

			dfs(v, u);

			f[u] *= f[v] + 1;
			f[u] %= mo;
		}
	}

	if (vs.empty())
		return;

	long long backward = 1;
	for (int i = vs.size()-1; i >= 0; --i) {
		int v = vs[i];

		g[v] = backward * forward[i] % mo;
		backward *= f[v]+1;
		backward %= mo;
	}
}

void dfs2(int u, int pre) {

	res[u] = g[u];

	if (pre != -1)
		res[u] = res[u] * (res[pre] + 1) % mo;

	for (int i = 0; i < graph[u].size(); ++i) {
		int v = graph[u][i];
		if (v != pre)
			dfs2(v, u);
	}
}

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	cin >> n >> mo;

	graph = vector<vector<int> >(n);

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

		graph[u].push_back(v);
		graph[v].push_back(u);
	}

	dfs(0, -1);
	
	dfs2(0, -1);

	// for (int i = 0; i < n; ++i)
	// 	printf("%d: %d %d %d\n", i+1, f[i], g[i], res[i]);

	for (int i = 0; i < n; ++i)
		cout << (res[i]+1) * f[i] % mo << endl;

	return 0;
}

Measured memory_bytes: 23680
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
   long long h,w;
   cin >> h >> w ;
   long long ans = 0;
   if(h*w%2==0)
    ans=h*w/2;
   else
    ans=h*w/2+1;
   
   if(h==1 || w==1)
    ans=1;

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



Measured memory_bytes: 256
#include<cstdio>
typedef long long ll;
ll f(ll x){
  if(x<0)return 0;
  return ((x%2==0)?x:0)+((x%4==1||x%4==2)?1:0);
}
int main(){
  long long a,b;
  scanf("%lld%lld",&a,&b);
  printf("%lld",f(a-1)^f(b));
  return 0;
}


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

int main(void)
{
    int n;
    int maisuu = 0;
    int oturi;
    cin >> n;
    for(int i = 0; 1000 * i < n; i++ ){
        maisuu++;
    }
    oturi = (maisuu * 1000) - n;

    cout << oturi << endl;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define pb push_back
#define p(x,y) ((x-1)*n+y)
using namespace std;
typedef double db;
const int P=1010,N=P*P,U=2e7+10;
int n,tot=0,B,las;
int pl[N],del[N];
struct Data
{
	vector<int> s[2];
}f[N];
struct MSolve
{
	int D,top=0,cnt=1;
	int cx[50],cy[50],col[N],vis[N];
	void dfs(int x,int y)
	{
		int id=p(x,y),i,v,t1,t2,nx,ny;
		vis[id]=1;
		//printf("P%d %d  %d\n",x,y,col[id]);
		f[tot].s[col[id]].pb(id);
		for(i=1;i<=top;i++)
		{
			for(t1=0;t1<2;t1++)
			{	
				for(t2=0;t2<2;t2++)
				{
					nx=x+(t1==0?cx[i]:-cx[i]);ny=y+(t2==0?cy[i]:-cy[i]);
					if(nx>=1&&nx<=n&&ny>=1&&ny<=n) 
					{
						v=p(nx,ny);col[v]=col[id]^1;
						if(!vis[v]) dfs(nx,ny);
					}
				}
			}
		}
	}
	void solve()
	{
		int i,j,w;
		cin>>D;
		if(D==las) return ;
		las=D;
		for(i=0;i<n&&i*i<=D;i++)
		{
			w=floor(sqrt(D-i*i)+0.5);
			if(i*i+w*w==D) 
			{
				top++;cx[top]=i;cy[top]=w;
			}
		}
		
      tot++;
		for(i=1;i<=n;i++)
		{
			for(j=1;j<=n;j++)
			{
				if(vis[p(i,j)]) continue;
				dfs(i,j);
			}
		}
		//en=clock();
		//printf("time%d\n",(int)(en-st));
	}
}h1,h2;
bool cmp(const int &a,const int &b){return f[a].s[0].size()+f[a].s[1].size()>f[b].s[0].size()+f[b].s[1].size();}
void dfs(int xh,int nas)
{
	if(nas<B) return ;
	if(xh==tot+1)
	{
		int num=0;
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				if(del[p(i,j)]==0) num++,printf("%d %d\n",i-1,j-1);
				if(num==B) exit(0);
			}
		}
		return ;
	}
	int val,i,id;
	for(i=0;i<2;i++)
	{
		id=pl[xh];
		val=nas;
		for(int x:f[id].s[i])
		{
			if(!del[x]) val--;
			del[x]++;
		}
		dfs(xh+1,val);
		for(int x:f[id].s[i])
		{
			del[x]--;
			if(!del[x]) val++;
		}
	}
}
int main()
{
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	int i;
	cin>>n;n*=2;
	B=(n>>1)*(n>>1);
	h1.solve();h2.solve();
	for(i=1;i<=tot;i++) pl[i]=i;
	sort(pl+1,pl+tot+1,cmp);
	dfs(1,n*n);
	return 0;
}

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

long long ans;
int n, fc[9];
const int MOD = 1e9 + 7;

int Mypow(int x, int y) {
	int c = 1;
	while(y) {
		if(y & 1) c = 1LL * c * x % MOD;
		x = 1LL * x * x % MOD;
		y >>= 1;
	}
	return c;
}

int main(void) {
	scanf("%d", &n);
	for(int i = 8; i <= n; i++) {
		int res = n % i;
		if(!res)
			ans = (ans + 9LL * Mypow(10, i - 1) % MOD - n / i + 1 + MOD + n / i / (i + 1) - (n / i % (i + 1) == 0)) % MOD;
		else if (n > 1LL * res * (i + 1))
			ans = (ans + (n / i - res) / (i + 1) + 1 - ((n / i - res) % (i + 1) == 0)) % MOD; 
	}
	fc[0] = 1;
	for(int i = 1; i <= 8; i++)
		fc[i] = fc[i - 1] * 10;
	for(int l = 1, r = 1, now = 1, add = 1, dec = 1; l <= 9999999; ) {
		if(l > r) {
			r++;
			if(r == fc[add]) add++;
			now += add;
		}
		while(now < n) {
			r++;
			if(r == fc[add]) add++;
			now += add;
		}
		if(now == n) ans++;
		l++;
		now -= dec;
		if(l == fc[dec]) dec++;
		
	}
	printf("%d\n", ans % MOD);
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define pss printf
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#define endl '\n'
#define debug(n1) cout<<n1<<endl
const int N = 1e5;  // limit for array size
ll n;  // array size

int main(){
	ll n,k;cin>>n>>k;
	
	if(n%k==0){
		cout<<0<<endl;return 0;
	}
	else{
		cout<<1<<endl;return 0;
	}
	return 0;
}

Measured memory_bytes: 256
//https://atcoder.jp/contests/abc121/tasks/abc121_b

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <bitset>


using namespace std;
int main(){
	//n,mの標準入力
	int n,m,c;
	cin>>n>>m>>c;
	
	//b,aの形状を決定（ベクトルと行列）
	vector<int> b(m);
	vector< vector<int> >  a(n,vector<int>(m));

	//b,aに標準入力
	for(int i=0; i<m; i++) cin>>b.at(i);
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++) cin>>a.at(i).at(j);
	}

	int count=0;
	for(int i=0; i<n; i++){
		int sum=0;
		for(int j=0; j<m; j++){
			sum+=b.at(j)*a.at(i).at(j);
		}
		if(sum+c>0) count++;
	}

	cout<<count<<endl;

}


		




Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
        if i % 2 == 0:
                ans += A[i]
        else:
                ans -= A[i]
tmp = []
tmp.append(ans)
for j in range(1,N + 1):
        tmp.append(A[j - 1] * 2 - tmp[j - 1])

for i in range(len(tmp) -1 ):
        print(tmp[i])



Measured memory_bytes: 14092
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#define SF scanf
#define PF printf
#define MAXN 100010
using namespace std;
int n,u,v,ans;
vector<int> a[MAXN];
int bit[MAXN],f[MAXN];
void dfs(int x,int fa){
	int l=0;
	for(int i=0;i<int(a[x].size());i++){
		int u=a[x][i];
		if(u==fa)
			continue;
		dfs(u,x);
		l|=(bit[x]&bit[u]);
		bit[x]|=bit[u];
	}
	if(bit[x]==0)
		bit[x]=1;
	else{
		while((1<<f[x])<l||(1<<f[x])&bit[x])
			f[x]++;
		bit[x]=(bit[x]/(1<<f[x])*(1<<f[x]))|(1<<f[x]);
	}
	ans=max(ans,f[x]);
}
int main(){
	SF("%d",&n);
	for(int i=1;i<n;i++){
		SF("%d%d",&u,&v);	
		a[u].push_back(v);
		a[v].push_back(u);
	}
	dfs(1,0);
	PF("%d",ans);
}	

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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int m;
ll c[100], d[100];

int dis(ll x, ll y) {
    ll dist = llabs(x - c[0]) + abs(y - d[0]); 
    int index = 0;
    for (int i = 1; i < m; i++) {
        if (dist > llabs(x - c[i]) + llabs(y - d[i])) {
            dist = llabs(x - c[i]) + llabs(y - d[i]);
            index = i;
        }
    }
    
    return (index + 1);
    
}


int main() {
    
    int n;
    cin >> n >> m;
    ll a[n], b[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }

    for (int i = 0; i < m; i++) {
        cin >> c[i] >> d[i];
    }
    
    for (int i = 0; i < n; i++) {
        cout <<dis(a[i], b[i]) << endl;
    }
    
    
    return 0;
}

Measured memory_bytes: 256