akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A
{
    class Program
    {
        public static void Main(string[] args)
        {
            var n = ReadLineInt();

            Console.WriteLine($"ABC{n}");
            ReadLine();
        }

        /// <summary>
        /// stringを一文字ずつintにキャストして配列に変換します。
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int[] StringCharArrayIntArray(string str)
        {
            List<int> b = new List<int>();
            for (int i = 0; i < str.Length; i++) {
                b.Add( int.Parse(str[i].ToString()));
            }
            return b.ToArray();
        }

        public static string ReadLine()
        {
            return Console.ReadLine();
        }

        public static int ReadLineInt()
        {
            return int.Parse(Console.ReadLine());
        }

        public static string[] ReadLineStringSplit(char a = ' ')
        {
            return ReadLine().Split(a).ToArray();
        }

        public static int[] ReadLineIntSpilit(char a = ' ')
        {
            return ReadLine().Split(a).Select(x => int.Parse(x)).ToArray();
        }
    }
}

Measured memory_bytes: 11220
S=int(input())
count=1
for i in range(1000000):
    if S==8:
        print(count+4)
        break
    elif S==4:
        print(count+3)
        break
    elif S==2:
        print(count+3)
        break
    elif S==1:
        print(count+3)
        break
    elif S%2==0:
        S//=2
        count+=1
    else:
        S=S*3+1
        count+=1
    


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

	constexpr static uint mod = mod_;

	uint v;
	ModInt():v(0){}
	ModInt(ll v):v(normS(v%mod+mod)){}
	explicit operator bool() const {return v!=0;}
	static uint normS(const uint &x){return (x<mod)?x:x-mod;}		// [0 , 2*mod-1] -> [0 , mod-1]
	static ModInt make(const uint &x){ModInt m; m.v=x; return m;}
	ModInt operator+(const ModInt& b) const { return make(normS(v+b.v));}
	ModInt operator-(const ModInt& b) const { return make(normS(v+mod-b.v));}
	ModInt operator-() const { return make(normS(mod-v)); }
	ModInt operator*(const ModInt& b) const { return make((ull)v*b.v%mod);}
	ModInt operator/(const ModInt& b) const { return *this*b.inv();}
	ModInt& operator+=(const ModInt& b){ return *this=*this+b;}
	ModInt& operator-=(const ModInt& b){ return *this=*this-b;}
	ModInt& operator*=(const ModInt& b){ return *this=*this*b;}
	ModInt& operator/=(const ModInt& b){ return *this=*this/b;}
	ll extgcd(ll a,ll b,ll &x,ll &y) const{
		ll u[]={a,1,0},v[]={b,0,1};
		while(*v){
			ll t=*u/ *v;
			rep(i,3) swap(u[i]-=t*v[i],v[i]);
		}
		if(u[0]<0) rep(i,3) u[i]=-u[i];
		x=u[1],y=u[2];
		return u[0];
	}
	ModInt inv() const{
		ll x,y;
		extgcd(v,mod,x,y);
		return make(normS(x+mod));
	}
	bool operator==(const ModInt& b) const { return v==b.v;}
	bool operator!=(const ModInt& b) const { return v!=b.v;}
	friend istream& operator>>(istream &o,ModInt& x){
		ll tmp;
		o>>tmp;
		x=ModInt(tmp);
		return o;
	}
	friend ostream& operator<<(ostream &o,const ModInt& x){ return o<<x.v;}
};
using mint = ModInt<1000000007>;
bool B(int x,int i){return (x>>i)&1;}

int N,M;
bool e[15][15];
int edgenum[15][1<<15];
mint dp[1<<15][2];

int calcedgenum(int x,int S){	//from x to S
	int n = 0;
	rep(i,N) if(B(S,i) && e[x][i]) n++;
	return n;
}
void precalc(){
	rep(x,N) rep(b,1<<N) edgenum[x][b] = calcedgenum(x,b);
}

mint p2[1000];

int main(){
	p2[0] = 1;
	rep1(i,999) p2[i] = p2[i-1]*2;
	cin>>N>>M;
	rep(i,M){
		int x,y;
		cin>>x>>y;
		x--,y--;
		e[x][y] = 1;
	}
	precalc();
	dp[0][0] = 1;
	rep(b,1<<N) rep(t,2) if(dp[b][t]){
		int nb = (1<<N)-1 - b;
		for(int c = nb;c!=0;c=(c-1)&nb){
			int d = nb-c;
			mint coef = 1;
			rep(x,N) if(B(d,x)){
				int n = edgenum[x][c];
				coef *= (p2[n]-1);
			}
			rep(x,N) if(B(b,x)){
				int n = edgenum[x][c];
				coef *= p2[n];
			}
			int nt = t || (B(c,0)&&B(c,1));
			dp[b|c][nt] += dp[b][t] * coef;
		}
	}
	cout<<dp[(1<<N)-1][0]<<endl;
}


Measured memory_bytes: 2432
#include<bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const ll MOD = 1000000007;

int main() {
  int a, b;
  cin >> a >> b;
  if (a >= 10 || b >= 10) cout << -1 << endl;
  else cout << a * b << endl;
  return 0;
}

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

int main(void){
  int N;
  int count=0;
  cin>>N;
  vector<int>height,core;
  core.resize(N);
  for(int i=0;i<N;i++){
    cin>>core[i];
    height.push_back(core[i]);
    if(i==0)continue;
    if(height[i]>=height[i-1])count++;
    sort(height.begin(),height.end());
  }
  cout<<count+1;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

int main() {
  int N; cin >> N;
  vector<double> x(N), y(N);
  for (int i = 0; i < N; ++i) cin >> x[i] >> y[i];

  std::vector<int> v(N);
  int cnt = 0;
  double total = 0;
  for (int i = 0; i < N; ++i) v[i] = i;
  do {
    for (int j = 1; j < N; ++j) {
      int a = v[j];
      int b = v[j-1];
      total += hypot(x[a]-x[b], y[a]-y[b]);
    }
    ++cnt;
  } while(next_permutation(v.begin(), v.end()));

  printf("%.9f\n", total/cnt);
}


Measured memory_bytes: 3808
#include <cstdio>
#include <cstring>
#define MAX(a,b)((a)>=(b)?(a):(b))
int n,m,h[200],r[200],memo[200];
int solve(int x) {
	if(memo[x]!=-1)return memo[x];
	int max_d=0;
	for(int i=0;i<(n+m);i++) {
		if(h[x]>h[i]&&r[x]>r[i]) {
			max_d=MAX(max_d,1+solve(i));
		}
	}
	return memo[x]=max_d;
}
int main() {
	while(scanf("%d",&n),n) {
		for(int i=0;i<n;i++) {
			scanf("%d %d",&h[i],&r[i]);
		}
		scanf("%d",&m);
		for(int i=0;i<m;i++) {
			scanf("%d %d",&h[i+n],&r[i+n]);
		}
		memset(memo,-1,sizeof(memo));
		int max_d=0;
		for(int i=0;i<(n+m);i++) {
			max_d=MAX(max_d,1+solve(i));
		}
		printf("%d\n",max_d);
	}
}

Measured memory_bytes: 1028
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <set>
#include <queue>
#include <limits>
#include <deque>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <map>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>
#include <cwchar>
#include <cwctype>
#define mp make_pair
#define fs first
#define se second
#define memset(a,t) memset(a,t,sizeof(a))
#define all(v) v.begin(),v.end()
#define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define MN 0LL
#define Mx 2000000005
#define Mn -Mx
#define MX 20000000000000005
using namespace std;
int readint(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&c!='-');
	bool flag=(c=='-');
	if(flag)c=getchar();
	int x=0;
	while(c>='0'&&c<='9'){
		x=x*10+c-48;
		c=getchar();
	}
	return flag?-x:x;
}
inline string tos(int x){
	string s;
	while(x) s=(char)(x%10+'0')+s,x/=10;
	return s;
}
pair<pair<long long,long long>,double> n[4];
int main(){
	ios_base::sync_with_stdio(false);
	long long a,b,c,d;
	long long a1,b1,c1,d1,ans=0;
	long long k;
	cin>>a>>b>>c>>d;
	a1=a*8;
	b1=b*4;
	c1=c*2;
	d1=d*1;
	n[0]=mp(mp(a1,a),25);
	n[1]=mp(mp(b1,b),50);
	n[2]=mp(mp(c1,c),100);
	n[3]=mp(mp(d1,d),200);
	sort(n,n+4);
	cin>>k;
	k*=100;
//	for(int i=0;i<4;i++) cout<<n[i].first.first<<' '<<n[i].first.second<<' '<<n[i].second<<endl;
	for(int i=0;i<4;i++){
		ans+=(int)(k/n[i].second)*n[i].first.second;
		k-=(int)(k/n[i].second)*n[i].second;
//		cout<<ans<<' '<<k<<endl;
	}
	cout<<ans;
	return 0;
}



Measured memory_bytes: 256
MOD = 10 ** 9 + 7

def get_prime_array(N):
    f = []
    for i in range(2, N + 1):
        flag = 0
        for j in f:
            if i % j == 0:
                flag = 1
                break
        if flag:
            continue
        f.append(i)
    return f


def m():
    n = int(input())
    d = dict()
    prime = get_prime_array(n)
    for i in range(2,n+1):
        tmp = i
        for p in prime:
            while not (tmp == 1):
                if tmp % p == 0:
                    tmp //= p
                    if d.get(p, 0) == 0:
                        d[p] = 1
                    else:
                        d[p] +=1
                else:
                    break
    ans = 1
    for k in d.keys():
        ans *= (d[k]+1)
    return ans % MOD
print(m())


Measured memory_bytes: 3064
void main() {
    int[] tmp = readln.split.to!(int[]);
    int a = tmp[0], b = tmp[1], k = tmp[2];
    int[] ans;
    foreach (i; 0 .. k) {
        if (a + i <= b) {
            ans ~= a + i;
        }
    }
    foreach_reverse (i; 0 .. k) {
        if (!ans.canFind(b - i) && b - i >= a) {
            ans ~= b - i;
        }
    }
    foreach (x; ans) {
        x.writeln;
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <cmath>
#include <limits>
#include <algorithm>
#include <memory>
#include <climits>
#include <iomanip>

constexpr long long MOD = 1000000007;

struct Edge
{
  int v, w;
};

void dfs(const std::vector<std::vector<Edge>>& edges, int cur, std::vector<int>& ans)
{
  for (auto& edge: edges[cur])
  {
    if (ans[edge.v] < 0)
    {
      ans[edge.v] = (edge.w % 2 ? (ans[cur] + 1) % 2 : ans[cur]);
      dfs(edges, edge.v, ans);
    }
  }
}

int main()
{
  int N;
  std::cin >> N;
  std::vector<std::vector<Edge>> edges(N);
  int cnt = N;
  while (--cnt)
  {
    int u, v, w;
    std::cin >> u >> v >> w;
    --u;
    --v;
    edges[u].push_back({v, w});
    edges[v].push_back({u, w});
  }
  std::vector<int> ans(N, -1);
  ans[0] = 0;
  dfs(edges, 0, ans);
  for (auto val: ans)
    std::cout << val << "\n";
  std::cout << std::flush;
  return 0;
}



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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}


typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair


int main() {
  vi primes;
  vector<bool> is_prime(300000, true);
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i < 300000; i++) {
    if (is_prime[i]) {
      primes.push_back(i);
      for (int j = 2; i*j < 300000; j++) {
        is_prime[i * j] = false;
      }
    }
  }
  
  while (true) {
    int n;
    cin >> n;
    if (n == 0) return 0;
    cout << upper_bound(all(primes), 2*n) - upper_bound(all(primes), n) << endl;
  }
}



Measured memory_bytes: 3228
#include <bits/stdc++.h>
using namespace std;
int n,m,num,dis[500010],Link[500010],t=0;
bool vis[500010];
map < pair< int,int >,int> mp;
struct dsa
{
	int v,nex,w;
}e[1200010];
void Insert(int xx,int yy,int zz) 
{
	e[++t].nex=Link[xx];e[t].v=yy;e[t].w=zz;Link[xx]=t;
	e[++t].nex=Link[yy];e[t].v=xx;e[t].w=zz;Link[yy]=t;
}
void Dijkstra()
{
	priority_queue < pair<int,int> > q;
	memset(dis,10,sizeof(dis));
	dis[1]=0;
	q.push(make_pair(0,1));
	while (q.size()) {
		int x=q.top().second;
		q.pop();
		if (vis[x]) continue;
		vis[x]=true;
		for (int i=Link[x];i;i=e[i].nex) 
		  if (dis[x]+e[i].w<dis[e[i].v]) {
		  	  dis[e[i].v]=dis[x]+e[i].w;
		  	  q.push(make_pair(-dis[e[i].v],e[i].v));
		  }
	}
}
int main()
{
	scanf("%d%d",&n,&m);
	num=n;
	for (int i=1;i<=m;i++) {
		int xx,yy,zz;
		scanf("%d%d%d",&xx,&yy,&zz);
		if (mp.find(make_pair(xx,zz))==mp.end()) mp[make_pair(xx,zz)]=++num;
		if (mp.find(make_pair(yy,zz))==mp.end()) mp[make_pair(yy,zz)]=++num;
		Insert(mp[make_pair(xx,zz)],mp[make_pair(yy,zz)],0);
		Insert(mp[make_pair(xx,zz)],xx,1);
		Insert(mp[make_pair(yy,zz)],yy,1);
	}
	Dijkstra();
	if (dis[n]==dis[0]) cout<<"-1"<<endl;else cout<<dis[n]/2;
	return 0;
}

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

//#define DEBUG

using namespace std;

template <class T>
void print_vect(std::vector<T> v){
    for(int i = 0 ; i < v .size(); i++) cout << v[i] << " ";
    cout << endl;
}


void func_to_create(){
    int K, A, B;
    cin >> K >> A >> B;
    if( B < K){
        cout << "NG" << endl;
      	return;
    }
    if( A % K == 0){
        cout << "OK" << endl;
      	return;
    }else if(B % K == 0){
        cout << "OK" << endl;
      	return;
    }else{
        int early_goal = A / K;
        int late_goal = B / K;
        if(late_goal > early_goal){
            cout << "OK" << endl;
          	return;
        }else{
            cout << "NG" << endl;
          	return;
        }
    }
    

}
int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/

    #ifdef DEBUG
    int TEST_CASES = 3;
    while(TEST_CASES--){
    #endif // DEBBUG

    func_to_create();

    #ifdef DEBUG
    }
    #endif // DEBUG
    
    return 0;
}


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

int main(){
	int k;
	int a[35]={0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	cin >> k;
	
	cout << a[k];
	
	return 0;
} 

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
	int N;
	int A;
	cin >> N;
	int all = 1;
	int bad = 1;
	for (int i = 0; i < N; i++) {
		cin >> A;
		all *= 3;
		if (A % 2 == 0)bad *= 2;
	}
	cout << all - bad << endl;
}


Measured memory_bytes: 256
p= []
n= int(input())

for i in range(n):
    x,y = map(float,input().split())
    p.append(complex(x,y))


n=len(p)
sum=0.0
for i in range(1,n-1):
    a,b= p[i]-p[0], p[i+1]-p[0]
    s= (a.conjugate()* b).imag
    sum+= s
print("%.1f" % (abs(sum)/2.0))



Measured memory_bytes: 5624
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define int ll
#define For(a, b, c) for(int a = b; a <= c; ++a)
#define Ford(a, b, c) for(int a = b; a >= c; --a)
#define All(a, b) for(auto &a : b)
#define Rep(a, b, c) for(int a = b; a < c; ++a)
#define ii pair<int,int>
#define F first
#define S second
#define pb push_back
#define all(a) a.begin(),a.end()
#define reset(a, b) memset(a, b, sizeof(a))
#define bit(x, i) (x >> (i - 1) & 1ll)
#define onbit(x, i) (x | (1ll << (i - 1)))
#define offbit(x, i) (x & ~(1ll << (i - 1)))
#define bitone(i) __builtin_popcountll(i)
#define bitl(i) __builtin_clz(i)
#define bitr(i) __builtin_ctz(i)
#define vll vector<ll>
/********************************************************

Digvijay Bahadur Singh
MNNIT

*********************************************************/


const int MOD=998244353;
const int N = 1e6+100;
/********************************************************************/
                 /* GRAPH*/
//vector<vector<ll>> g;
//vector<bool> vis1,vis2;
/*******************************************************************/
ll power(ll a,ll b)
{
   ll ans =1;
   while(b>0){
   if(b&1) ans = (ans%MOD * a%MOD)%MOD;
   a = (a%MOD * a%MOD)%MOD;
   b=b>>1;
   }
   return ans%MOD;
}

signed main(){
  ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
  // ifstream cin("a1.in");
  // ofstream cout("a1.out");
  ll T=1;
 // cin>>T;
  
   // T=1;
    
    while(T--)
  {
     
     int n,a,b;
     cin>>n>>a>>b;
     int ans=(n/(a+b))*a;
     ans+=(min(a,(n%(a+b))));
     cout<<ans<<"\n";
 


      

  }

  
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
  while(1){
  int data[300];
  int a,b,c;
  cin >> a>> b>>c;
  if(a==0&&b==0&&c==0)break;
  for(int i=0;i<a+b+c;i++){
    data[i]=2;
  }
  int n;
  cin >> n;
  int x,y,z,re;
  int save[n][4];
  int nows=0;
  for(int i=0;i<n;i++){
    cin >>x>>y>>z>>re;
    if(re==1){
      data[x-1]=1;
      data[y-1]=1;
      data[z-1]=1;
    }else{
      save[nows][0]=x;
      save[nows][1]=y;
      save[nows][2]=z;
      nows++;
    }
  }
  for(int i=0;i<nows;i++){
    if(data[save[i][0]-1]==1 && data[save[i][1]-1]==1){
      data[save[i][2]-1]=0;
    }else if(data[save[i][1]-1]==1 && data[save[i][2]-1]==1){
      data[save[i][0]-1]=0;
    }else if(data[save[i][2]-1]==1 && data[save[i][0]-1]==1){
      data[save[i][1]-1]=0;
    }
  }
    for(int i=0;i<a+b+c;i++){
      cout<<data[i]<<endl;
    }
    
  }
  
}

Measured memory_bytes: 3112
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
int main(){
    ll a,b,k;
    cin >> a>> b >> k;
    if(a>k){
        cout << a-k << " " << b << endl;
    }else if(a+b>k){
        cout << 0 << " " << a+b-k << endl;
    }else{
        cout << "0 0" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
function Main(input){
	var xs = input.trim().split('\n').map(v=>parseInt(v,10));
    var A = xs[0] % 500
    if(A <= xs[1]){
    console.log('Yes');
    }else{
    console.log('No');
    }
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));

Measured memory_bytes: 11468
#include <iostream>
using namespace std;
int main(){
 int a,b,c,count5=0,count7=0;
  cin>>a>>b>>c;
  if(a==5){
    count5++;
  }
  else{
    count7++;
  }
  if(c==5){
    count5++;
  }
  else{
    count7++;
  }
  if(b==5){
    count5++;
  }
  else{
    count7++;
  }
  if(count5==2 && count7==1)
      cout<<"YES"<<endl;
  else
      cout<<"NO"<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace at
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = int.Parse(Console.ReadLine());
            if(x<1200) Console.WriteLine("ABC");
            else Console.WriteLine("ARC");
        }    
    }
}

Measured memory_bytes: 13140
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;
long long combi(long long n, long long k) {
	if (n == k || k == 0)
		return 1;
	else {
		return combi(n - 1, k - 1) + combi(n - 1, k);
	}
}
int main() {
	int n, m;
	cin >> n >> m;
	priority_queue<int> a;
	int tmp;
	REP(i, n) {
		cin >> tmp;
		a.push(tmp);
	}
	REP(i, m) {
		tmp = a.top() / 2;
		a.pop();
		a.push(tmp);
	}
	ll sum = 0;
	REP(i, n) {
		sum += a.top();
		a.pop();
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 892
#include <iostream> 
using namespace std;
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
int main()
{
	
	int n;
	cin >>n;
	vector<int>res;
	int num;
	
	for(int i = 0;i<n;i++)
	{
		cin>>num;
		res.push_back(num);
	}
	bool tf =true;
	int fr =res[0];
	
	for(int i = 1;i<res.size();i++)
	{
		if(res[i]>fr)
		{
			fr = res[i];
		}
		else if(res[i]==fr-1||res[i]==fr)
		{
			continue;
		}
		else
		{
			tf = false;
			break;
		}
	}
	
	if(tf)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 892
#include<cstdio>
#include<algorithm>

const int MAX=1e9+7;
const long long MIN=-2e12-7;

void read_int (int &a) {
	char c=getchar(); a=0;
	while (c<'0'||c>'9') c=getchar();
	while (c>='0'&&c<='9') a=(a<<1)+(a<<3)-48+c,c=getchar();
	return;
}

int n,num,S,T,c1,c2,c3,c4;

struct edge {
	int next,point,cost,size;
} r[200667]; int last[20037];

void link (int x,int y,int size,int cost) {
	static int tot=1;
	r[++tot]=(edge){last[x],y,cost,size}; last[x]=tot;
	r[++tot]=(edge){last[y],x,-cost,0}; last[y]=tot;
	return;
}

long long val[20003]; int flow[20003];
int pre[20003],cnt[20003];

int q[2000003];
bool bein[20003];

long long SPFA () {
	
	std::fill(val+1,val+num+1,MIN);
	val[S]=pre[S]=cnt[S]=0;
	flow[S]=MAX; flow[T]=0;
	
	int left,right,now;
	q[left=right=1]=S; bein[S]=true;
	
	while (left<=right) {
		now=q[left++]; bein[now]=false;
		for (int i=last[now];i;i=r[i].next)
			if (r[i].size&&val[now]+r[i].cost>val[r[i].point]) {
				val[r[i].point]=val[now]+r[i].cost;
				pre[r[i].point]=now,cnt[r[i].point]=i;
				flow[r[i].point]=r[i].size<flow[now]?r[i].size:flow[now];
				if (!bein[r[i].point])
					q[++right]=r[i].point,bein[r[i].point]=true;
			}
	}
	if (!flow[T]) return 0;
	now=T;
	while (pre[now]) {
		r[cnt[now]].size-=flow[T];
		r[cnt[now]^1].size+=flow[T];
		now=pre[now];
	}
	return val[T]*flow[T];
}

long long cost_flow () {
	long long ans=0,now;
	while ((now=SPFA())) ans+=now;
	return ans;
}

int main () {
	
	read_int(n);
	S=++num; T=++num;
	c1=++num; c2=++num; c3=++num; c4=++num;
	
	for (int i=1,rx,ry,rc;i<=n;i++) {
		read_int(rx); read_int(ry); read_int(rc);
		++num; link(S,num,rc,0);
		link(num,c1,MAX,rx+ry);
		link(num,c2,MAX,rx-ry);
		link(num,c3,MAX,-rx+ry);
		link(num,c4,MAX,-rx-ry);
	}
	
	for (int i=1,bx,by,bc;i<=n;i++) {
		read_int(bx); read_int(by); read_int(bc);
		++num; link(num,T,bc,0);
		link(c1,num,MAX,-bx-by);
		link(c2,num,MAX,-bx+by);
		link(c3,num,MAX,bx-by);
		link(c4,num,MAX,bx+by);
	}
	
	printf("%lld",cost_flow());
	
	return 0;
}

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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    int a, b; char op; cin >> a >> op >> b;
    cout << (op == '+' ? a + b : a - b) << endl;
    return 0;
}


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

#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define for_rev(i,a,b) for(int i=(a);i>=(b);--i)

void solve(int N, int M, const vector< vector< int > >& edge) {
	int Q;
	cin >> Q;
	
	struct Paint {
		int id, v, d, c;
		bool operator < (const Paint& p) const { return id < p.id; }
	};
	
	vector< vector< Paint > > ans(N, vector< Paint >(11, Paint{-1, 0, 0, 0}));
	priority_queue< Paint > que;
	
	for_(q,0,Q) {
		int v, d, c;
		cin >> v >> d >> c;
		--v;
		Paint paint{q, v, d, c};
		que.push(paint);
		ans[v][d] = paint;
	}
	
	while (!que.empty()) {
		Paint p = que.top(); que.pop();
		if (p < ans[p.v][p.d]) continue;
		if (p.d == 0) continue;
		
		for (int u : edge[p.v]) {
			Paint nxt_p{p.id, u, p.d - 1, p.c};
			if (ans[u][nxt_p.d] < nxt_p) {
				ans[u][nxt_p.d] = nxt_p;
				que.push(nxt_p);
			}
		}
	}
	
	for_(v,0,N) {
		Paint p{-1, 0, 0, 0};
		for_(d,0,11) if (p < ans[v][d]) p = ans[v][d];
		printf("%d\n", p.c);
	}
}

int main() {
	int N, M;
	cin >> N >> M;
	
	vector< vector< int > > edge(N, vector< int >());
	for_(i,0,M) {
		int u, v;
		cin >> u >> v;
		--u; --v;
		edge[u].push_back(v);
		edge[v].push_back(u);
	}
	
	solve(N, M, edge);
}

Measured memory_bytes: 36844
#include<iostream>

using namespace std;

int main()
{
	int n,d;

	cin>>n>>d;

	int i = d+1;
	int count=0;
	while(((i-d)<=n)==1)
	{
		count+=1;
		i+= 2*d + 1;
	}
	
	cout<<count<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
bool ishui(string s){
	for(int i=0;i<s.size();++i){
		if(s[i]!=s[s.size()-1-i])return false;
	}
	return true;
} 
string t;
int main(){
	cin>>t;
	if(ishui(t)&&ishui(t.substr(0,t.size()/2))&&ishui(t.substr(t.size()/2+1,t.size()/2))){
		printf("Yes\n");
	}else{
		printf("No\n"); 
	} 
	return 0;
}


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

int main()
{   int A,B,C;
 cin>>A>>B>>C;
 
 if(((A==B)&&(B!=C))||((B==C)&&(A!=C))||((A==C)&&(B!=A)))
 {
   cout<<"Yes"<<endl;
 }
 else
 {
 cout<<"No"<<endl;
 }
    

    return 0;
}


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

long s[51] = {1};
long p[51] = {1};

long f(long N, long X) {
  if (N == 0 && X == 1) {
    return 1;
  } else if (X <= 1) {
    return 0;
  } else if (1 < X && X <= 1 + s[N - 1]) {
    return f(N - 1, X - 1);
  } else if (X == 2 + s[N - 1]) {
    return p[N - 1] + 1;
  } else if (2 + s[N - 1] < X && X <= 2 + 2 * s[N - 1]) {
    return p[N - 1] + 1 + f(N - 1, X - 2 - s[N - 1]);
  } else {
    return 2 * p[N - 1] + 1;
  }
}

int main() {
  long N, X;
  cin >> N >> X;

  for (long i = 1; i <= N; i++) {
    s[i] = 2 * s[i - 1] + 3;
    p[i] = 2 * p[i - 1] + 1;
  }

  cout << f(N, X) << endl;
  return 0;
}

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

int main() {
	char o[50], e[50], s[100];
	cin >> o >> e;
	
	for (int i = 0, j = 0; i <= 100; i++) {
		if (i % 2 == 0) s[i] = o[j];
		else {
			s[i] = e[j];
			j++;
		}
	}
	cout << s << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
     
    int main()
    {
     	int n;
      cin >> n;
      	map<int, int> mp;
      bool ok = true;
      
      for (int i = 0; i < n; i++) {
        int  x;
        cin >> x;
        if (mp[x]) ok = false;
        mp[x] = 1;
      }
      
      if (!ok) cout << "NO\n";
      else cout << "YES\n";
    }

Measured memory_bytes: 9600
#include <stdio.h>
#define min(a, b) (((a) < (b)) ? (a) : (b))
int main(void){
	unsigned long b;
	unsigned long r;
	unsigned long n;
	unsigned long total;
	unsigned long bTotal;

	scanf("%lu%lu%lu", &n, &b, &r);
	total = b * (n / (b + r));
	bTotal = total + min(b, (n % (b + r))); 

	printf("%lu\n", bTotal);

	return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c; cin>>a>>b>>c;
    cout<<max(c-(a-b), 0)<<endl;
    return 0;
}


Measured memory_bytes: 256
//Battle
#include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <map>
#include <stdio.h>
#include <string.h>
#include <initializer_list>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <queue>
#include <set>
using namespace std;
const int INF = 1 << 29;
int main ()
{
    int A,B,C,D;
    cin >> A >> B >> C >> D;

    for (;;) {
        C -= B;
        if (C < 1) {
            cout << "Yes";
            break;
        }
        A -= D;
        if (A < 1) {
            cout << "No";
            break;
        }
        
    }

    return 0;
}

Measured memory_bytes: 3128
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pi acos(-1.0)
#define pii pair<int,int>
#define Lson L, mid, rt<<1
#define Rson mid+1, R, rt<<1|1
const int maxn=1e5+10;
using namespace std;
ll gcd(ll p,ll q)
{
    return q==0?p:gcd(q,p%q);
}
ll qpow(ll p,ll q)
{
    ll f=1;
    while(q)
    {
        if(q&1)
            f=f*p;
        p=p*p;
        q>>=1;
    }
    return f;
}
int n,m,k,t,h[maxn],tot,ans[maxn];
set<int>comp[maxn];
struct node
{
    int to,nxt,com;
} e[maxn<<2];
void add(int x,int y,int z)
{
    tot++;
    e[tot].to=y;
    e[tot].com=z;
    e[tot].nxt=h[x];
    h[x]=tot;
}
priority_queue<pair<int,int> >p;
int main()
{
    int i,j;
    memset(ans,inf,sizeof ans);
    scanf("%d%d",&n,&m);
    while(m--)
    {
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        add(a,b,c);
        add(b,a,c);
    }
    p.push({0,1});
    ans[1]=0;
    while(!p.empty())
    {
        int now=p.top().se,ca=-p.top().fi;  //now是编号，ca是距离
        p.pop();
        if(ans[now]<ca)
            continue;
        for(i=h[now]; i; i=e[i].nxt)
        {
            int to=e[i].to,to_com=e[i].com; //com是权值
            int to_ca=ca+(!comp[now].count(to_com));
            if(ans[to]>to_ca)
            {
                ans[to]=to_ca;
                p.push({-to_ca,to});
                comp[to].clear();
                comp[to].insert(to_com);
            }
            else if(ans[to]==to_ca)
            {
                comp[to].insert(to_com);
            }
        }
    }
    printf("%d\n",ans[n]==inf?-1:ans[n]);
    //system("Pause");
    return 0;
}


Measured memory_bytes: 20216
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  string S; cin>>S;
  int N=S.size();
  int ans=1;
  map<char,int> M;
  rep(i,0,N){
    ans+=i-M[S[i]];
    M[S[i]]++;
  }
  cout<<ans<<endl;
  }



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    int N, M;
    string S;
    cin >> N >> M >> S;
    if (S[0] == '1') { cout << -1 << '\n'; return 0; }

    reverse(S.begin(), S.end());
    vector<int> v;
    for (int i = 0; i < N; ) {
        bool can = false;
        for (int j = M; can == false && j >= 1; j--) {
            int tmp = i+j;
            if (tmp > N) continue;
            if (S[tmp] != '1') {
                v.push_back(j);
                i += j;
                can = true;
            }
        }
        if (can == false) { cout << -1 << '\n'; return 0; }
    }
    for (int i = v.size() - 1; i >= 0; i--) {
        cout << v[i] << (i == 0 ? '\n' : ' ');
    }
}


Measured memory_bytes: 1144
import scala.io.StdIn._
import scala.runtime.ScalaRunTime._

object Main extends App {
  def var_dump(x:Any):Unit = {
    println(stringOf(x))
  }

  def readLineAndConvert[A](f:String=>A): Seq[A] = {
    readLine().split(" ").map(f)
  }
  
  val x = readLineAndConvert(_.toInt)
  println(x.sum % 24 )
}


Measured memory_bytes: 25424
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int A,B,C,D,L,R;
    cin >> A >> B >> C >> D;
    L = A + B;
    R = C + D;
    if (L == R){
    cout << "Balanced" << endl;
    }
    else if (L > R){
    cout << "Left" << endl;
    }
    else if (R > L){
    cout << "Right" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define gc getchar()
inline int read(){
	int x=0,f=1;char c=gc;
	for(;c<48||c>57;c=gc)
		if(c=='-')f=-1;
	for(;c>47&&c<58;c=gc)
		x=x*10+c-48;
	return x*f;
}
#define io read()

typedef long long ll;
#define maxn 200005
int n,a[maxn];
ll b,ans;

inline void init(){
	n=io;
	for(int i=1;i<=n;++i)a[i]=io-i;
	sort(a+1,a+n+1);
	b=a[n+1>>1];
	for(int i=1;i<=n;++i)ans+=abs(a[i]-b);
	printf("%lld\n",ans);
}

inline void solve(){
	
}

int main(){
	init();
	solve();
	return 0;
}

Measured memory_bytes: 1024
S = input()
# 125
s = len(S)-1
ans=0
for bit in range(1 << s):
    a = S[0]
    for i in range(s):
        if bit & (1<<i):
            a += "+"
        a += S[i+1]
    ans += sum(map(int,a.split("+")))
print(ans)


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

typedef long long ll;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m;i>=n;i--)

int main(){
    string A,B,U;
    int a_num,b_num;
    cin >> A >> B;
    cin >> a_num >> b_num;
    cin >> U;
    if(A==U){
        a_num -=1;
    }else{
        b_num -=1;
    }
    cout << a_num << ' ' << b_num << endl;
    return 0;
}

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

int main() {
    string n;
    cin >> n;
    
    if(n.back() == '2' || n.back() == '4' || n.back() == '5' ||
       n.back() == '7' || n.back() == '9') {
        cout << "hon" << endl;
    }
    else if(n.back() == '0' || n.back() == '1' || n.back() == '6' ||
            n.back() == '8') {
        cout << "pon" << endl;
    }
    else
        cout << "bon" << endl;
    
    return 0;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;
// vector<vector<int>> data(3, vector<int>(4));

void solve(long long N, vector<long long> a){
	ll minv = INF, maxv = -INF, minp = -1, maxp = -1;
	rep(i, N) {
		if (a[i] < minv) {
			minv = a[i];
			minp = i;
		}
		if (a[i] > maxv) {
			maxv = a[i];
			maxp = i;
		}
	}
	bool plus;
	if (abs(minv) <= abs(maxv)) {
		plus = true;
	} else {
		plus = false;
	}
	cout << 2*N-2 << endl;
	if (plus) {
		rep(i, N) {
			if (i == maxp) continue; else cout << maxp+1 << " " << i+1 << endl;
		}
		rep(i, N-1) {
			cout << i+1 << " " << i+2 << endl;
		}
	} else {
		rep(i, N) {
			if (i == minp) continue; else cout << minp+1 << " " << i+1 << endl;
		}
		rep(i, N-1) {
			cout << N-i << " " << N-i-1 << endl;
		}
	}
}

int main(){	
	long long N;
	scanf("%lld",&N);
	vector<long long> a(N-1+1);
	for(int i = 0 ; i <= N-1 ; i++){
		scanf("%lld",&a[i]);
	}
	solve(N, a);
	return 0;
}



Measured memory_bytes: 256
import sys

#+++++

def gg():
	a,b=map(int, input().split())
	return (a,b)


def main():
	n,t = map(int, input().split())
	al=[gg() for _ in range(n)]
	cc = [x[0] for x in al if x[1] <= t]
	if len(cc)==0:
		ans='TLE'
	else:
		ans=min(cc)
	print(ans)
	return
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

#define name ""
#define ini freopen(name".inp","r",stdin); freopen(name".out","w",stdout)
#define long long long
#define db double
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
template <class T> inline void chmin(T &a, const T& val) { if (a > val) a = val; }
template <class T> inline void chmax(T &a, const T& val) { if (a < val) a = val; }
template <class T> long sqr(T a) { return 1ll * a * a; }
template <class T> void compress(T &a){
  sort(all(a)); a.resize(unique(all(a)) - a.begin());  
}

const db pi = acos(-1.00);
const db eps = 1e-6;
const int INF = 1e9;
const int MOD = 1e9+7;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};

const int N = 2e5+1;
int P[N];
map <pll, int> cnt;
map <pll, bool> mark;

int main()
{
  fastio;
  int n; cin >> n;
  vector <pll> memo;
  long res = 0;
  for (int i = 1; i <= n; i++){
    long a, b; cin >> a >> b;
    if (a == 0 && b == 0){
      res++; continue;
    }
    if (b == 0) memo.push_back(pll(1, 0));
    else {
      long k = __gcd(a, b); k = abs(k);
      if (b > 0) memo.push_back(pll(a / k, b / k));
      else memo.push_back(pll(-a / k, -b / k));
    }
  }
  P[0] = 1;
  for (int i = 1; i <= n; i++) P[i] = P[i - 1] * 2 % MOD;
  for (pll x : memo) cnt[x]++;
  long tmp = 1;
  for (auto x : cnt){
    pll cur = x.first;
    if (mark[cur]) continue;
    int p = x.second; int q = 0;
    if (cnt.count(pll(cur.second, -cur.first))) q = cnt[pll(cur.second, -cur.first)];
    tmp *= (P[p] + P[q] - 1);
    tmp %= MOD;
    mark[x.first] = true; mark[pll(cur.second, -cur.first)] = true;
  }
  cout << (res + tmp - 1 + MOD) % MOD;
  return 0;
}

Measured memory_bytes: 44536
#include<bits/stdc++.h>
    using namespace std;
    bool option(int a, int b){
        return a % 10 > b % 10;
    }
    int main(){
        vector<int> a;
        int ans = 0;
        for(int i =0; i<5; i++){
            int x; cin>>x;
            if(x % 10 ==0 ){
                ans += x;
            }
            else{
                a.push_back(x);
            }
        }
        sort(a.begin(), a.end(), option);
        /*cout<<"ans = "<<ans<<endl;
        for(int x: a){
            cout<<x<<" ";
        }cout<<endl;*/
        if(a.size() ==0){
            cout<<ans;
            return 0;
        }
        if(a.size() == 1){
            cout<<a[0] + ans;
            return 0;
        }
        for(int i = 0; i+1 < a.size(); i++){
            ans += (10 - a[i] % 10);
            ans += a[i];
        }
        cout<<ans + a[a.size() - 1];
        return 0;
    }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1000000007;

int main(){
    int N;
    cin >> N;
    int a[N];
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    sort(a,a+N);
    for(int i=0;i<N;i+=2){
        if(N%2==0){
            if(a[i]!=i+1||a[i+1]!=i+1){
                puts("0");
                return 0;
            }
        }
        else{
            if(i==0){
                if(a[i]!=i){
                    puts("0");
                    return 0;
                }
            }
            if(a[i]!=i||a[i-1]!=i){
                puts("0");
                return 0;
            }
        }
    }
    LL ans=1;
    N/=2;
    while(N){
        (ans*=2)%=mod;
        N--;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
using System;
using System.Collections.Generic;

namespace DoublyLinkedList
{
    class Program
    {
        static void Main(string[] args)
        {
            var list = new LinkedList<string>();
            var n = int.Parse(Console.ReadLine());
            for(var i = 0; i < n; i++)
            {
                var line = Console.ReadLine();
                var command = line.Split(' ')[0];
                var num = 0;
                if (command == "insert" || command == "delete")
                {
                    num = int.Parse(line.Split(' ')[1]);
                }
                switch (command)
                {
                    case "insert":
                        list.AddFirst(num.ToString());
                        break;
                    case "delete":
                        list.Remove(num.ToString());
                        break;
                    case "deleteFirst":
                        list.RemoveFirst();
                        break;
                    case "deleteLast":
                        list.RemoveLast();
                        break;
                    default:
                        break;
                }
            }
            Console.WriteLine(string.Join(" ", list));
        }
    }
}



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

typedef long long ll;
ll MOD = 1e9+7;

ll rui[100001];//i文字目までにACは何回現れるか
int main()
{
	int n,q;
	string s;
	int ans=0;
	cin>>n>>q;
	cin>>s;
	fill(rui,rui+100001,0);
	for(int i=2;i<n+1;i++)
	{
		rui[i]=rui[i-1];
		if(s[i-1]=='C' && s[i-2]=='A')
			rui[i]++;
	}
	for(int i=0;i<q;i++)
	{
		int l,r;
		cin>>l>>r;
		cout<<rui[r]-rui[l]<<endl;
	}
	return 0;
}

Measured memory_bytes: 1792
////////////////////////////////////////////    _LeMur_
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <chrono>
#include <random>
#include <bitset>
#include <cstdio>
#include <vector>
#include <string>
#include <ctime>
#include <stack>
#include <queue>
#include <cmath>
#include <list>
#include <map>
#include <set>

using namespace std;

const int N = 100005;
const int inf = 1000 * 1000 * 1000;
const int mod = 998244353;

int n;

long double answ;

int main(){
	mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
	cout.setf(ios::fixed);
	cout.precision(13);
    cin >> n;
    for(int i=1;i<=n;i++){
        long double a;
        cin >> a;
        answ += 1.0 / a;
    }
    cout << 1.0 / answ << endl;
    return 0;
}


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

int main(){
  int N;
  cin >> N;
  int sum = 0;
  vector<int> W(N);
  rep(i,N) {
    cin >> W[i];
    sum += W[i];
  }
  
  // 真ん中
  int midSum = 0;
  int pos = -1;
  while (midSum < (sum / 2)){
    pos++;
    midSum += W[pos];
  }
  //cout << midSum << ":" << pos << endl;
  if (midSum - W[pos] > (sum - midSum))
    cout << abs(sum - midSum + W[pos] - midSum + W[pos]) << endl;
  else
    cout << abs(midSum - sum + midSum) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	if(s=="Sunny") cout<<"Cloudy"<<endl;
	if(s=="Cloudy") cout<<"Rainy"<<endl;
	if(s=="Rainy") cout<<"Sunny"<<endl;
	return 0;
} 

Measured memory_bytes: 256
/**
 * Space Coconut Grab
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.Integer.parseInt;

public class Main {

	static final int[] ys = new int[1000001];
	static final int[] zs = new int[1000001];

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		for (int i = 0; i <= 1000; i++) {
			ys[i * i] = i;
		}
		for (int i = 2; i <= 1000000; i++) {
			if (ys[i] == 0) ys[i] = ys[i - 1];
		}
		for (int i = 0; i <= 100; i++) {
			zs[i * i * i] = i;
		}
		for (int i = 2; i <= 1000000; i++) {
			if (zs[i] == 0) zs[i] = zs[i - 1];
		}

		while ((line = br.readLine()) != null && !line.isEmpty()) {
			int e = parseInt(line);
			if (e == 0) break;

			int min = 1000001;
			for (int z = zs[e]; z >= 0; z--) {
				int _min = 0;
				_min += z;
				for (int y = ys[e - (z * z * z)]; y >= 0; y--) {
					_min += y;
					_min += e - (z * z * z) - (y * y);
					min = Math.min(min, _min);
				}
			}
			System.out.println(min);
		} //end while
	} //end main
}

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



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

    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    
    int n;cin>>n;
    vector<int> arr(n);
    int s=0;

    for(int i=0;i<n;i++){
        cin>>arr[i];
        s+=arr[i];
    }
    sort(arr.begin(),arr.end());

    
    if(s%10==0){
        int i=0;
        while(arr[i]%10==0 && i<n){
            i++;
        }
        if(i==n) s=0;
        else s-=arr[i];
    }

    cout<<s<<endl;
    
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
 
// using namespace __gnu_pbds;
using namespace std;
 
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef long double ld;
typedef pair <long long,long long> ii;
typedef complex<long double> point;
#define x real()
#define y imag()

bool cmp(point a,point b){
    return arg(a) < arg(b);
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    vector<point> arr(n);
    for (int z=0;z<n;z++){
        ll a,b;
        cin >> a >> b;
        arr[z] = point(a,b);
    }
    sort(arr.begin(),arr.end(),cmp);
    ld ans = 0;
    for (int i=0;i<n;i++){
        point t;
        for (int j=0;j<n;j++){
            ll p = (j+i)%n;
            t += arr[p];
            ans = max(ans,abs(t));
        }
    }
    cout << setprecision(60) << ans << endl;
}

Measured memory_bytes: 256
A, B = list(map(int, input().split()))
S = input()

flag = 0

for i in range(len(S)):
    if S[i] == '-':
        if i == A:
            flag = 1
        else:
            flag = 0
            break

if flag == 1:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 2940