akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
long long n,xb,b[1001],c[1001],s[1001];
bool a[1001];
inline long long read()
{
    long long sum=0,x=1;
    char ch=getchar();
    while (ch<'0'||ch>'9')
	{
        if (ch=='-')
          x=-1;
        ch=getchar();
    }
    while (ch>='0'&&ch<='9')
	{
        sum=sum*10+ch-'0';
        ch=getchar();
    }
    return sum*x;
}
inline void write(long long x)    
{
    if (x<0)
    {
    	putchar('-');
    	x=-x;
	}
	if (x>9)
      write(x/10);
    putchar(x%10+'0');
}
int main()
{
	n=read();
	for (register int i=1;i<=n;++i)
	{
		b[i]=read();c[i]=read();
		a[(b[i]+c[i])&1]=1;
	}
	if (a[0]&&a[1])
	{
		write(-1);
		return 0;
	}
	if (a[0])
	  s[++xb]=1;
	for (register int i=30;i>-1;--i)
	  s[++xb]=(1<<i);
	write(xb);putchar('\n');
	for (register int i=1;i<=xb;++i)
	{
		write(s[i]);
	    putchar(' ');
	}
	putchar('\n');
	for (register int i=1;i<=n;++i)
	{
		for (register int j=1;j<=xb;++j)
		{
			if (abs(b[i])>abs(c[i]))
			{
				if (b[i]>0)
				{
					b[i]-=s[j];
				    putchar('R');
				}else
				{
					b[i]+=s[j];
					putchar('L');
				}
			}else
			{
				if (c[i]>0)
				{
					c[i]-=s[j];
				    putchar('U');
				}else
				{
					c[i]+=s[j];
					putchar('D');
				}
			}
		}
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 3660
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  map<ll, ll, greater<ll>> m;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    m[A[i]]++;
  }
  ll prev = 0;
  ll ans = 0;
  for (auto e : m) {
    if (e.second >= 4) {
      ans = max(ans, e.first * e.first);
    }
    if (e.second >= 2) {
      ans = max(ans, e.first * prev);
      prev = max(prev, e.first);
    }
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  int d,n;
  cin>>d>>n;
  if(n==100){
    n++;
  }
  while(d--)n*=100;
  cout<<n<<endl;
  return 0;
}


Measured memory_bytes: 256
n, a, b = gets.split.map(&:to_i)

def sum_digit(n)
  sum = 0
  while n > 0
    sum += n % 10
    n /= 10
  end
  return sum
end

ans = (1..n).map { |i| [i, sum_digit(i)] }
            .select { |d| a <= d[1] && d[1] <= b }
            .inject(0) { |sum, d| sum + d[0] }
p ans

Measured memory_bytes: 2300
#include <sstream>
#include <stdio.h>
#define rep(x,y) for(int x = 0; x < (y); x++)
#define REP(x,z,y) for(int x = (z); x < (y); x++)
#define all(x) x.begin(),x.end()
#define length(x) (sizeof(x) / sizeof(x[0]))
#define split_str(str,sp_word) istringstream stream(str); string res; while(getline(stream,res,sp_word))
#define rm_space(x) x.erase(remove(all(x),' '),x.end())
 
using namespace std;
 
int main(){
  int N;
  int buff = 0;
  int anser = 1;
  
  scanf("%d",&N);

  REP(i,1,N + 1){
   int tmp = i;
   int cnt = 0;
   while(tmp % 2 == 0){
     tmp = tmp / 2;
     cnt++;
   }
   
   if(buff <= cnt){
     buff = cnt;
     anser = i;
   }
  }

  printf("%d\n",anser);
  return 0;
}

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

int asc(const void *a, const void *b) {
  return *(long *)b - *(long *)a;
}

int main(){
   long h[200000],s;
   int n,k,i,a;
 
   scanf("%d %d",&n,&k);
   for (i=0;i<n;i++) scanf("%ld",&h[i]);
   qsort(h,n,sizeof(long),asc);
   s=0;
   for (i=k;i<n;i++) s+=h[i];
   printf("%ld\n",s);
   return 0;
}


Measured memory_bytes: 3324
N = int(input())
ans = [0] * (N + 1)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n <= N:
                ans[n] += 1
for i in range(1, N + 1):
    print(ans[i])

Measured memory_bytes: 9368
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
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 prn(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << ' ';}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
template<class T> inline void printvv(vector<vector<T>>& v) {for (auto u : v) printv(u);}
template<class T> inline void printlnv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << endl;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int a, b, c;
    cin >> a >> b >> c;
    int ans = 0;
    while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and ans < 100000000) {
        ans++;
        int aa = b / 2 + c / 2;
        int bb = a / 2 + c / 2;
        int cc = a / 2 + b / 2;
        a = aa;
        b = bb;
        c = cc;
    }
    cout << (ans >= 100000000 ? -1 : ans) << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

ll frac[100005];

int main() {
  frac[0] = 1;
  for(ll i=1;i<100005;++i) frac[i] = frac[i-1]*i%mod;
  ll N, M;
  cin>>N>>M;
  if(N==M) {
    cout<<frac[N]*frac[M]%mod*2%mod<<endl;
  }
  else if(abs(N-M)==1) {
    cout<<frac[N]*frac[M]%mod<<endl;
  }
  else {
    cout<<0<<endl;
  }
}



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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a) {
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'[';
    for(const T &i: a) out<<i<<',';
    out<<']';
    return out;
}
template<class T>
ostream &operator <<(ostream& out, const set<T>& a) {
    out<<'{';
    for(const T &i: a) out<<i<<',';
    out<<'}';
    return out;
}
template<class T, class S>
ostream &operator <<(ostream& out, const map<T,S>& a) {
    out<<'{';
    for(auto &i: a) out<<i<<',';
    out<<'}';
    return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

    ll l, r;
    cin >> l >> r;

    if(r-l+1 >= 2019) {
        cout << 0 << endl;
        return 0;
    }

    ll ans = INF;
    FOR(i, l, r+1) FOR(j, i+1, r+1) {
        chmin(ans, i*j%2019);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import bisect
cp=[1,2,4,8,16,32,64,128,256,512]
while 1:
    try:
        ans=[]
        n=input()
        while 1:
            index=bisect.bisect_left(cp,n)
            if n in cp:
                ans.append(n)
                break
            ans.append(cp[index-1])
            n%=cp[index-1]
        ans.reverse()
        print(' '.join(map(str,ans)))
    except:
        break

Measured memory_bytes: 6356
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstring>
#include <cmath>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int MOD = 1e9+7;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h, w;
  cin >> h >> w;
  vector<vector<ll>> dp(h, vector<ll>(w, -1));
  rep(i, h) rep(j, w) {
    char c;
    cin >> c;
    if (c == '#')
      dp[i][j] = 0;
  }
  dp[0][0] = 1;
  rep(i, h) rep(j, w) {
    if (dp[i][j] != -1)
      continue;
    ll res = 0;
    if (i)
      res += dp[i-1][j];
    if (j)
      res += dp[i][j-1];
    dp[i][j] = res%MOD;
  }
  cout << dp[h-1][w-1] << endl;
  return 0;
}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vt vector
#define pb push_back
#define pob pop_back
#define ii pair<int,int>
#define vi vt<int>
#define vvi vt<vi>
#define vii vt<ii>
#define vvii vt<vii>
typedef long long ll;
#define For(i,a,b) for(int i = a; i < b; i++)
#define foR(i,a,b) for(int i = a; i <= b; i++)
#define roF(i,a,b) for(int i = a - 1; i >= b; i--)
#define Rof(i,a,b) for(int i = a; i >= b; i--)
#define N 100000
#define lg 20
int hotel[N];
int last[N][lg];
queue<ii> q;
signed main (){
	/*
	freopen(".inp","r",stdin);
	freopen(".out","w",stdout);
	*/
	int n, l;
	cin >> n;
	For(i,0,n){
		cin >> hotel[i];
	}
	cin >> l;
	For(i,0,n){
		q.push(ii(hotel[i], i));
		while(q.back().first > q.front().first+l){
			last[q.front().second][0] = q.back().second-1;
			q.pop();
		}
	}
	while(!q.empty()){
		last[q.front().second][0] = q.back().second;
		q.pop();
	}
//	For(i,0,n){
//		cout << last[i] << " ";
//	}
	For(j,1,20){
		For(i,0,n){
			last[i][j] = last[last[i][j-1]][j-1];
		}
	}
	int q, a, b;
	cin >> q;
	while(q--){
		cin >> a >> b;
		if(a > b){
			swap(a,b);
		}
		a--;b--;
		int coun = 1;
		roF(i,20,0){
			if(last[a][i] < b){
				a = last[a][i];
				coun += 1<<i;
			}
		}
		cout << coun << "\n";
	}
}



Measured memory_bytes: 18432
#include<bits/stdc++.h>
using namespace std;
int main(){
    vector<int>vec(3);
    for(int i=0;i<3;i++){
        cin>>vec.at(i);
    }
    sort(vec.begin(),vec.end());
    cout<<vec.at(0)<<" "<<vec.at(1)<<" "<<vec.at(2)<<endl;
}


Measured memory_bytes: 3152
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) std::begin(a), std::end(a)
#define RALL(a) std::rbegin(a), std::rend(a)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

constexpr int INF = 2e9;
constexpr double EPS = 1e-10;
constexpr double PI = acos(-1.0);

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

template <typename T>
constexpr int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
constexpr int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T, typename U>
constexpr void chmax(T& m, U x) {
	m = max(m, x);
}

template <typename T, typename U>
constexpr void chmin(T& m, U x) {
	m = min(m, x);
}

template <typename T>
constexpr T square(T x) {
	return x * x;
}

// 繰り返し2乗法
// 計算量 O(logn)
template <typename T>
constexpr T pow(T a, int n, int p) {
	T ret = 1;
	while(n != 0) {
		if(n % 2) {
			ret *= a;
			ret %= p;
		}
		a *= a;
		a %= p;
		n /= 2;
	}
	return ret;
}

int main() {
	int n, p;
	string s;
	cin >> n >> p;
	cin >> s;
	ll result = 0;
	if(p == 2 || p == 5) {
		REP(i, n) {
			if((s[i] - '0') % p == 0) {
				result += i + 1;
			}
		}
	} else {
		vector<ll> u(n + 1);
		unordered_map<int, int> cnt;
		u[0] = 0;
		cnt[0] = 1;
		REP(i, n) {
			u[i + 1] = u[i] + (s[n - i - 1] - '0') * pow(10, i, p);
			u[i + 1] %= p;
			result += cnt[u[i + 1]];
			cnt[u[i + 1]]++;
		}
	}
	cout << result << endl;
	return 0;
}


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

using namespace std;
using ll = long long int;

int main() {
    ll N, M;
    cin >> N >> M;
    ll dp[N+1];
    int a;
    ll K = 1000000007;
    for (int i = 0; i <= N; i++){
        dp[i] = 0;
    }

    for (int i = 0; i < M; i++){
        cin >> a;
        dp[a] = -1;
    }
    dp[0] = 1;
    for (int i = 0; i < N; i++){
        if (dp[i] == -1){
            continue;
        }
        if (i + 1 <= N and dp[i+1] != -1){
            dp[i+1] += dp[i];
            dp[i+1] %= K;
        }
        if (i + 2 <= N and dp[i+2] != -1){
            dp[i+2] += dp[i];
            dp[i+2] %= K;
        }
    }
    cout << dp[N] % K << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
const int dx[4] = { -1, 0,  0, 1 };
const int dy[4] = { 0, 1, -1, 0 };
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	vector<string> A(H);
	int res = 0;
	int c = 0;
	for (int i = 0; i < H; i++) {
		cin >> A[i];
		for (int j = 0; j < W; j++) {
			if (A[i][j] == '.') {
				c++;
			}
		}
	}
	queue<pair<int, int> >qu;
	qu.push(make_pair(0, 0));	
	vector<vector<int> > d(H, vector<int>(W, (int)1 << 60));
	d[0][0] = 0;
	while ((int)qu.size() > 0) {
		pair<int, int> p = qu.front(); qu.pop();
		for (int i = 0; i < 4; i++) {
			int nx = p.first + dx[i];
			int ny = p.second + dy[i];
			if (nx >= 0 && nx < H && ny >= 0 && ny < W) {
				if (A[nx][ny] == '.') {
					if (d[nx][ny] > d[p.first][p.second] + 1) {
						d[nx][ny] = d[p.first][p.second] + 1;
						qu.push(make_pair(nx, ny));
					}
				}
			}
		}
	}
	if (d[H - 1][W - 1] == (int)1 << 60) {
		cout << -1 << endl;
	}
	else {
		cout << c - d[H - 1][W - 1] - 1 << endl;
	}

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rep1(i, n) for(ll i = 1; i < n+1; i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end());
typedef long long ll;

int main(){
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  map<ll,ll> mp1,mp2;
  rep(i,n){
    mp1[i+a[i]]++;
    mp2[i-a[i]]++;
  }
  ll ans = 0;
  for(auto p : mp1) ans += p.second*mp2[p.first];
  cout << ans << endl;
}


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

using namespace std;

void Main() {
    int N;
    cin >> N;

    map<int, int> factorization;
    for (int i = 2; i <= N; ++i) {
        int n = i;
        for (int j = 2; j * j <= i; ++j) {
            while (n % j == 0) {
                if (factorization.count(j) == 0) {
                    factorization.insert(make_pair(j, 0));
                }
                factorization[j] += 1;
                n /= j;
            }
        }
        if (n != 1) {
            if (factorization.count(n) == 0) {
                factorization.insert(make_pair(n, 0));
            }
            factorization[n] += 1;
        }
    }
    //for (auto e : factorization) {
    //    cout << e.first << " " << e.second << endl;
    //}

    int more75 = 0;
    int more25 = 0;
    int more15 = 0;
    int more5 = 0;
    int more3 = 0;
    for (auto e : factorization) {
        if (e.second + 1 >= 75) {
            ++more75;
        }
        if (e.second + 1 >= 25) {
            ++more25;
        }
        if (e.second + 1 >= 15) {
            ++more15;
        }
        if (e.second + 1 >= 5) {
            ++more5;
        }
        if (e.second + 1 >= 3) {
            ++more3;
        }
    }
    //cout << more75 << " " << more25 << " " << more15 << " " << more5 << " " << more3 << endl;

    int ans = 0;
    if (more75 > 0) {
        ans += more75;
    }
    if (more25 > 0 && more3 > 0) {
        ans += more25 * (more3 - 1);
    }
    if (more15 > 0 && more5 > 0) {
        ans += more15 * (more5 - 1);
    }
    if (more5 > 1 && more3 > 2) {
        ans += (more5 * (more5 - 1) / 2) * (more3 - 2);
    }
    cout << ans << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


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

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

int main(){
    int a, b; cin >> a >> b;
    int g = gcd(a, b);
    a/=g; b/=g;
    int t = (a+b-1) * g + 1;
    cout << t<<endl;
    return 0;
}


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

int main() {
  
  int n;
  cin >> n;
  
  int a;
  long long ans = 0;
  
  for ( int i = 0; i < n; i++){
    cin >> a;
    ans += a - 1;
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 3588
import java.util.Scanner;

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

        if(x >= a && x<= a+b){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

    public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    }
}


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

int n;

int main(){
  cin >> n;
  int m = n;
  int div = 0;
  while(n > 0){
    div += n - (n / 10) * 10;
    n /= 10;
  }
  if(m%div == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string s, t, u;
int a, b;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    cin >> s >> t;
    cin >> a >> b;
    cin >> u;

    if (u == s) a--;
    else b--;

    cout << a << ' ' << b << '\n';
}


Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInteger = readLn :: IO Integer
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readIntegers = map ( fst . fromJust . B.readInteger ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

modifyArray a i f = writeArray a i =<< f <$> readArray a i

main = do
	[ l, r, d ] <- readInts
	print $ ( r `div` d ) - ( ( l - 1 ) `div` d )

Measured memory_bytes: 3756
#include <cstring>
#include <iostream>
#include <vector>
typedef long long ll;
using namespace std;

int main() {
    int D, G;

    cin >> D >> G;
    vector< int > p(D), c(D);

    for (int i = 0; i < D; i++) {
        cin >> p[i] >> c[i];
    }

    int ans = 20000;
    for (int i = 0; i < (1 << D); i++) {
        int score = 0;
        int num = 0;
        int used[D];
        memset(used, 0, sizeof(used));

        for (int j = 0; j < D; j++) {
            if ((i >> j) & 1) {
                score += c[j] + (j + 1) * 100 * p[j];
                num += p[j];
                used[j] = 1;
            }
        }

        if (score >= G) {
            ans = min(ans, num);
            continue;
        }

        for (int j = D - 1; j >= 0; j--) {
            if (used[j] == 0) {
                for (int k = 1; k < p[j] && score < G; k++) {
                    score += (j + 1) * 100;
                    num++;
                }
                if (score >= G) ans = min(ans, num);
                break;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
//Keep calm and carry on..

/*  Problem :
    URL :

*/

#include<bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;


# define fast           ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
# define pb             push_back
# define pi             3.1415926535897932384626
# define mod            1000000007
# define endl          '\n'
# define DEBUG          false
# define F              first
# define S              second
# define loop1(i,a,b)   for(ll i = a; i<b; i++)
# define loop2(i,a,b)   for(ll i = b-1; i>=a; i--)
# pragma GCC optimize "trapv"

 int main(){
     fast;
     int n;     cin>>n;
     int a[n],b[n];
     int cnt = 0;

     loop1(i,0,n) {  cin>>a[i]>>b[i];

        if (a[i] == b[i]){ cnt += 1;;

            if (cnt == 3){ cout<<"Yes";
                return 0;
            }
        }
        else cnt = 0;
    }
    cout<<"No";

     return 0;
}



Measured memory_bytes: 3648
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

std::string S;

int main()
{
  std::cin >> S;

  if( S == "ABC" )
    S = "ARC";
  else
    S = "ABC";

  std::cout << S << std::endl;

  return 0;
}

Measured memory_bytes: 3120
a,b,c = map(int,input().split())
ans = 0
p = 0

for i in range(c):
    if int(a/2)*2==a and int(b/2)*2==b and int(c/2)*2==c:
        if a == b and b == c:
            break
        ans += 1
        x = b / 2 + c / 2
        y = a / 2 + c / 2
        z = b / 2 + a / 2
        a = x
        b = y
        c = z

    else:
        p = 1
        print(ans)
        break



if p == 0:
    print(-1)

Measured memory_bytes: 38256
#include <stdio.h>

int main(){
  int W,H,x,y,r;

  scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);

    if(0 <= x-r && x+r <= W && 0 <= y-r && y+r <= H) {

        printf("Yes\n");

      } else {

        printf("No\n");

} return 0;

}


Measured memory_bytes: 2104
#include <iostream>

using namespace std;

int main() {

	int n, k, x[100];

	cin >> n;
	cin >> k;

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

		cin >> x[i];

	}
	int num = 0;
	int m = 0;
	for (int i = 0; i < n; i = i + 1) {

		num = k - x[i];

		if (num < x[i]) {

			m = m + num * 2;

		}
		else {

			m = m + x[i] * 2;

		}

	}

	cout << m << endl;

}

Measured memory_bytes: 256
from bisect import bisect

def sieve(n):
    num = [True]*n
    num[0] = num[1] = False
    for i in xrange(2,int(n**0.5)+1):
        if num[i]:
            for j in xrange(i**2, n, i):
                num[j] = False
    return [i for i in xrange(2,n) if num[i]]

prime =  sieve(999999)

while True:
	try:
		print bisect(prime, input())
	except:
		break

Measured memory_bytes: 14584
#include <stdio.h>

int main(void)
{
	char str[1024];
	int i;
	
	fgets(str, 1024, stdin);
	i = 0;
	while (str[i] != '\0'){
		if (str[i] >= 'a' && str[i] <= 'z'){
			str[i] -= 0x20;
		}
		i++;
	}
	
	printf("%s", str);
	
	return (0);
}

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

int main(){
  int a,b;
  cin >> a >> b;
  int k = (a+b) / 2;
  if ((a+b) % 2 == 0) cout << k << endl;
  else  cout << "IMPOSSIBLE" << endl;
  
  return 0;
}


Measured memory_bytes: 256
a, b, h, m = map(int, input().split())
import math
vx = 2*math.pi/(12*60)
vy = 2*math.pi/60

x = vx*(60*h+m)
y = vy*m

d = abs(x-y)
z = a**2+b**2-2*a*b*math.cos(d)
z = math.sqrt(z)
print(z)


Measured memory_bytes: 9500
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main() {
    int s[3]; REP(i,3) cin >> s[i];
    int ans=100000;
    REP(i,3){ 
        int c=0; 
        c=s[0]+s[1]+s[2]-s[i];
        ans = min(ans,c);
    }
    cout << ans << endl;


    return 0;
}

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

#define ul unsigned long long
#define ll long long

int main()
{
  ul n,m;
  cin>>n>>m;

  ul s[10];
  ul p[10];
  fill(s, s + 10, 0);
  fill(p, p + 10, 0);

  ul k,cs;
  for (size_t i = 0; i < m; i++)
  {
    cin>>k;
    for (size_t j = 0; j < k; j++)
    {
      cin>>cs;
      cs--;
      s[i]|=1<<cs;
    }
  }
  for (size_t i = 0; i < m; i++)
  {
    cin>>p[i];
  }

  ul msn=1<<n,cj,ct=0;
  for (ul i = 0; i < msn; i++)
  {
    cj=1;
    for (ul j = 0; j < m; j++)
    {
      //cout<<i<<" "<<s[j]<<" "<<__popcount(i&s[j])<<endl;
      if (__builtin_popcount(i & s[j]) % 2 != p[j]) {
        cj=0;
        break;
      }
    }
    ct+=cj;
  }
  cout<<ct<<endl;

  return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int main(void) {
int S[100][2];
int n;
int i=0;

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

i=0;
int flag=0;
    while(i<n){
        if(S[i][0]==S[i][1]){
            flag++; 
        }else{
            flag=0;
        }

        if(flag==3){
            break;
        }
        i++;
    }
    if(flag==3){
        printf("Yes");
    }else{
        printf("No");
    }
    
    return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int mod = 1e9 + 7;
const int inf = 2e9 + 5;
const int N = 1e4 + 5;

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

    int n, m, x;
    cin >> n >> m >> x;

    vi c(n);
    vvi a(n, vi(m));

    for (int i = 0; i < n; i++) {
        cin >> c[i];
        for (int j = 0; j < m; j++) cin >> a[i][j];
    }

    int best = inf;
    for (int bit = 1; bit < (1 << n); bit ++) {
        int cur = 0;
        vi temp(m);

        for (int i = 0; i < n; i++) {
            if (bit & (1 << i)) {
                for (int j = 0; j < m; j++) temp[j] += a[i][j];
                cur += c[i];
            }
        }

        bool flag = true;
        for (int j = 0; j < m; j++) {
            if (temp[j] < x) {
                flag = false;
                break;
            }
        }

        if (flag) {
            best = min(best, cur);
        }
    }

    if (best == inf) cout << "-1\n";
    else cout << best << "\n";

    return 0;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
typedef int64_t ll;
const ll MOD=(ll)1e9+7;

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){
  ll n;
  cin>>n;
  ll a[n],sum=0;
  for(int i=0;i<n;i++){cin>>a[i];sum+=a[i];}
  sum%=MOD;
  sum=sum*sum;
  for(int i=0;i<n;i++){sum-=a[i]*a[i];sum%=MOD;}
  sum*=modinv(2,MOD);
  sum%=MOD;
  cout<<(sum>=0 ? sum : sum+MOD)<<endl;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
//typedef vector<vector<ll>> Graph;

const ll mod = 1e9 + 7;
//const ll mod = 998244353;

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define spa << " " <<
#define fi first
#define se second

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 (a>b) { a=b; return 1; } return 0; }

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<endl;}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<endl;};

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

    ll L, R, d;
    cin >> L >> R >> d;
    ll res = 0;
    for(int i=L;i<=R;i++){
        if(i%d==0) res++;
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main(){
long long n;cin>>n;
vector <long long> v(n);
vector <long long> left(n),right(n);
for(int i=0;i<n;i++)cin>>v[i];
left[0]=v[0];right[n-1]=v[n-1];
long long l=0,r;
for(int i=1;i<n;i++){
    l=__gcd(v[i],left[i-1]);
    left[i]=l;
}
for(int i=n-2;i>-1;i--){
    r=__gcd(v[i],right[i+1]);
    right[i]=r;
}
long long ans=0;
for(int i=0;i<n-2;i++){
    ans=max(ans,__gcd(left[i],right[i+2]));
}
ans=max(ans,max(left[n-2],right[1]));

cout<<ans;
}


Measured memory_bytes: 2560
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

	public void execute() {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();

		int[] score = new int[N];
		int grandTotal = 0;
		for (int i = 0; i < N; i++) {
			score[i] = sc.nextInt();
			grandTotal += score[i];
		}

		if (grandTotal % 10 != 0) {
			System.out.println(grandTotal);
			return;
		} else {
			Arrays.sort(score);
			for (int i = 0; i < N; i++) {
				if (score[i] % 10 != 0) {
					System.out.println(grandTotal - score[i]);
					return;
				}
			}
		}

		System.out.println(0);
		sc.close();
	}

}


Measured memory_bytes: 21844
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge { ll from; ll to; ll cost; };


int main() {
	vector<int>a(5);
	rep(i, 0, 5) {
		cin >> a[i];
	}
	sort(all(a));

	int ans = 101010;
	do{

		int next = 0;
		int p = 0;
		rep(i, 0, 1145) {
			if (i >= next && i % 10 == 0) {
				if (p <= 4) {
					next = i + a[p];
					p++;
					if (p == 5) {
						ans = min(ans, next);
					}
				}
			}
		}
	} while (next_permutation(all(a)));

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

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if ((abs(a - b) <= d && abs(b - c) <= d) || abs(a - c) <= d)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
const ll mod =  1000000007;
//const ll maxn = 1000000000;
// const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------

int main(){
   ll n,a,b;
   cin>>n>>a>>b;
  //cout<<n*a+b<<endl;
  if(n*a<b)cout<<n*a<<endl;
  else cout<<b<<endl;
  
   
}
   



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

vector<int>vec;

int io(int o){
    cout<<o<<endl<<flush;
    string s;
    cin>>s;
    if(s=="Male"){
        vec[o]=1;
        return 0;
    }
    if(s=="Female"){
        vec[o]=2;
        return 0;
    }
    vec[o]=0;
    return 1;
}

int main(){
    int n;
    cin>>n;
    vec.resize(n, -1);
    int st = 0, en = n-1;
    if(io(st))return 0;
    if(io(en))return 0;
    while(true){
        int p = (st+en)/2;
        if(io(p))return 0;
        if((p-st+1)%2==0 && vec[st]==vec[p]){
            en = p;
            continue;
        }
        if((p-st+1)%2==1 && vec[st]!=vec[p]){
            en = p;
            continue;
        }
        if((en - p + 1)%2==0 && vec[en]==vec[p]){
            st = p;
            continue;
        }
        if((en - p + 1)%2==1 && vec[en]!=vec[p]){
            st = p;
            continue;
        }
        st = p;
    }
    return 0;
}

Measured memory_bytes: 1236
n = int(input())
h = list(map(int, input().split()))
ans = 0

for _ in range(max(h)):
    vi = [i for i in range(n) if h[i] > 0]
    cnt = 1
    for i in range(len(vi)-1):
        cnt += (vi[i] != vi[i+1] -1)
    ans += cnt
    h = list(map(lambda x: x - 1, h))
    
print(ans)


Measured memory_bytes: 3060
import sys
sys.setrecursionlimit(10**7)


N, u, v = map(int, input().split())
u -= 1
v -= 1

graph = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)


dist = []
def dfs(v, depth=0, parent=-1):
    global dist
    dist[v] = depth
    for u in graph[v]:
        # 親には行かないようにする
        if u == parent:
            continue
        dfs(u, depth + 1, v)


def calc_dist(s):
    global dist
    dist = [0 for _ in range(N)]
    dfs(s)
    return dist


distS = calc_dist(u)
distT = calc_dist(v)

mx = 0
for i in range(N):
    if distS[i] < distT[i]:
        mx = max(mx, distT[i])

print(mx - 1)


Measured memory_bytes: 117112
#include<bits/stdc++.h>
using namespace std;
#define MaxN 100003
#define inf INT_MAX

int N;
char opt;
struct point {
	long long x, y;
	double dtx, dty;
}a[MaxN];

double Chk(double tim) {
	double x, y, d = inf, u = -inf, l = inf, r = -inf;
	for(register int i = 1; i <= N; ++i) {
		x = a[i].x + a[i].dtx * tim, y = a[i].y + a[i].dty * tim;
		if(y < d)
			d = y;
		if(y > u)
			u = y;
		if(x < l)
			l = x;
		if(x > r)
			r = x;
	}
	return (r - l) * (u - d);
}

int main() {
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> N;
	for(register int i = 1; i <= N; ++i) {
		cin >> a[i].x >> a[i].y >> opt;
		if(opt == 'R')
			a[i].dtx = 1.0;
		else if(opt == 'L')
			a[i].dtx = -1.0;
		else if(opt == 'U')
			a[i].dty = 1.0;
		else
			a[i].dty = -1.0;
	}
	double L = 0.0, R = 100000000.0, Mid1, Mid2, dlt, r1, r2, Ans;
	for (int i = 1; i <= 100; ++i) {
		dlt = (R - L) / 3.0;
		Mid1 = L + dlt, Mid2 = Mid1 + dlt;
		r1 = Chk(Mid1), r2 = Chk(Mid2);
		if(r1 < r2) {
			R = Mid2;
			Ans = r1;
		}
		else {
			L = Mid1;
			Ans = r2;
		}
	}
	cout << fixed << setprecision(10) << Ans << endl;
	return 0;
}

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

typedef long long ll;

#define rep(i, n) for (int i = 0; i < (ll)n; ++i)
#define INF 10e7
#define MOD 1000000000 + 7
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
using namespace std;

void solve(void)
{
    int n;
    cin >> n;
    int ans = -1;
    rep(i, n + 1)
    {
        if (floor(1.08 * i) == n)
            ans = i;
    }
    if (ans == -1)
        cout << ":(" << endl;
    else
        cout << ans << endl;
}

int main(void)
{
    solve();
}


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

#define debug(x) cout << #x << ": " << (x) << endl

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

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

  bool dp[10001];
  int res = 0;
  memset(dp, 0, sizeof(dp));
  dp[0] = 1;

  for (int i = 0; i < N; i++) {
    for (int j = 10000; s[i] <= j; j--) {
      dp[j] |= dp[j - s[i]];
      if (dp[j] and j % 10 != 0)
        res = max(res, j);
    }
  }

  cout << res << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
const int maxn = 1e5 + 10;
const int maxm = 1e5 + 10;
struct edge{
	int to;
	int next;
}Edge[2 * maxm];
int head[maxn], pos, n, color[maxn];
void init(){
	for(int i = 0; i < maxn; i++) head[i] = -1;
	for(int i = 0; i < maxn; i++) color[i] = -1; // -1 is uncolored 1 is whrite, 0 is black
	pos = 0;
}
void addEdge(int u, int v){
	Edge[pos].to = v;
	Edge[pos].next = head[u];
	head[u] = pos;
	pos++;
}
void BFS(){
	queue <int> q;
	//queue <int> qb;
	q.push(1);
	color[n] = 1;
	q.push(n);
	color[1] = 0;
	while(!q.empty()){
		//if(!qb.empty()){
			int h = q.front();
			//cout << "B" << h << endl;
			q.pop();
			for(int i = head[h]; i != -1; i = Edge[i].next){
				if(color[Edge[i].to] == -1){
					//cout << Edge[i].to << " ";
					color[Edge[i].to] = color[h];
					q.push(Edge[i].to);
				}
			}
			//cout << endl;
		
	}

}
int main(){
	//freopen("input.txt", "r", stdin);
	while(scanf("%d", &n) != EOF){
		init();
		for(int i = 1; i <= n - 1; i++){
			int u, v;
			scanf("%d%d", &u, &v);
			addEdge(u, v);
			addEdge(v, u);
		}
		//cout << n << endl;
		BFS();
		int white = 0, black = 0;
		for(int i = 1; i <= n; i++){
			//cout << i << ":"<< color[i] << endl;
			if(color[i] == 1) white++;
			else black++;
		}
		//cout << white <<" "<< black << endl;
		if(white < black) printf("Fennec\n");
		else printf("Snuke\n");
	}
	return 0;
}

Measured memory_bytes: 2560
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
int N, K;

int main() {
  cin >> N >> K;
  int ans = 1;
  rep(i, 0, N) { ans = min(2 * ans, ans + K); }
  cout << ans;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define repm(i, a, b) for (ll i = (ll)(a); i > (ll)(b); i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(), (x).rend()
#define pll pair<long long, long long>
#define pb emplace_back
#define mp make_pair
#define mt make_tuple
#define vc vector<char>
#define vvc vector<vc>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
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;}
//snippets:tmp,cl,cvl,cs,co,coy,con,cov,setp



int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin >> n;
    ll x;
    cin >> x;
    ll t;
    cin >> t;
    cout<<((n-1)/x+1)*t<<endl;
}


Measured memory_bytes: 3644
# -*- coding: utf-8 -*-
x = list(map(int,input().split()))
x.sort()
a,b,c = x
ret = 0
while c > b:
    a+=1
    b+=1
    ret+=1
while a < b:
    a+=2
    ret+=1
if a!=b:
    ret+=1
print(ret)


Measured memory_bytes: 2940
n = gets.strip.to_i
arr = gets.chomp.split(" ").map(&:to_i)

# n = 2
# arr = [1000000000, 1000000000]


# n = 3
# arr = [101, 9901, 999999000001]


MAX = 10**18

arr = arr.sort{|a, b| b<=>a}

if arr.include?(0)
  puts 0
  exit(0)
end

i = 1
sum = arr[0]

loop do
  sum = sum * arr[i]
  # p sum

  if sum > MAX
    puts "-1"

    exit(0)
  end
  
  i += 1
  break if i == n
end

puts sum




Measured memory_bytes: 25120
#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main() {
	int N, Q;
	cin >> N >> Q;
	string s;
	cin >> s;
	vector<int>l(Q), r(Q);
	vector<int>sum(N , 0);
	for (int i = 0; i < Q; ++i)cin >> l[i] >> r[i];
	for (int i = N-1; i >0; --i) {
		if (s[i-1] == 'A' && s[i] == 'C')sum[i-1]++;
		sum[i - 1] += sum[i];
	}
	for (int i = 0; i < Q; ++i) {
		int ans = sum[l[i] - 1] - sum[r[i] - 1];
		cout << ans<< endl;
	}
	return 0;
}


Measured memory_bytes: 2176
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> P;
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define fr(i,n) for(int i=0;i<(n);i++)
#define Fr(i,n) for(int i=0;i++<(n);)
#define ifr(i,n) for(int i=(n)-1;i>=0;i--)
#define iFr(i,n) for(int i=(n);i>0;i--)

int main(){
    ll n,m,ans=0;
    cin>>n>>m;
    vector<ll> a(n),d(n),b(m),c(m);
    vector<P> p(m);
    fr(i,n) cin>>a[i];
    fr(i,m){
        cin>>b[i]>>c[i];
        p[i]=mp(c[i],b[i]);
    }
    sort(p.begin(),p.end());
    reverse(p.begin(),p.end());
    sort(a.begin(),a.end());
    //reverse(a.begin(),a.end());
    int k=0;
    fr(i,n){
        if(k==m){
            ans+=a[i];
            continue;
        }
        if(a[i]>=p[k].ft){
            ans+=a[i];
        }
        else{
            ans+=p[k].ft;
            p[k].sd--;
            if(p[k].sd==0) k++;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii=pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c),end(c)
#define rall(c) rbegin(c),rend(c)
#define fore(x,c) for(auto &&x:c)
#define rep(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define rrep(i, a, n) for(int i=(int)(n-1);i>=a;--i)
#define sz(c) ((int)c.size())
#define contains(c,x) (c.find(x)!=end(c))
#define inseg(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(nullptr); ios::sync_with_stdio(0);
        cout << setprecision(15) << fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int X, Y, Z;
    cin >> X >> Y >> Z;
    cout << (X - Z) / (Y + Z) << endl;
    return (0^_^0);
}



Measured memory_bytes: 256