akhauriyash/Code-Regression huggingface dataset:
import itertools

h,w,k=[int(x) for x in input().rstrip().split()]
l=[]
bl=0
yoko=[]
tate=[]
ans=0
for i in range(h):
  W=[x for x in input()]
  l.append(W)
  bl=0
  for s in W:
    if s=="#":
      bl+=1
  yoko.append(bl)

for i in range(w):
  bl=0
  for j in range(h):
    if l[j][i]=="#":
      bl+=1
  tate.append(bl)

ans=0
if sum(tate)==k:
  ans=1
else:
  ans=0
Y=[]
y_l=[i for i in range(len(yoko))]
for i in range(1,len(yoko)+1):
  for ii in itertools.combinations(y_l,i):
    a=0
    for s in ii:
      a+=yoko[s]

    if sum(tate)-a==k:
      ans+=1
    Y.append(ii)
t_l=[i for i in range(len(tate))]
X=[]
for i in range(1,len(tate)+1):
  for ii in itertools.combinations(t_l,i):
    a=0
    for s in ii:
      a+=tate[s]
    if sum(tate)-a==k:
      ans+=1
    X.append(ii)

now=0
for i in X:#tate
  for j in Y:#yoko    
    for ii in i:
      now+=tate[ii]
    for jj in j:
      now+=yoko[jj]
    for jj in j:
      for ii in i:
        if l[jj][ii]=="#":
          now-=1
    if sum(tate)-now==k:
      ans+=1
    now=0
print(ans)

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

int main(){
    vector<vector<int>> a;
    map<int, pair<int, int>> m;
    rep(i, 3){
        vector<int> k(3, 0);
        rep(j, 3){
            cin >> k[j];
            m[k[j]] = make_pair(i, j);
        }
        a.push_back(k);
    }
    vector<vector<int>> bingo(3, vector<int>(4));
    int n;
    cin >> n;
    vector<int> b(n);
    int r, c;
    rep(i, n){
        cin >> b.at(i);
        if (m.count(b.at(i)) == 1){
            tie(r, c) = m[b.at(i)];
            bingo[r][c] = 1;
        }
    }
    // rep(i, 3){
    //     rep(j, 3){
    //         cout << bingo[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    // check
    bool check = 0;
     // row
    rep(i, 3){
        int s = 0;
        for (auto k:bingo[i]){
            s += k;
        }
        if (s == 3) check = 1;
    }
    // col
    rep(i, 3){
        int s = 0;
        rep(j, 3){
            s += bingo[j][i];
        }
        if (s == 3) check = 1;
    }
    // cross
    int right = bingo[0][0] + bingo[1][1] + bingo[2][2];
    int left = bingo[0][2] + bingo[1][1] + bingo[2][0];
    if (right == 3 || left == 3) check = 1;
    if (check == 1) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
 int f[100];
 int n,i,m=0;
 for(n=99;n>=0;n--)
  f[n]=0;
 scanf("%d",&n);
 n*=2;
 for(;n>0;n--){
  scanf("%d",&i);
  m+=i*f[i-1];
  if(f[i-1]==0)
   f[i-1]=1;
  else
   f[i-1]=0;
 }
 i=0;
 for(n=99;n>=0;n--){
  if(f[n]==1){
   if(i==1){
    m+=(n+1);
    i=0;
   }else{
    i=1;
   }
  }
 }
 printf("%d\n",m);
 return 0;
}

Measured memory_bytes: 128
#include <assert.h>
#include <limits.h>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

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

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cout << i << "\n"

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

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  std::string s;
  std::cin>>s;
  ll n=s.size();
  if(s[0]==s[n-1]){
    if(n%2)std::cout<<"Second";
    else std::cout<<"First";
  }else{
    if(n%2)std::cout<<"First";
    else std::cout<<"Second";
  }
  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;

string ans, str;
int n, p;

string dfs(){
    int res = 0;
    string st = "";
    while (p < str.size()) {
        if (isdigit(str[p])) {
            res = 0;
            while (isdigit(str[p])) {
                res *= 10;
                res += str[p] - '0';
                p++;
            }
        }else if (isalpha(str[p])){
            st = "";
            while (isalpha(str[p])) {
                st += str[p];
                p++;
            }
        }else if (str[p] == '('){
            p++;
            string tmp = dfs();
            for (int i = 0; i < res; i++) {
                if (st.size() > n){
                    return st;
                }
                st += tmp;
            }
        }else if (str[p] == ')'){
            p++;
            return st;
        }else{
            break;
        }
    }
    return st;
}

string complement(string s){
    int p = 0;
    string expanded_string = "";
    while (p < s.size()) {
        if (!isalpha(s[p]) && isalpha(s[p+1])) {
            expanded_string += s[p];
            if (isdigit(s[p])) {
                expanded_string += "(";
            }else{
                expanded_string += "1(";
            }
            p++;
            while (isalpha(s[p])) {
                expanded_string += s[p++];
            }
            expanded_string += ')';
        }else{
            expanded_string += s[p++];
        }
    }
    return expanded_string;
}

int main()
{
    while (true) {
        p = 0;
        cin >> str >> n;
        if (str == "0") {
            break;
        }
        str = complement(str);
        ans = dfs();
        if (ans.size() <= n) {
            cout << "0" << endl;
        }else{
            cout << ans[n] << endl;
        }
    }

    return 0;
}

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

#ifdef _PRINTDEBUG
  #include "lib/printdebug.hpp"
#else
  #define printdebug(...) 1
#endif
#define MOD_1_000_000_007 (1000000007LL)
#define LINF (1LL<<60)
#define rep(i, n)   for (long long i = 0; i <  (long long)(n); i++)
#define rep1(i, n)  for (long long i = 1; i <  (long long)(n); i++)
#define rep2(i, n)  for (long long i = 2; i <  (long long)(n); i++)
#define rep0c(i, n) for (long long i = 0; i <= (long long)(n); i++)
#define rep1c(i, n) for (long long i = 1; i <= (long long)(n); i++)
#define rep2c(i, n) for (long long i = 2; i <= (long long)(n); i++)
#define repc0(n, i) for (long long i = (long long)(n); i >= 0; i--)
#define repc1(n, i) for (long long i = (long long)(n); i >= 1; i--)
#define repc2(n, i) for (long long i = (long long)(n); i >= 2; i--)
#define REP(i, n, m) for (long long i = (long long)(n); i < (long long)(m); i++)

namespace solver {
  using namespace std;
  typedef long long ll;

  string S, T, ABC = "abcdefghijklmnopqrstuvwxyz";
  ll table[100010][26];

  void init() {
    cin >> S;
    cin >> T;
  }

  void solve() {
    string S2 = S+S;
    size_t s_size = S.size();
    size_t t_size = T.size();
    vector<ll> vec[26];
    rep(i, 2*s_size) {
      vec[ABC.find(S2[i])].push_back(i);
    }
    rep(i, 26) {
      if(vec[i].size() == 0) rep(j, s_size) table[j][i] = -1;
      else {
        ll cur = 0;
        for(const auto& j : vec[i]) {
          REP(k, cur, min(j+1, (ll)s_size)) table[k][i] = j % s_size;
          cur = j+1;
        }
      }
    }
    ll cur = 0, ans = 0;
    rep(i, t_size) {
      ll next_cur = table[cur][ABC.find(T[i])];
      if(next_cur == -1) {
        ans = -1;
        break;
      }
      if(cur <= next_cur) ans += next_cur+1-cur;
      else ans += s_size + (next_cur+1-cur);
      cur = (next_cur+1) % s_size;
    }
    cout << ans << endl;
  }
}

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

Measured memory_bytes: 23040
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;

  if (k <= a) {
    cout << k << endl;
  } else if (k <= a + b) {
    cout << a << endl;
  } else {
    cout << a - (k - (a + b)) << endl;
  }
  return 0;
}

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

#define all(v) v.begin(), v.end()
#define mp make_pair
#define EPS (int)1e-9
#define PI acos(-1)
#define endl '\n'
#define pb push_back
#define fi first
#define se second

using namespace std;
using ld = long double;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

const int mod = 1000000007;


int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int x, a, b;
	cin >> x >> a >> b;

	if(abs(x-a) < abs(x-b))
		cout << "A" << endl;
	else
		cout << "B" << endl;
	return 0;	
}

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

int main()
{
  int x, n;
  cin >> x >> n;
  if (n == 0)
  {
    cout << x << endl;
    return 0;
  }
  vector<int> a(102, 0);
  for (int i = 0; i < n; i++)
  {
    int p;
    cin >> p;
    a[p]++;
  }
  int tmp = 101;
  int ans = 0;
  for (int i = 101; i >= 0; i--)
  {
    if (a[i] == 0)
    {
      int buf = abs(x - i);
      if (buf <= tmp)
      {
        tmp = buf;
        ans = i;
      }
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3632
import numpy as np

def L_n(num):
    if num==0:
        return 2
    elif num==1:
        return 1
    else:
        M = np.array([[1,1],[1,0]])
        V = np.array([[1],[2]])
        for i in range(num-1):
            V = np.dot(M,V)
        return V[0][0]

if __name__ == '__main__':
    IN = int(input())
    print(L_n(IN))  

Measured memory_bytes: 13500
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,a,b;
	cin>>n>>a>>b;
	puta(a*(n/(a+b))+min(a,(n%(a+b))));
}


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

using namespace std;

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 27;

typedef tuple<int,int,int> edge;
vector<edge> graph;
vector<edge> spgraph;
int dist[110];

int bellman_ford(int v){
	rep(i,v+1) dist[i]=inf;
	dist[1]=0;
	rep(loop,v){
		for(auto &e:graph){
			int a,b,c;
			tie(a,b,c)=e;
			dist[b]=min(dist[b],dist[a]+c);
		}
		for(auto &e:spgraph){
			int a,b,c;
			tie(a,b,c)=e;
			dist[b]=min(dist[b],dist[a]+c);
		}
		if(*min_element(dist+1,dist+1+v)<0) return -1;
	}
	return *max_element(dist+1,dist+1+v);
}


int main(void){
	int n,k;
	cin >> n >> k;
	vector<edge> sp;
	rep(i,k){
		int a,b,c;
		char rel;
		cin >> a >> rel;
		if(rel=='*'){
			cin >> b >> c;
			sp.pb(make_tuple(a,b,-c));
		}else{
			char dummy;
			cin >> dummy >> b >> c;
			if(rel=='>') swap(a,b);
			graph.pb(make_tuple(b,a,0));
			if(c>0) swap(a,b);
			graph.pb(make_tuple(a,b,-c));
		}
	}
	int ans=-1;
	int m=sp.size();
	rep(mask,1<<m){
		spgraph.clear();
		rep(i,m){
			int a,b,c;
			tie(a,b,c)=sp[i];
			if(mask&(1<<i)){
				if(c<0){
					spgraph.pb(make_tuple(b,a,c));
					spgraph.pb(make_tuple(b,a,0));
				}else{
					spgraph.pb(make_tuple(a,b,c));
					spgraph.pb(make_tuple(b,a,0));
				}
			}else{
				if(c<0){
					spgraph.pb(make_tuple(a,b,c));
					spgraph.pb(make_tuple(a,b,0));
				}else{
					spgraph.pb(make_tuple(b,a,c));
					spgraph.pb(make_tuple(a,b,0));
				}
			}
		}
		ans=max(ans,bellman_ford(n));
	}
	if(ans==inf)
		puts("inf");
	else
		cout << ans << endl;
	return 0;
}

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

// KMP 法, 文字列(s, t)に対して, sの中に含まれるwordの接頭辞のうち最長のものの長さを返す
// オプションとして, sのi番目以降から, あるいはwordが何回sに含まれるかを計算できる
int KMP(string word, string s){
    // KMP_table の作成, 同じwordに複数回するなら処理を分けて
    int n = word.size();
    vector<int> table(n+1, -1);
    int j = -1;
    for(int i = 0; i < n; ++i){
        while(j >= 0 && word[i] != word[j]){
            j = table[j];
        }
        j++;
        table[i+1] = j;
    }

    // KMP法
    int cur = 0, res = 0;
    for(char x : s){
        while(cur >= 0 && word[cur] != x){
            cur = table[cur];
        }
        ++cur;
        res = max(res, cur);
        if(cur == n) break;
    }

    return res;
}

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

    // KMP法でtをいっぱい並べた文字列の先頭から何文字が含まれるかを調べる
    string tk, sk;
    while(tk.size() < s.size() + t.size()){
        tk += t;
    }
    while(sk.size() < s.size() + t.size() * 2){
        sk += s;
    }
    // sk.size() > tk.size() >= 2 * t.size()

    int mx = KMP(tk, sk);

    int ans = -1;
    if(mx < (s.size() + t.size())){
        ans = mx / t.size();
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 13000
#include <iostream>
#include <math.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
using namespace std;

int main() {
	int A, B, C;
	cin >> A >> B >> C;
	cout << max(C - (A - B), 0);
}

Measured memory_bytes: 764
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void  main (String[] args) throws IOException {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String wdn = br.readLine();
		int N = Integer.parseInt(wdn);
		int ans = N;
		int num = 0;

		for (int i=0; i< N; i++) {
			String wdnum = br.readLine();
			num = Integer.parseInt(wdnum);
			if (num == 2){
				continue;
			}
			else if (num % 2 ==0){
				ans--;
				continue;
			}
			for (int j=3; j<=Math.sqrt(num); j+=2){
				if (num%j==0) {
					ans--;
					break;
				}
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 28352
#include <cstdio>
#include <algorithm>
#include <ctype.h>
#define DEBUG
const int bufSize = 1e6;
inline char nc()
{
    #ifdef DEBUG
    return getchar();
    #endif
    static char buf[bufSize], *p1 = buf, *p2 = buf;
    return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, bufSize, stdin), p1 == p2) ? EOF : *p1++;
}
inline void read(char *s)
{
    static char c;
    for (; !isalpha(c); c = nc());
    for (; isalpha(c); c = nc()) *s++ = c;
    *s = '\0';
}
template<typename T>
inline T read(T &r)
{
    static char c;
    static int flag;
    flag = 1, r = 0;
    for (c = nc(); !isdigit(c); c = nc()) if (c == '-') flag = -1;
    for (; isdigit(c); c = nc()) r = r * 10 + c - 48;
    return r *= flag;
}
const int maxn = 40;
int n;
struct node
{
    int x,y,p;
}A[maxn];
int mindis[maxn],steps;
long long ans[maxn],tans;
template<typename T>
inline T _abs(const T &x){return x > 0 ? x : -x;}
void dfs(int x)
{
    if(steps > n) return;
    tans = 0;
    for (int i = 1; i <= n; ++i) tans += 1ll * A[i].p * mindis[i];
    ans[steps] = std::min(ans[steps],tans);
    if(x > n) return;
//    printf("%d %d %d\n",steps,ans[steps],tans);
    dfs(x + 1);
    int copy[16];
    for (int i = 1; i <= n; ++i) copy[i] = mindis[i];
    
    ++steps;
    for (int i = 1; i <= n; ++i) mindis[i] = std::min(mindis[i],_abs(A[i].x - A[x].x));
    dfs(x + 1);
    --steps;
    for (int i = 1; i <= n; ++i) mindis[i] = copy[i];
    
    ++steps;
    for (int i = 1; i <= n; ++i) mindis[i] = std::min(mindis[i],_abs(A[i].y - A[x].y));
    dfs(x + 1);
    --steps;
    for (int i = 1; i <= n; ++i) mindis[i] = copy[i];
}
int main()
{
    read(n);
    for (int i = 1; i <= n; ++i) read(A[i].x),read(A[i].y),read(A[i].p);
    for(int i = 1;i<=n;++i) mindis[i] = std::min(_abs(A[i].x),_abs(A[i].y));
    for (int i = 0; i <= n; ++i) ans[i] = 1ll << 62;
    dfs(1);
    for(int i = 0;i<=n;++i) printf("%lld\n",ans[i]);
    return 0;
}

Measured memory_bytes: 3196
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <regex>
#include <stack>
#include <queue>
#include <vector>
#define MAX_N 100
#define INF 10000000

using namespace std;

int n,m;
int a[200000];

void solve() {
	if (n < 1000) cout << "ABC" << endl;
	else cout << "ABD" << endl;
}

int main() {
	cin >> n ;
	solve();
	return 0;
}

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

int main(void){
	int a,b;
	cin >> a >> b;
	string s;
	if( a < b )s = "a < b";
	else if( a == b )s = "a == b";
	else s = "a > b";
	cout << s << "\n";
	return 0;

}


Measured memory_bytes: 3132
program scoring
  implicit none
  integer :: d, s(26, 365) = 0, t, i, j, x = 0
  integer, dimension(26) :: c = 0, last = 0
  read(*,*) d
  read(*,*) c
  read(*,*) (s(:, i), i = 1, d)
  do i = 1, d
    read(*,*) t
    last(t) = i
    x = x + s(t, i)
    x = x - sum(c * (i - last))
    write(*,'(i0)') x
  end do
end program scoring

Measured memory_bytes: 2960
import java.util.ArrayList;
import java.util.Scanner;

class Main{
	static final long MOD = 1000000007;


	static long pow=1000000007;




	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		long N = sc.nextLong();
		long M = sc.nextLong();

		ArrayList<Integer> sosu = new ArrayList<Integer>();
		long ans = 1;

		for(int i = 2;i*i <= M;i++){
			if(M%i == 0){
				int scount = 0;		
				while(M%i==0){
					scount++;
					M /= i;
				}
				if(scount!=0){
					ans *=comb(scount+N-1,scount);
					ans %= pow;
				}


			}
		}
		if(M!=1){
			ans *= comb(1+N-1,1);
			ans %= pow;

		}

		//		
		//		ArrayList<Integer> numdata = new ArrayList<Integer>();			//各素数ごとの個数を記録
		//		int c = 0;
		//		while(M!=1){
		//			int scount = 0;		
		//			while(M%sosu.get(c) == 0){
		//				scount++;
		//				M /= sosu.get(c);
		//			}
		//			if(scount!=0){
		//				numdata.add(scount);
		//			}
		//			c++;
		//		}
		//		
		//		for(int i = 0;i <numdata.size();i++){
		//			ans *=comb(numdata.get(i)+N-1,numdata.get(i));
		//			ans %= pow;
		//		}
		System.out.println(ans);




	}

	static long comb(long x,Integer y){
		long ue = 1;
		long sita = 1;
		for(int i= 0;i < y;i++){
			ue *= x-i;
			ue %= pow;
			sita *= i+1;
			sita %=pow;

		}


		long ans = ue*modpow(sita,pow-2)%pow;
		return ans;
	}
	static long modpow(long a,long p){
		if(p == 0){
			return 1;
		}
		if(p % 2 == 0){
			long halfp = p/2;
			long half = modpow(a, halfp);
			return half*half%pow;
		}else{
			return a*modpow(a, p-1)%pow;
		}
	}
}







class Pair implements Comparable{
	int from;		//p
	int end;		//y
	int num;
	int bango;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}



Measured memory_bytes: 23764
#include <stdio.h>
int main () {
    int m, f, r;
    scanf("%d %d %d", &m, &f, &r);
    while ((m != -1) || (f != -1) || (r != -1)) {
        if ((m == -1) || (f == -1)) printf("F\n");
        else if (m+f >= 80) printf("A\n");
        else if (m+f >= 65) printf("B\n");
        else if (m+f >= 50) printf("C\n");
        else if (m+f >= 30) {
            if (r >= 50) printf("C\n");
            else  printf("D\n");
        }
        else printf("F\n");
        scanf("%d %d %d", &m, &f, &r);
    }
    return 0;
}



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


long long int Exp(long long int exp_n,long long int exp_e, long long exp_mod);


int main(){
  int N;
  int AC=0,WA=0,TLE=0,RE=0;
  cin >> N;
  string s;
  for(int i=0;i<N;i++){
    cin >> s;
    if(s == "AC"){
      AC++;
    }else if(s == "WA"){
      WA++;
    }else if(s == "TLE"){
      TLE++;
    }else if(s == "RE"){
      RE++;
    }
  }
  
  cout << "AC x " << AC <<endl; 
  cout << "WA x " << WA <<endl;
  cout << "TLE x " << TLE <<endl;
  cout << "RE x " << RE <<endl;

}


long long int Exp(long long int exp_n,long long int exp_e, long long int exp_mod){
  long long int exp_o = 1;
  long long int exp_x=exp_n;
  long long int exp_tmp;
  
  while(0<exp_e){
    exp_tmp = exp_e/2;
    if(exp_e - exp_tmp*2 == 1){
      exp_o = exp_o*exp_x;
      if(exp_o>exp_mod){
        exp_o=exp_o%exp_mod;
      }
    }
    
    exp_x = exp_x*exp_x;
    if(exp_x>exp_mod){
      exp_x=exp_x%exp_mod;
    }
    exp_e = exp_tmp;
  }
  return exp_o;
}


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

using namespace std;
using ll = long long;

#define MAX(a,b) (((a)>(b))?(a):(b))

int main()
{
  ll N, M, A;
  cin >> N >> M;
  if(N==1&&M==1) A=1;
  if(N==1&&M!=1) A=MAX(M-2,0);
  if(N!=1&&M==1) A=MAX(N-2,0);
  if(N!=1&&M!=1) A=MAX(M-2,0)*MAX(N-2,0);
  cout << A << endl;
  return 0;
}

Measured memory_bytes: 3636
#include<stdio.h>
int main(){
  int a,b,c,k;
  scanf("%d %d %d",&a,&b,&c);
  if (a>b){
    k=a;
    a=b;
    b=k;
  }
  if (b>c){
    k=b;
    b=c;
    c=k;
  }
  if (a>b){
    k=a;
    a=b;
    b=k;
  }
  printf("%d %d %d\n",a,b,c);
  return 0;
}

Measured memory_bytes: 596
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:512000000")
#include<utility>
#include<iostream>
#include<fstream>
#include<vector>
#include<array>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<cassert>
#include<ccomplex>

#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

#define all(x) x.begin(), x.end()
#define mp make_pair
#define X first
#define Y second

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937_64 gen(time(nullptr));

ll const mod = 1e9 + 7;

namespace {
	ll mul(ll a, ll b) {
		ll val = a * b - (ll)((ld)a * b / mod) * mod;
		if (val < 0) val += mod;
		if (val >= mod) val -= mod;
		return val;
	}

	ll poww(ll a, ll b) {
		ll val = 1;
		a %= mod;
		while (b > 0) {
			if (b % 2) val = mul(a, val);
			a = mul(a, a);
			b >>= 1;
		}
		return val % mod;
	}

	ll inv(ll a) {
		return poww(a, mod - 2);
	}
}

int const maxn = 3e5 + 5;

struct Line {
	ll k, b;
	mutable const Line* nx;
	bool operator<(ll x) const {
		if (!nx) return 0;
		return b - nx->b < (nx->k - k) * x;
	}
	bool operator<(const Line& rhs) const {
		return k < rhs.k;
	}
};
// will maintain upper hull for maximum
struct HullDynamic : multiset<Line, less<>> {
	bool bad(iterator y) {
		auto z = next(y);
		if (y == begin()) {
			if (z == end()) return 0;
			return y->k == z->k && y->b <= z->b;
		}
		auto x = prev(y);
		if (z == end()) return y->k == x->k && y->b <= x->b;
		return (x->b - y->b) * (z->k - y->k) >= (y->b - z->b) * (y->k - x->k);
	}
	void insert_line(ll k, ll b) {
		auto y = insert({ k, b, 0 });
		if (bad(y)) { erase(y); return; }
		auto z = next(y);
		while (z != end() && bad(z)) z = erase(z);
		if (z != end()) y->nx = &*z;
		while (y != begin() && bad(z = prev(y))) erase(z);
		if (y != begin()) z->nx = &*y;
	}
	ll eval(ll x) {
		auto l = *lower_bound(x);
		return l.k * x + l.b;
	}
};


signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	HullDynamic cht;

	ll n, C; cin >> n >> C;

	vector<ll>h(n);
	for (ll i = 0; i < n; i++) cin >> h[i];

	ll cur = 0;
	

	for (ll i = 0; i < n; i++) {
		if (i)cur = C + h[i] * h[i] - cht.eval(h[i]);
		else cur = 0;
		cht.insert_line(2 * h[i], -(h[i] * h[i] + cur));
	}

	cout << cur << endl;

	return 0;
}

/*
5
2 6 15 5 10

4
2 6 15 5

*/

Measured memory_bytes: 14336
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include<random>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }

ll modPow(ll base, ll ex, ll m) {
	ll ret = 1;
	while(ex){
		if(ex & 1){
			ret = ret * base % m;
		}
		ex >>= 1;
		base = base * base % m;
	}
	return ret;
}
vector<ll> mFacts, mInvFacts;
ll modFact(int n){ return mFacts[n]; }
ll modInvFact(int n){ return mInvFacts[n]; }
ll modInv(int n, ll m){ return modPow(n, m - 2, m); }
ll modC(int n, int k, ll m){ return modFact(n) * modInvFact(k) % m * modInvFact(n - k) % m; }
void init(int n, ll m){
    mFacts.resize(n + 1);
    mInvFacts.resize(n + 1);
    mFacts[0] = 1;
    for(int i = 1; i <= n; i++){
        mFacts[i] = mFacts[i - 1] * i % m;
    }
    mInvFacts[n] = modInv(mFacts[n], m);
    for(int i = n - 1; i >= 0; i--){
        mInvFacts[i] = mInvFacts[i + 1] * (i + 1) % m;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    init(1e6, M);
    int n, m;
    cin >> n >> m;
    unordered_map<int, int> fs;
    for(int i = 2; i <= sqrt(m); i++){
        while(m % i == 0){
            fs[i]++;
            m /= i;
        }
    }
    if(m > 1){
        fs[m]++;
    }
    printde(fs);
    ll ans = 1;
    for(auto& p : fs){
        ans = ans * modC(n - 1 + p.second, p.second, M) % M;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 15872
'''
import math
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def bitlist(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res
'''
#a = list(map(int, input().split()))
'''
n,m,t = list(map(int, input().split()))

nb = [[] for i in range(n+1)]
for i in range(n):
    a,b = list(map(int, input().split()))
    nb[a].append([b,i])
    nb[b].append([a,i])
print(nb)

order = [-1 for i in range(n+1)]
order[1] = 0
noworder = 1
nbnow = [len(nb[i])-1 for i in range(n+1)]

print(nbnow)
queue = [[1,999999]]
deque = 0

while(len(queue)>deque and len(queue)<20):
    nownum = queue[deque][0]
    nowpos = queue[deque][1]
    deque+=1
    print("a",nownum,nowpos)
    while(True):
        if(nb[nownum][nbnow[nownum]][1] > nowpos):
            nbnow[nownum] -= 1
        if(nbnow[nownum]<=-1):
            break
    if(nbnow[nownum]<=-1):
        continue
    
    nextnum = nb[nownum][nbnow[nownum]][0]
    nextpos = nb[nownum][nbnow[nownum]][1]
    print(nextnum,nextpos)
    if(order[nextnum]==-1):
        queue.append([nextnum,nextpos])
        order[nextnum]=noworder
        noworder+=1


print(order)
'''

#a = list(map(str, input().split()))

a,b,k = list(map(int,input().split()))
if(a >= k):
    print(a-k,b)
else:
    print(0,max(0,b-(k-a)))



Measured memory_bytes: 38256
N,K=map(int,input().split())

DIV = 10 ** 9 + 7
ans = 1
for k in range(K,N+1):
  maxV = (N + (N - k + 1)) * k // 2
  minV = ((k - 1) * k) // 2
  ans += (maxV - minV + 1)
  ans %= DIV
  
print(ans)

Measured memory_bytes: 9188
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

lst = get_sieve_of_eratosthenes(2*10**5)
x = I()
for i in lst:
    if x <= i:
        print(i)
        quit()


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

using namespace std;

#define fin cin
#define fout cout
//ifstream fin("x.in"); ofstream fout("x.out");

typedef long long i64;
const int mod = 1e9 + 7;

int main() {
    fin.sync_with_stdio(false); fin.tie(); fout.tie();

    int n;
    fin >> n;

    int ans = 1;
    int cnt = 0;
    for (int i = 1; i <= n; ++ i) {
        int x;
        fin >> x;

        if (x < 2 * (i - cnt) - 1) {
            ans = 1LL * ans * (i - cnt) % mod;
            ++ cnt;
        }
    }

    int r = n - cnt;
    for (int i = 1; i <= r; ++ i)
        ans = 1LL * ans * i % mod;
    fout << ans << "\n";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
//const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
  
ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * (B / gcd(A, B));
}
  
/*------------------------------------------------------------------*/

int main(){
    string s; cin >> s;
    ll k; cin >> k;
    int n = s.length();
    ll count_sum = 0;

    set<char> kind;
    rep(i, n) kind.insert(s[i]);
    if(kind.size() == 1){
        cout << n * k / 2;
        return 0; 
    } 

    if(s[0] != s[n - 1]){
        _rep(i, 1, n){
            ll count = 0;
            if(s[i] == s[i - 1]){
                while(i <= n - 1 and s[i] == s[i - 1]){
                    count++;
                    i++;
                }
            }
            count_sum += (count + 1) / 2;
        }
        cout << count_sum * k << endl;
        return 0;
    }

    ll ans = 0;
    int front_len = 0, back_len = 0;
    _rep(i, 1, n){
        if(s[0] == s[i]){
            front_len++;
        }else{
            break;
        }
    }
    _rep(i, 1, n){
        if(s[n - 1] == s[(n - 1) - i]){
            back_len++;
        }else{
            break;
        }
    }
    _rep(i, 1, n){
        ll count = 0;
            if(s[i] == s[i - 1]){
                while(i <= n - 1 and s[i] == s[i - 1]){
                    count++;
                    i++;
                }
            }
        count_sum += (count + 1) / 2;
    }
    ans = count_sum * k - (front_len + 1) / 2 * (k - 1) - (back_len + 1) / 2 * (k - 1) + (front_len + back_len + 2) / 2 * (k - 1);
    cout << ans << endl;
}


Measured memory_bytes: 256
#ceilevenoddformula
import math
from queue import PriorityQueue
import bisect
import copy
import time
from collections import Counter
#map(int,input().split())
#int(x) for x in input().split()
MAX = 1000001
  
# structure to store queries 
class Query: 
    def __init__(self, l, r, idx): 
        self.l = l 
        self.r = r 
        self.idx = idx 
  
# updating the bit array 
def update(idx, val, bit, n): 
    while idx <= n: 
        bit[idx] += val 
        idx += idx & -idx 
  
# querying the bit array 
def query(idx, bit, n): 
    summ = 0
    while idx: 
        summ += bit[idx] 
        idx -= idx & -idx 
    return summ 
  
def answeringQueries(arr, n, queries, q): 
  
    # initialising bit array 
    bit = [0] * (n + 1) 
  
    # holds the rightmost index of  
    # any number as numbers of a[i] 
    # are less than or equal to 10^6 
    last_visit = [-1] * MAX
  
    # answer for each query 
    ans = [0] * q 
  
    query_counter = 0
    for i in range(n): 
  
        # If last visit is not -1 update -1 at the 
        # idx equal to last_visit[arr[i]] 
        if last_visit[arr[i]] != -1: 
            update(last_visit[arr[i]] + 1, -1, bit, n) 
  
        # Setting last_visit[arr[i]] as i and  
        # updating the bit array accordingly 
        last_visit[arr[i]] = i 
        update(i + 1, 1, bit, n) 
  
        # If i is equal to r of any query store answer 
        # for that query in ans[] 
        while query_counter < q and queries[query_counter].r == i: 
            ans[queries[query_counter].idx] = query(queries[query_counter].r + 1, bit, n) -  query(queries[query_counter].l, bit, n) 
            query_counter += 1
  
    # print answer for each query 
    for i in range(q): 
        print(ans[i]) 

n,q=map(int,input().split())
l=[int(x) for x in input().split()]
que=[]
for i in range(q):
	a,b=map(int,input().split())
	que.append(Query(a-1,b-1,i))
que.sort(key = lambda x: x.r)
answeringQueries(l,n,que,q)




















 
          





























Measured memory_bytes: 184956
#include<stdio.h>
#include<string.h>

int main(void)
{
    char c[2];
    int i, tmp, dice[6];
    
    for ( i=0; i<6; ++i)
        scanf("%d", &dice[i]);
    
    while ( scanf("%1s", c) != EOF) {
        if ( strcmp(c, "E") == 0 ) {    /* 0 -> 2 -> 5 -> 3 */
            tmp     = dice[3];
            dice[3] = dice[5];
            dice[5] = dice[2];
            dice[2] = dice[0];
            dice[0] = tmp;
        }else if ( strcmp(c, "N") == 0 ) {    /* 0 -> 4 -> 5 -> 1 */
            tmp     = dice[1];
            dice[1] = dice[5];
            dice[5] = dice[4];
            dice[4] = dice[0];
            dice[0] = tmp;
        }else if ( strcmp(c, "W") == 0 ) {    /* 0 -> 3 -> 5 -> 2 */
            tmp     = dice[2];
            dice[2] = dice[5];
            dice[5] = dice[3];
            dice[3] = dice[0];
            dice[0] = tmp;
        }else if ( strcmp(c, "S") == 0 ) {    /* 0 -> 1 -> 5 -> 4 */
            tmp     = dice[4];
            dice[4] = dice[5];
            dice[5] = dice[1];
            dice[1] = dice[0];
            dice[0] = tmp;
        }
    }
    printf("%d\n", dice[0]);
}


Measured memory_bytes: 2096
#include <bits/stdc++.h>
using namespace std;
//T+N
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
#define endl "\n"
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template<class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; }
template<class T, class T2> inline bool chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; }
const ll mod = 1e9 + 7;
template<class T> inline void fix(T &x) {if(x >= mod | x <= -mod) {x %= mod;} if(x < 0) {x += mod;}}
#define out(x) cout << __LINE__ << ": " << (#x) << " = " << (x) << endl

const ll MAX_N = 1e6 + 10;
ll a[MAX_N], pref[MAX_N];

signed main() {
    //ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    ll n;
    cin >> n;
    for(ll i = 0; i <= n; i ++) {
        cin >> a[i];
    }
    pref[n + 1] = 0;
    for(ll i = n; i >= 0; i --) {
        pref[i] = pref[i + 1] + a[i];
    }
    ll ans = 1, active = 1;
    for(ll i = 0; i <= n; i ++) {
        if(active < a[i]) {
            cout << -1 << endl;
            return 0;
        }
        active -= a[i];
        active *= 2;
        chkmin(active, pref[i + 1]);
        ans += active;
    }
    cout << ans << endl;
    return 0;
}




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

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug(x) cerr << #x << ": " << x << endl;

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;

int main(){
    std::ios::sync_with_stdio(0); cin.tie(0);
    int n, min_b = INT_MAX;
    cin >> n;
    vector<ll> a(n), b(n);
    rep(n){
        cin >> a[i] >> b[i];
        if(a[i] > b[i]){
            if(b[i] < min_b){
                min_b = b[i];
            }
        }
    }

    if(min_b == INT_MAX){
        cout << 0 << endl;
        return 0;
    }
    ll ans = accumulate(all(a), 0LL) - min_b;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#!/usr/bin/env python3
import sys


def solve(N: int, V: "List[int]", C: "List[int]"):

    total = 0
    for i in range(N):
        tmp = V[i] - C[i]
        if tmp > 0:
            total += tmp

    print(total)


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    V = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    C = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, V, C)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>

int n, q, m;
int A[2001];
bool solve(int i, int m);

int main()
{
	using namespace std;
	
	cin >> n;
	for (int i = 0;i < n;i++)
	{
		cin >> A[i];
	}
	cin >> q;
	while (q--)
	{
		cin >> m;
		if (solve(0, m))
		{
			cout << "yes" << endl;
		}
		else
		{
			cout << "no" << endl;
		}
	}
	return 0;
}

bool solve(int i, int m)
{
	if (m == 0)
	{
		return true;
	}
	if (i >= n)
	{
		return false;
	}
	bool res = solve(i + 1, m) || solve(i + 1, m - A[i]);
	return res;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int i,l,r,N;
  int total = 0;
  scanf("%d", &N); 
  for(i=0;i<N;i++){
    scanf("%d%d", &l, &r);
    total += (r-l) + 1;
  }
  printf("%d", total);
  return 0;
}

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

int main(){
	int n;int x;int y;
	cin >> n>>x>>y;

	int dif;
	std::vector<int> K(n,0);

	for(int i = 1;i <= n-1; i++){
		for(int j = i+1;j <= n; j++){
			K[min(j-i,abs(i-x)+1+abs(y-j))]++;
		}
	}
	for(int i = 1;i<= n-1;i++){
		cout << K[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
    long long N,a[10000],b[10000],i;
    long long sum_a=0,sum_b=0,BA=0,AB=0,X;

    scanf("%lld",&N);

    for(i=0;i<N;i++){
        scanf("%lld",&a[i]);
        sum_a += a[i];
    }
    for(i=0;i<N;i++){
        scanf("%lld",&b[i]);
        sum_b += b[i];
        if(b[i]-a[i]>0){
            BA += (b[i]-a[i])/2;
        }else{
            BA -= a[i]-b[i];
        }
    }

    X = sum_b-sum_a;

    if(sum_b < sum_a){
        printf("No\n");
    }else if(BA>=0){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}


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

using namespace std;

using ll = long long;
constexpr ll MOD = ((1e9) + 7);

int main()
{
    ll N, p = 1;
    cin >> N;
    for (int i = 0; i < N; i++) {
        p *= (i + 1);
        p %= MOD;
    }
    cout << p << endl;
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

	int a,b; cin >> a >> b;

	int d = b-a;
	int sum = 0;

	for (int i = 1;i < d;i++){
		sum += i;
	}

	cout << sum - a << endl;

	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int main(){
    string n;
    cin >> n;
    int sum = 0;
    for(int i=0; i<n.size(); i++){
        int a = n.at(i) - '0';
        sum += a;
    }
    if(sum%9 == 0)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3712
#include<iostream>
using namespace std;
int main(){
  int n,q,s[10000],t,ans=0;
  cin>>n;
  for(int i=0;i<n;i++)cin>>s[i];
  cin>>q;
  for(int i=0;i<q;i++){
    cin>>t;
    for(int j=0;j<n;j++)if(s[j]==t){ans++;break;}
  }
  cout<<ans<<endl;
  return 0;
}

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

int main(){
  ll n;
  cin >> n;
  vector<pair<ll, int>> fs;
  for(ll i=2; i*i<=n; i++){
    int kosuu=0;
    while(n%i==0){
      n/=i;
      kosuu++;
    }
    fs.emplace_back(i, kosuu);
  }
  if(n!=1) fs.emplace_back(n, 1);
  int ans=0;
  for(auto p: fs){
    int i=1;
    while(p.second-i >= 0){
      p.second -= i;
      i++;
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 19692
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<tuple>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-15
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	ll MOD=1e+9+7;
	int N,M;
	ll x[100001],y[100001];
	ll sumx=0,sumy=0;
	scan(N);scan(M);
	rep(i,N){
		scan(x[i]);
		sumx+=(-N+1+i*2)*x[i]%MOD;
		sumx%=MOD;
	}
	rep(i,M){
		scan(y[i]);
		sumy+=(-M+1+i*2)*y[i]%MOD;
		sumy%=MOD;
	}
	ll ans=sumx*sumy%MOD;
	prin(ans);
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct A{
ll a,b;
};
bool cmp(A x,A y)
{
    return x.a<y.a;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,k;
    while(cin>>n>>k)
    {
        vector<A> arr;
        for(int i=0;i<n;i++)
        {
            A x;
            cin>>x.a>>x.b;
            arr.push_back(x);
        }
        sort(arr.begin(),arr.end(),cmp);
        ll ans=0;
        for(int i=0;i<n;i++)
        {
            if(k<=0) break;
            if(k>=arr[i].b)
            {
                k-= arr[i].b;
                ans += (arr[i].b*arr[i].a);
            }
            else
            {
                ans += (k*arr[i].a);
                k=0;
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 2420
#include <iostream>
#include <algorithm>

using namespace std;

int t, m;
double tmp, sum, v, r, valM = 0.0;

main(){
  cin >> t;
  for(int i=0;i<=t;i++){
    cin >> m >> m;
    tmp = sum = 0.0;
    while(m--){
      cin >> v >> r;
      sum += r;
      tmp += v * r;
    }
    if(i<t) valM = max(valM, tmp / sum);
  }
  cout << (valM > tmp / sum + 1e-7 ? "YES" : "NO") << endl;
}

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  ll n;
  cin >> n;
  
  vector<ll> a(n), b(n), c(n);
  REP(i, n)
    cin >> a[i];
  REP(i, n)
    cin >> b[i];
  REP(i, n)
    cin >> c[i];
  
  sort(a.begin(), a.end());
  
  sort(b.begin(), b.end());
  
  sort(c.begin(), c.end());
  /*
  REP(i, n)
    cout << a[i] << " ";
  cout << endl;
  REP(i, n)
    cout << b[i] << " ";
  cout << endl;
  REP(i, n)
    cout << c[i] << " ";
  cout << endl;
  */
  ll j = 0;
  ll k = 0;
  ll sum = 0;
  REP(i, n){
    for(; j < n; j++){
      if(b[i] <= a[j])
        break;
    }
    
    for(; k < n; k++){
      if(b[i] < c[k])
        break;
    }
    //cout << j << " " << k << endl;
    sum += j*(n-k);
  }
  
  cout << sum << endl;
  
}

Measured memory_bytes: 2560
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <string>
#include <numeric>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define rep(i, a, N) for(int i = a; i < N; i++)

int main() {
    int N, H, W;
    cin >> N >> H >> W;
    cout << (N - H + 1) * (N - W + 1) << endl;
}

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

using namespace std;
typedef long long ll;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))
#define all(x) x.begin(),x.end()


int main()
{
	int D, G; cin >> D >> G;
	vector<int> p(D), c(D);
	rep(i, 0, D - 1)cin >> p[i] >> c[i];
	int ans = 1000;
	for (int i = 0; i < pow(2, D); ++i)
	{
		ll score = 0;
		int cnt = 0;
		vector<bool> isComp(D, false);
		for (int j = 0; j < D; ++j)
		{
			if (i >> j & 1)
			{
				cnt += p[j];
				score += 100 * (j + 1)*p[j] + c[j];
				isComp[j] = true;
			}
		}
		if (G < score)
		{
			ans = min(ans, cnt);
			continue;
		}
		for (int j = D - 1; j >= 0; --j)
		{
			if (!isComp[j])
			{
				int num = p[j];
				while (0 < num && score < G)
				{
					++cnt;
					score += (j + 1) * 100;
					--num;
				}
			}
		}
		ans = min(ans, cnt);
	}
	cout << ans << endl;
}

Measured memory_bytes: 384