akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
    using namespace std;
 
    #define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
    #define mod 1000000007
    #define qmod 998244353
    #define M 1000001
    #define endl "\n"
    #define all(a) (a).begin(),(a).end()
    #define rep(i,a,b) for(int i=a;i<b;++i)
    #define repr(i,a,b) for(int i=a;i>=b;--i)
    #define F first
    #define S second
    #define pb push_back
    #define mp make_pair
 
    typedef long long ll;
    typedef pair<int,int> pii;
    typedef vector<int> vi;
    typedef vector<string> vs;
    typedef vector<pii> vii;
    typedef vector<vi> vvi; 

    int main(){
                
   /* #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin); 
    freopen("output.txt","w",stdout);   
    #endif */
 
        fast;
        int t=1;
        // cin>>t;  
        while(t--){     
            double val=6.28318530717958623200;
            int n;
            cin>>n;
            printf("%.10f",n*val);
        } 
        return 0;  
    }       


    //keep it simple stupid 

Measured memory_bytes: 3740
#include <cstdio>

int main(){
    char a[1200];
    scanf("%[^\n]",a);
    for(int i = 0;a[i] != '\0';i++){
        if(65 <= a[i] && a[i] <= 90){
            a[i] += 32;
            continue;
        }
        if(97 <= a[i] && a[i] <= 122){
            a[i] -= 32;
        }
    }
    printf("%s\n",a);
    return 0;
}



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


int main(){
 int x,n,min=100,ans=0;
  cin >> x >> n;
 if(n==0) cout << x << endl;
  
 else{
 vector<int> p(n);
  rep(i,n) cin >> p.at(i);
 
 vector<int> con(102,0);
  rep(i,n) con.at(p.at(i))=1;
   
  
 rep(i,102){
  if(con.at(i)==0){ 
   if(abs(x-i)<min){
     min=abs(x-i);
     ans=i;
   }
  }
 }
  cout << ans << endl;
  return 0;
 }  
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int a=0,b=0,c=0,d=0;
  for(int i=0;i<s.length();++i){
    if(i%2==0){
      if(s[i]=='0'){
        a++;
      }
      else{
        b++;
      }
    }
    else{
      if(s[i]=='0'){
        c++;
      }
      else{
        d++;
      }
    }
  }
  cout<<min(a+d,b+c);
  return 0;
}


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

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
const int INF = 1 << 27;
const ll LLINF = (ll)1 << 60;
const ll MOD = 1e9+7;

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

int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  vector<int> dp(k + 1, 0);
  for (int i = 0; i < a[0]; i++) {
    dp[i] = 2;
  }
  for (int i = a[0]; i <= k; i++) {
    bool canTransferToSecond = false;
    for (int j = 0; j < n && a[j] <= i; j++) {
      if (dp[i-a[j]] == 2) {
        canTransferToSecond = true;
        break;
      }
    }
    dp[i] = canTransferToSecond ? 1 : 2;
  }

  if (dp[k] == 1) {
    puts("First");
  } else {
    puts("Second");
  }
}


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

#define rep(i, n) for(int i=0; i < n; i++)
#define REP(i, n, m) for(int i=n; i < m; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

const ll INF = 1LL << 60;

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


int main() {
  int n,m;cin>>n>>m;
  vector<vector<int>> v(n+1);
  vector<int> ans(n+1);
  vector<int> vi(n+1);
  rep(i,m){
    int a,b;cin>>a>>b;
    v[b].pb(a);
    v[a].pb(b);
  }
  
  queue<int> q;
  q.push(1);
  while(!q.empty()){
    int p=q.front();
    q.pop();
    for(auto x:v[p]){
      if(vi[x]==0){vi[x]=1;ans[x]=p;q.push(x);}
    }
  }
  cout<<"Yes"<<endl;
  for(int i=2;i<ans.size();i++)cout<<ans[i]<<endl;
}



Measured memory_bytes: 10564
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main()
{
    lli r,g,b,k;
    cin>>r>>g>>b>>k;
    for(lli i=1;i<=k;i++)
    {
        if(g<=r)
        {
            g=2*g;
        }else if(b<=g)
        {
            b=2*b;
        }
        
    }

    if(g>r && b>g)
    {
        cout<<"Yes"<<"\n";
    }else
    {
        cout<<"No"<<"\n";
    }

    return 0;
    
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N = (int)1e5+5;

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

    string n;
    cin>>n;
    for(auto it:n) {
        if(it=='7') {
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
}


Measured memory_bytes: 3656
mod=998244353
n,s=map(int,input().split())
arr=list(map(int,input().split()))
dp=[[0]*(s+1) for _ in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
  val=arr[i-1]
  for j in range(s,-1,-1):
    dp[i][j]=2*dp[i-1][j]
    dp[i][j]%=mod
    if j-val>=0 and dp[i-1][j-val]!=0:
      dp[i][j]+=dp[i-1][j-val]
      dp[i][j]%=mod
print(dp[n][s])

Measured memory_bytes: 139268
#include <iostream>

int main(void){
    int N, ans=-1, tmp=1;
    bool flg = false;
    std::cin >> N;

    for (int i=0; i<N; ++i){
        int a;
        std::cin >> a;
        if (a == tmp){
            ++tmp;
            flg = true;
        }
    }

    if (flg){
        ans = N - tmp + 1;
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 3572
#include <iostream>

int main()
{
  int P, Q, R;
  std::cin >> P >> Q >> R;
  
  if(P < Q){
    if(R < Q) {
      std::cout << P + R;
    } else {
      std::cout << P + Q;
    }
  } else {
    if(R < P){
      std::cout << Q + R;
    } else {
      std::cout << P + Q;
    }
  }
  
  return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())

ab = [tuple(map(int, input().split())) for _ in range(n)]
cd = [tuple(map(int, input().split())) for _ in range(m)]

def meter(a, b, c, d):
    return abs(a-c) + abs(b-d)

ans = []

for a, b in ab:
    best_ind = None
    best_dist = float('inf')
    for j, (c, d) in enumerate(cd):
        tmp_dist = meter(a, b, c, d)
#         print(f'{a=}, {b=}, {c=}, {d=}, {tmp_dist=}, {j=}')
        if tmp_dist < best_dist:
#             print('update')
            best_dist = tmp_dist
            best_ind = j+1
    print(best_ind)

Measured memory_bytes: 39664
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
long long fn(long long p,long long q){
  long long s;
  while(q){
    p%=q;
    s=p;
    p=q;
    q=s;
  }
  return p;
}
int main(){
  int i,j,k;
  int n;
  while(cin>>n&&n){
    long long a[31400],b[31400];
    j=0;
    k=0;
    for(i=0;i<n*(n+1)/2;i++){
      long long p;
      cin>>p;
      if(p%2){
	a[j]=p;
	j++;
      }else{
	b[k]=p;
	k++;
      }
    }
    sort(a,a+j);
    sort(b,b+k);
    long long c=fn(a[0],b[0]);
    c=(long long)sqrt(b[0]/c*(b[1]/(a[0]/c)));
    cout<<c<<endl;
    for(i=0;i<k-1;i++)
      cout<<b[i]/c<<" ";
    cout<<b[i]/c<<endl;
  }
  return 0;
}

Measured memory_bytes: 1124
#include "bits/stdc++.h"
typedef long long ll;
using namespace std;
int main()
{
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int sum = 0;
    if (k <= a)
    {
        cout << k << endl;
        return 0;
    }
    else
    {
        sum += a;
        k = k - a;
    }
    k = k - b;
    if (k <= 0)
    {
        cout << sum << endl;
        return 0;
    }
    sum = sum - k;
    cout << sum << endl;
}

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

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int inf = 1000000000;
const int mod = 1000000007;
const double EPS = 1e-9;
const int dx[] = { -1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};

int N, M;

int main() {
	// cin.tie(0); // tie
	// ios::sync_with_stdio(false); // sync
	while (cin >> N, N) {
		int table[21][21];
		rep(i, 21) rep(j, 21) table[i][j] = 0;
		int py = 10, px = 10;
		rep(i, N) {
			int x, y;
			cin >> x >> y;
			table[20 - y][x] = 1;
		}

		cin >> M;
		int cnt = 0;
		rep(i, M) {
			char d; int l;
			cin >> d >> l;
			rep(i, l) {
				if (d == 'N') py--;
				else if (d == 'S') py++;
				else if (d == 'E') px++;
				else if (d == 'W') px--;
				if (table[py][px] == 1) {
					table[py][px] = 0;
					cnt++;
				}
			}
		}
		if (cnt == N) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1152
package main

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

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	h, w := nextInt(), nextInt()

	var ans int
	if h == 1 || w == 1 {
		ans = 1
	} else if (h*w)%2 == 0 {
		ans = (h * w) / 2
	} else {
		ans = (w/2+1)*(h/2+1) + (w/2)*(h/2)
	}
	puts(ans)
}

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define SZ(v) ((int)(v).size())
#define zero(v) memset(v,0,sizeof(v))
#define rep(i,n) for(int i=0;i<(n);i++)
#define foreach(it,c) for(__typeof(c.begin()) it=c.begin();it!=c.end();it++)
#define all(v) (v).begin(),(v).end()
template<typename T>inline bool chkmin(T &a,const T &b){return a>b?a=b,1:0;}
template<typename T>inline bool chkmax(T &a,const T &b){return a<b?a=b,1:0;}
typedef long long ll;
typedef unsigned uint;
const int INF=0x3f3f3f3f;
const double EPS=1e-10;
typedef pair<int,int> pii;
int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)
{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}
while((uint)((c=getchar())-'0')<10);return x;}
int n,m;
const int Maxn=1005;
string grid[Maxn];
int dist[Maxn][Maxn];
pii C,D;

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


void bfs(){
	memset(dist,INF,sizeof(dist));
	deque<pair<pii,int> >q;
	q.push_back(make_pair(make_pair(C.first,C.second),0));
	dist[C.first][C.second]=0;
	
	while(!q.empty()){
		int ux=q.front().first.first;
		int uy=q.front().first.second;
		int dis=q.front().second;
//		cerr<<ux+1<<' '<<uy+1<<' '<<dis<<endl;
		q.pop_front();
		
		if(dis>dist[ux][uy])continue;
		
		
		for(int d=0;d<4;d++){
			int nx=ux+dx[d];
			int ny=uy+dy[d];
			if(nx>=0&&nx<n&&ny>=0&&ny<m&&grid[nx][ny]=='.'&&dist[nx][ny]>dist[ux][uy]){
				dist[nx][ny]=dist[ux][uy];
				q.push_front(make_pair(make_pair(nx,ny),dis));
			}
		}
		
		for(int nx=max(ux-2,0);nx<min(ux+3,n);nx++){
			for(int ny=max(uy-2,0);ny<min(uy+3,m);ny++){
				if(grid[nx][ny]=='.'&&dist[nx][ny]>dist[ux][uy]+1){
					dist[nx][ny]=dist[ux][uy]+1;
					q.push_back(make_pair(make_pair(nx,ny),dis+1));
				}
			}
		}
	}
	
}



int main(){
	cin>>n>>m;
	cin>>C.first>>C.second;
	C.first--;C.second--;
	cin>>D.first>>D.second;
	D.first--;D.second--;
	
	for(int i=0;i<n;i++)cin>>grid[i];
	
	bfs();
	if(dist[D.first][D.second]==INF)cout<<-1<<endl;
	else cout<<dist[D.first][D.second]<<endl;
	return 0;
}

Measured memory_bytes: 9584
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define rrepSE(i,s,e) for (int i = (s); i > (e); i--)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }
#define DEBUG_PRINT(var) std::cout << #var << " = " << var << "\n";

ll c2(ll n) { return n*(n-1)/2; };

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    vector<ll> acum(n+1);
    map<ll, int> mp;
    acum[0] = 0; mp[0]++;
    rep(i,n) {
        acum[i+1] = acum[i] + a[i];
        mp[acum[i+1]]++;
    }
    ll ans = 0;
    for (auto ele : mp) {
        ans += c2(ele.second);
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;
typedef bool boolean;

const int N = 2e5 + 5;

#define pii pair<int, int>
#define ll long long

typedef class Segment {
	public:
		int l, r, x, y;

		Segment() {	}
		Segment(int l, int r, int x, int y) : l(l), r(r), x(x), y(y) {	}

		boolean operator < (Segment b) const {
			return l < b.l;
		}
} Segment;

int n, L;
int a[N];
pii b[N];

ll calc(vector<pii>& a) {
	ll ret = 0, sum = 0;
	for (int l = 0, r = L - 1; r < (signed) a.size(); l++, r++) {
		ret += (sum += a[l].first) * a[r].second;
	}
	return ret;
}

ll ans = 0;
int main() {
	scanf("%d%d", &n, &L);
	for (int i = 1; i <= n; i++) {
		scanf("%d", a + i);
		b[i] = pii(a[i], i);
	}
	ans = n;
	sort(b + 1, b + n + 1);
	int pos = 1, val;
	vector<Segment> vcur, vnxt, vadd;
	while (true) {
		if (!vcur.size()) {
			if (pos > n) {
				break;
			} else {
				val = b[pos].first;
			}
		} else {
			val++;
		}
//		cerr << pos << " " << val << '\n';
		vadd.clear();
		while (pos <= n && b[pos].first == val)
			vadd.emplace_back(b[pos].second, b[pos].second, 1, 1), pos++;
		vnxt.resize(vcur.size() + vadd.size());
		merge(vcur.begin(), vcur.end(), vadd.begin(), vadd.end(), vnxt.begin());
		swap(vcur, vnxt);
		vnxt.clear();
		int num = vcur.size();
		for (int i = 0, j = 0; i < num; i = ++j) {
			while (j < num - 1 && vcur[j].r + 1 == vcur[j + 1].l)
				j++;
			int len = j - i + 1, cnt = len / L;
			if (cnt) {
				vector<pii> tmp;
				for (int k = i; k <= j; k++)
					tmp.emplace_back(vcur[k].x, vcur[k].y);
				ans += calc(tmp);
				tmp.clear();
				tmp.resize(cnt, pii(0, 0));
				for (int k = L - 1; k < len; k++) {
					tmp[cnt - (k - L + 1) / L - 1].first += vcur[j - k].x;
				}
				for (int k = L - 1; k < len; k++) {
					tmp[(k - L + 1) / L].second += vcur[i + k].y;
				}
				ans -= calc(tmp);
				for (int k = 0; k < cnt; k++)
					vnxt.emplace_back(vcur[i].l + k, vcur[i].l + k, tmp[k].first, tmp[k].second);
				vnxt.back().r = vcur[j].r;
			}
		}
		swap(vcur, vnxt);
		vnxt.clear();
	}
	printf("%lld\n", ans);
	return 0;
}


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

#define ll long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
ll mod = 2019;
ll dp[2019];
ll waru[200010];
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    string s; cin >> s;
    ll n = s.size();
    ll locate=0;
    waru[0]=1;
    rep(i,1,200010){
        waru[i] = (waru[i-1]*10)%mod;
    }
    rel(i,n,0){
        ll tmp = s[i]-'0';
        (tmp *= waru[n-i])%=mod;
        (locate += tmp)%=mod;
        dp[locate]++;
        //cout << locate << endl;
    }
    ll ans=0;
    ans += dp[0];
    rep(i,0,2019){
        ans += dp[i]*(dp[i]-1)/2;
    }
    cout << ans << endl;

}

Measured memory_bytes: 5360
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
using namespace std;
long long MOD = 1e9 + 7;

set<int> A;

int main() {
	int s;
	cin >> s;
	int c = 1;
	A.insert(s);
	while (true) {
		int next;
		if (s % 2 == 0)next = s / 2;
		else next = 3 * s + 1;
		c++;
		if (A.find(next) != A.end()) {
			cout << c << endl;
			return 0;
		}
		A.insert(next);
		s = next;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  string s;
  int cnt[6];
  memset(cnt,0,sizeof cnt);
  for (int i=0;i<n;i++){
    cin>>s;
    if (s=="AC") cnt[1]++;
    if (s=="WA") cnt[2]++;
    if (s=="TLE") cnt[3]++;
    if (s=="RE") cnt[4]++;
  }
  cout<<"AC x "<<cnt[1]<<endl;
  cout<<"WA x "<<cnt[2]<<endl;
  cout<<"TLE x "<<cnt[3]<<endl;
  cout<<"RE x "<<cnt[4]<<endl;
  return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define fr(i,x,y) for(int i=x;i<=y;++i)
#define rf(i,x,y) for(int i=x;i>=y;--i)
#define LL long long 
using namespace std;
const int N=41,MK=(1<<17),mod=1e9+7;
LL dp[N][MK];

LL add(LL x,LL y){
	return (x+y)%mod;
}

LL mul(LL x,LL y){
	return x*y%mod;
}

void Add(LL &x,LL y){
	x=(x+y)%mod;
}

void Mul(LL &x,LL y){
	x=(x*y)%mod;
}

int main(){
	int n,x,y,z;scanf("%d%d%d%d",&n,&x,&y,&z);
	int wr=(1<<(x-1))|(1<<(x+y-1))|(1<<(x+y+z-1));
	dp[0][0]=1;
	int mk=(1<<(x+y+z))-1;
	LL ans=1;
	fr(i,1,n) Mul(ans,10);
	fr(i,1,n) fr(j,0,mk){
		if(!dp[i-1][j]) continue;
		fr(k,1,10){
			int now=(j<<k)|(1<<(k-1));
			now&=mk;
			//printf("%d\n",now);
			if((now&wr)==wr) continue;
			else Add(dp[i][now],dp[i-1][j]);
		}
	}
	//fr(i,0,mk) printf("%lld\n",dp[n][i]);
	fr(i,0,mk) Add(ans,add(mod,-dp[n][i]));
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 40320
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;

#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>
#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 psb push_back
#define ppb pop_back

const int I_INF = 1001001001;
const ll LL_INF = 1001001001001001001;
const ld EPS = 0.001;

int main() {
    char a;
    cin >> a;

    if (isupper(a)) {
        cout << "A" << endl;
    } else {
        cout << "a" << endl;
    }
}


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

int main() {
  ll N, M, K;
  cin >> N >> M >> K;
  deque<ll> A(N), B(M);
  for (int i = 0; i < N; ++i) cin >> A[i];
  for (int i = 0; i < M; ++i) cin >> B[i];
  vector<ll> prefixA, prefixB;
  ll curr = 0;
  prefixA.push_back(curr);
  for (int i = 0; i < N; ++i) {
    curr += A[i];
    prefixA.push_back(curr);
  }
  curr = 0;
  prefixB.push_back(curr);
  for (int i = 0; i < M; ++i) {
    curr += B[i];
    prefixB.push_back(curr);
  }
  ll ans = 0;
  for (int i = 0; i <= N; ++i) {
    ll remain = K - prefixA[i];
    if (remain < 0) continue;
    int idx = prev(upper_bound(prefixB.begin(),prefixB.end(), remain)) - prefixB.begin();
    ans = max(ans, (ll) i + idx);
  }
  printf("%lld\n", ans);
  return 0;
}


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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) (a).begin(),(a).end()
#define SORT(a) sort(all(a))
#define rSORT(a, i) sort(all(a),(i))

using ll = long long;
constexpr ll INF = 10000000000;
constexpr ll MOD = 1000000007;
const int MAX_N = 110000; 
constexpr double EPS = 1E-11;

using namespace std;

int dp[MAX_N];

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

	//dp[i]がi円についての使用する金額
	for (int i = 0; i < MAX_N; i++) dp[i] = -1;

	//幅優先
	dp[0] = 0;
	queue<int>bfs;
	bfs.push(0);

	//処理
	while (!bfs.empty()) {
		int c = bfs.front();
		bfs.pop();

		//与えられた金額に達するまで試す
		for (int pow6 = 1; c + pow6 <= n; pow6 *= 6) {
			if (dp[c + pow6] == -1) {
				dp[c + pow6] = dp[c] + 1;
				bfs.push(c + pow6);
			}
		}
		for (int pow9 = 1; c + pow9 <= n; pow9 *= 9) {
			if (dp[c + pow9] == -1) {
				dp[c + pow9] = dp[c] + 1;
				bfs.push(c + pow9);
			}
		}
	}
	cout << dp[n] << endl;
}

Measured memory_bytes: 768
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
using namespace std;
int main(){
  string a,b;
  int al,bl;
  string c;
  cin >> a >> b >> al >> bl >> c;
  if(a == c){
    cout << al - 1 << " " << bl << endl;
  }
  else{
    cout << al << " " << bl - 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
// Author: HarshKumar

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll N = 1e6 + 6, M = 1e9 + 7;
int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    ll n, x = 1000, mn = M, mx = 0, b = 0, f = 1;
    cin >> n;
    vector<ll> a(n);
    for (ll &e : a)
        cin >> e;
    a.push_back(0);
    for (ll i = 1; i <= n; i++)
    {
        if (f && a[i] > a[i - 1])
        {
            b = x / a[i - 1];
            x -= b * a[i - 1];
            f = 0;
        }
        else if (a[i] < a[i - 1])
            x += b * a[i - 1], b = 0, f = 1;
    }
    cout << x;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define FI(i, a, b) for (int i = (a); i <= (b); ++i)
#define FD(i, b, a) for (int i = (b); i >= (a); --i)
#define DEBUG(x) cerr << #x << ": " << (x) << endl;
 
int main() {
  ll n, a, b;
  cin >> n >> a >> b;
  if (~(b - a) & 1) cout << (b - a) / 2 << endl;
  else {
    cout << min(a + (b - a - 1) / 2, n - b + 1 + (b - a - 1) / 2) << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>
int bus[15] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 4, 3, 2, 1};
int main() {
	int N, I, s, e, i, j;
	scanf("%d", &N);
	for(I = 0; I < N; ++ I) {
		scanf("%d %d", &s, &e);
		for(i = 14; i > -1 && bus[i] != e; -- i);
		for(j = i; bus[j] != s; --j) {
			if(j == -1) j = 14;
			if(bus[j] == e) i = j;
		}
		printf("%d", bus[j++]);
		for(;; ++ j) {
			if(j == 15) j = 0;
			printf(" %d", bus[j]);
			if(j == i) break;
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 604
import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[]){
    int n=readI()%10;
    if(n==2||n==4||n==5||n==7||n==9){
      pl("hon");
    }else if(n==0||n==1||n==6||n==8){
      pl("pon");
    }else{
      pl("bon");
    }
  }

  static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
  public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  }
  public static int readI(){
    return stoi(readS());
  }
  public static String[] readSs(){
    return readL().split(" ");
  }
  public static int[] readIs(){
    return stoi(readSs());
  }
  public static int stoi(String s){
    return Integer.parseInt(s);
  }
  public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  }
  public static String itos(int i){
    return String.valueOf(i);
  }
  public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  }
  public static String ctos(char c){
    return String.valueOf(c);
  }
  public static String cstos(char[] c){
    return new String(c);
  }
  public static char stoc(String s){
    return s.charAt(0);
  }
  public static char[] stocs(String s){
    return s.toCharArray();
  }
}


Measured memory_bytes: 32616
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const string NG = "UNRESTORABLE";

string solve()
{
    string s,t;
    cin >>s >>t;
    int S = s.size(), T = t.size();

    string ans = "|";
    rep(i,S-T+1)
    {
        bool match = true;
        rep(j,T)if(s[i+j]!='?' && s[i+j]!=t[j]) match = false;
        if(!match) continue;

        string a = s;
        rep(j,T) a[i+j]=t[j];
        rep(j,S)if(a[j]=='?') a[j]='a';

        ans = min(ans,a);
    }

    if(ans == "|") ans = NG;
    return ans;
}

int main()
{
    cout << solve() << endl;
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
#ABC135 B

import sys
import math
import bisect
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
mod = 10**9 + 7

n = int(input())
p = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if p[i] != i+1:
        cnt += 1
if cnt <= 2:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 38384
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def f(N):
    res = 0
    while N != 0:
        b = format(N, "b").count("1")
        N %= b
        res += 1
    return res


def main():
    N = int(input())
    F = [[] for _ in range(N)]

    for _ in range(N - 1):
        u, v, w = read_values()
        u -= 1
        v -= 1
        F[u].append((v, w % 2))
        F[v].append((u, w % 2))

    D = [0] * N
    stack = [(0, 0, -1)]

    while stack:
        a, d, p = stack.pop()
        D[a] = d % 2

        for b, w in F[a]:
            if b == p:
                continue
            stack.append((b, (d + w) % 2, a))
    
    for d in D:
        print(d)


if __name__ == "__main__":
    main()


Measured memory_bytes: 93396
import java.util.Scanner;

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

		for (int i = a; i <= b; i++) {
			if (i - a < k || b - i < k) {
				System.out.println(i);
			}
		}
	}
}


Measured memory_bytes: 23124
// vvvvvvvvvvvv TEMPLATE vvvvvvvvvvvv
#include <bits/stdc++.h>
using namespace std; using ll = long long; using P = pair<ll, ll>;
const ll linf = 1e18; const double eps = 1e-12, pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define each(i,a) for (auto&& i : a)
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define eb emplace_back
#define all(a) begin(a),end(a)
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
template<typename Head> void out(Head h) { cout << h << endl; } template<typename Head, typename... Tail>void out(Head h, Tail... t) { cout << h << " "; out(t...); }
template<typename T> istream& operator>>(istream& is, vector<T>& v) { each(x,v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) { rep(i,v.size()) { if (i) os << " "; os << v[i]; } return os; }
ostream& operator<<(ostream& os, const vector<string>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
template<typename T1, typename T2> ostream& operator<<(ostream& os, const pair<T1, T2>& p) { return os << "(" << p.first << ", " << p.second << ")"; }
struct yes_no : std::numpunct<char> { string_type do_truename() const { return "Yes"; } string_type do_falsename() const { return "No"; } };
void solve(); int main() {
  ios::sync_with_stdio(false); cin.tie(0); locale loc(locale(), new yes_no); cout.imbue(loc); cout << fixed << setprecision(10) << boolalpha;
  solve();
}
// ^^^^^^^^^^^^ TEMPLATE ^^^^^^^^^^^^

void solve() {
  ll a, b, c; cin >> a >> b >> c;
  ll d = (c - (a + b));
  if (d < 0) {
    cout << false << endl;
  }
  else {
    cout << (4 * a * b < d * d) << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ln '\n';
int lim=1e6;
ll inf=1e9+7;
ll solve(vector<vector<char> > &a,int i,int j,int h,int w,vector<vector<ll> > &dp){
	if(i==h-1 and j==w-1){
		dp[i][j]=1;
		return 1;
	}else if(i>=h or j>=w){
		return 0;
	}else if(dp[i][j]!=-1){
		return dp[i][j];
	}else{
		ll ans=0;
		if(i==h-1){
			if(a[i][j+1]=='.'){
				ans=solve(a,i,j+1,h,w,dp);
			}
		}else if(j==w-1){
			if(a[i+1][j]=='.'){
				ans=solve(a,i+1,j,h,w,dp);
			}
		}else{
			if(a[i][j+1]=='.' and a[i+1][j]=='.'){
				ans=(solve(a,i+1,j,h,w,dp)+solve(a,i,j+1,h,w,dp))%inf;
			}else if(a[i][j+1]=='.'){
				ans=solve(a,i,j+1,h,w,dp);
			}else if(a[i+1][j]=='.'){
				ans=solve(a,i+1,j,h,w,dp);
			}
		}
		ans=ans%inf;
		dp[i][j]=ans;
		return ans;
	}
}

int main()
{	
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int h,w;
	cin>>h>>w;
	vector<vector<char> > a(h);
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			char x;
			cin>>x;
			a[i].push_back(x);
		}
	}
	vector<vector<ll> > dp(h,vector<ll>(w,-1));
	cout<<solve(a,0,0,h,w,dp)<<ln;
}

Measured memory_bytes: 9344
#include<bits/stdc++.h>
using namespace std;
#define RI register int
int n,K,ans,x[100005];
int main()
{
	
	scanf("%d%d",&n,&K);
	for(RI i=1;i<=n;++i) scanf("%d",&x[i]);
	ans=1e9;
	for(RI i=1;i+K-1<=n;++i) {
		int kl;
		if(x[i]<=0&&x[i+K-1]<=0) kl=abs(x[i]);
		else if(x[i]>=0&&x[i+K-1]>=0) kl=x[i+K-1];
		else kl=min(abs(x[i]),x[i+K-1])*2+max(abs(x[i]),x[i+K-1]);
		ans=min(ans,kl);
	}
	printf("%d\n",ans);
	return 0;
}
              

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    char x, y; cin >> x >> y;

    if(x > y) cout << '>' << endl;
    else if(x == y) cout << '=' << endl;
    else cout << '<' << endl;
} 

Measured memory_bytes: 256
import java.util.Scanner;                      
                                               
 class Main {                                  
    public static void main(String[] args) {   
     Scanner scanner = new Scanner(System.in);      


    	 
         int n = scanner.nextInt(); //		入力する数字の個数を設定
         int[] a;                   //      不特定多数の数字を入れるため配列aを設定
         a = new int[n];
         
         for(int i=0;i<n;i++){
        	a[i]= scanner.nextInt(); //      nの数だけ配列に入力
         }
        int max=a[0];               
        int min=a[0];              
        Long sum=(long)0;                 
        // 最大値,最小値,合計値を求めるためmax,min,sumをそれぞれ設定、max,minの初期値は配列の最初の数にする
        //またsumはint型だと合計が大きくなりすぎる可能性があるのでLong型に変換する
        
         for (int i=0; i<n; i++) {
           sum=sum+a[i];       //繰り返すたびに合計値を更新

              if (max < a[i]) {
               max = a[i];     //現在のmaxと比較し大きい方をmaxに代入
               }
              if (min > a[i]) {
               min = a[i];     //現在のminと比較し小さい方をminに代入
               }
          }
        
         
         System.out.println(min+" "+max+" "+sum);
          
        
 
  scanner.close();
 }
 }

    


Measured memory_bytes: 42572
#At coder 2020/3/27 C

# スペース区切りの整数の入力
N,M= map(int, input().split())
A = list(map(int, input().split())) 
sumA=sum(A)
numM = sum(x>=(sumA*0.25/M) for x in A)
if numM>=M:
    ans='Yes'
else:
    ans='No'
#print(numM,M)
print(ans)

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

typedef long long ll;
#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>
#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define llrep(i,n)   for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define all(var)     (var).begin(), (var).end()
#define prt(var)     cout << var << endl
#define prt_dbl(i,var) cout<<fixed<<setprecision(i)<<var<<endl;
template <typename Val>
Val gcd(Val a, Val b) {
//use ll or int for gcd
    if (b==0) return a;
    else return gcd(b, a%b);
}
template <typename Val>
Val vec_max(vector<Val> v){
  return *max_element(v.begin(),v.end());
}
template <typename Val>
Val vec_min(vector<Val> v){
  return *min_element(v.begin(),v.end());
}
//---------------------------------------------------------------
int main(){
  double N;
  cin>>N;
  double pi =  3.14159265358979323846;
  N = 2*N*pi;
  prt_dbl(4,N)

}


Measured memory_bytes: 3776
import itertools
import numpy as np

N, M, X = map(int, input().split())
items = np.array([list(map(int, input().split())) for _ in range(N)], dtype=np.int32)

out = 10**18
for c in itertools.product([False, True], repeat=N):
    tmp = np.sum(items[np.where(c)], axis=0)
    if M == np.count_nonzero(tmp[1:] >= X):
      out = min(out, tmp[0])

if out == 10**18:
  print(-1)
else:
  print(out) 

Measured memory_bytes: 27348
import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

case class Book(cost: Int, skills: Array[Int])

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val Array(n, m, x) = in.readLine().split("\\s+").map(_.toInt)
    val books = Array.fill(n) {
      val line = in.readLine().split("\\s+").map(_.toInt)
      Book(line(0), line.slice(1, line.length))
    }

    var minCost = Int.MaxValue

    for (i <- 0 until Math.pow(2, n).toInt) {
      val readBooks = books.foldLeft[(List[Book], Int)]((Nil, i)) {
        case ((acc, q), book) =>
          if ((q & 1) == 1) {
            (book :: acc, q >> 1)
          } else {
            (acc, q >> 1)
          }
      }._1
      var cost = 0
      val skill = Array.ofDim[Int](m)
      for (book <- readBooks) {
        cost += book.cost
        for (i <- skill.indices) {
          skill(i) += book.skills(i)
        }
      }
      if (skill.forall(_ >= x)) {
        minCost = Math.min(minCost, cost)
      }
    }

    out.println(
      if (minCost == Int.MaxValue) {
        -1
      } else {
        minCost
      }
    )

    out.flush()
  }
}


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

int main(){
  string s;
  cin >> s;
  int sum = 700;
  for(int i = 0; i < 3;i++){
    if(s.at(i) == 'o'){
      sum += 100;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

a, b, c = map(int, input().split())

if (a <= b*c):
    print("Yes")
else:
    print("No")


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

int main()
{
    int n,m,x,y,a=-1,b=1000,tem;
    scanf("%d%d%d%d",&n,&m,&x,&y);
    for(int i=0; i<n; i++)
        scanf("%d",&tem),a=max(a,tem);
    for(int i=0; i<m; i++)
        scanf("%d",&tem),b=min(b,tem);
    for(int i=x+1; i<=y; i++)
        if(a<i&&i<=b)
        {
            printf("No War\n");
            return 0;
        }
    printf("War\n");
    return 0;
}



Measured memory_bytes: 256
N = int(input())

count = 0
for i in range(N):
    D1, D2 = map(int, input().split())

    if D1 == D2:
        count += 1
        if count >= 3:
            break
    else:
        count = 0

if count >= 3:
    print('Yes')
else:
    print('No')

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

int main () {
  int answer = 0 ;
  for (int i = 0 ; i < 3 ; i++ ) {
    char a ;
    a = ' ' ;
    cin >> a ;
    if(a == 'o') answer++ ;
  }
  
  cout << 700 + 100 * answer << endl ;
  
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

const LL mod = 1000000007;
LL N, couA, couB, ans;
std::vector<std::pair<LL, LL>>p;

int main()
{
	in >> N;
	std::vector<LL>a(N), b(N);
	rep(i, N) in >> a[i];
	rep(i, N) in >> b[i];
	rep(i, N)
	{
		p.push_back(std::make_pair(a[i], 1));
		p.push_back(std::make_pair(b[i], 2));
	}
	std::sort(p.begin(), p.end());
	ans = 1;
	rep(i, 2 * N)
	{
		if (p[i].second == 1) ++couA;
		else ++couB;
		if (couA > 0 && couB > 0)
		{
			ans *= couA * couB;
			ans %= mod;
			--couA; --couB;
		}
	}
	out << ans << std::endl;
	return 0;
}


Measured memory_bytes: 8048
n, m = gets.chomp.split.map(&:to_i)
edges = []
$graph = Array.new(n).map{Array.new()}

m.times {
  a, b = gets.chomp.split.map(&:to_i)
  a -= 1; b-= 1;
  edges.push( [a, b] )
  $graph[a].push(b)
  $graph[b].push(a)
}

def dfs(u, v, n)
  is_visited = [ false ]*n
  is_visited[0] = true
  st = [ 0 ]
  while not st.empty?
    cur = st.pop
    for adj in $graph[cur] do
      if is_visited[adj] == true ||
          cur == u && adj == v ||
          cur == v && adj == u then
        next
      end
      is_visited[adj] = true
      st.push(adj)
    end
  end
  return is_visited.all?
end

ans = 0
m.times { |i|
  u = edges[i][0]
  v = edges[i][1]
  if dfs(u, v, n) == false
    ans += 1
  end
}

p ans


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

int main() {
  string S;
  cin>>S;
  int mini(0),maxi(0);
  for (int i(0);i<S.size();i++){
    if (S[i]=='A'){
      mini=i;
      break;
    }
  }
  for (int i(S.size()-1);i>=0;i--){
    if (S[i]=='Z'){
      maxi=i;
      break;
    }
  }
  cout << maxi-mini+1<<endl;
}

Measured memory_bytes: 640
import sys, math, itertools, bisect, copy, re
from collections import Counter, deque, defaultdict

# from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
# from functools import reduce
# from math import ceil, floor, log10, log2, factorial
# from pprint import pprint

INF = float('inf')
MOD = 10 ** 9 + 7
EPS = 10 ** -7
sys.setrecursionlimit(1000000)

# N = int(input())
# N,M = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]
# DP = [[0] * 100 for _ in range(100)]
# DP = defaultdict(lambda: float('inf'))

A, B = [int(x) for x in input().split()]

if (A + B) % 2 == 0:
    print((A + B) // 2)
else:
    print('IMPOSSIBLE')


Measured memory_bytes: 3824
program exactly_n_points
  implicit none
  integer :: n, i, s, j
  read(*,*) n
  s = 0
  do i = 1, n
    s = s+i
    if (s.ge.n) then
      j = i
      exit
    end if
  end do
  do i = 1, j
    if (i.eq.s-n) cycle
    write(*,'(i0)') i
  end do
  stop
end program exactly_n_points

Measured memory_bytes: 256
# https://atcoder.jp/contests/abc129/tasks/abc129_c
# 典型的なDP


def full(shape, full_value):
    if isinstance(shape, tuple):
        NotImplementedError()
    else:
        return [full_value] * shape


MOD = 10**9 + 7
# dp[i]をi段目までの通りの数とする。
N, M = list(map(int, input().split()))
to_zero = full((N + 1), False)
for _ in range(M):
    to_zero[int(input())] = True  # 床が抜けているところ

# dpテーブルの用意
dp = full((N + 1), -1)
dp[0] = 1
dp[1] = 0 if to_zero[1] else 1
for i in range(2, N + 1):
    dp[i] = 0 if to_zero[i] else dp[i - 2] + dp[i - 1]
    if dp[i] > MOD:
        dp[i] %= MOD

print(dp[-1])


Measured memory_bytes: 7668
import java.io.*;
import java.math.*;
import java.util.*;

import static java.util.Arrays.fill;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;

public class Main {
	static int mod = 1000000007;
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {

		int n=in.nextInt();
		int x=in.nextInt();
		int[] a=new int[n];
		long total=0;
		for(int i=0;i<n;i++)
		{
			a[i]=in.nextInt();
			total+=(long)a[i];
		}
		if(total==x)
		{
			out.println(n);
		}
		else 
			if(total<x)
			{
				out.println(n-1);
			}
			else
			{
				Arrays.sort(a);
				int ans=0;
				total=0;
				for(int i=0;i<n;i++)
				{
					total+=a[i];
					if(total<=x)
						ans++;
				}
				out.println(ans);
			}
		out.close();

	}

	static class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;

		public InputReader(InputStream st) {
			this.stream = st;
		}

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}

	private static void tr(Object... o) {
		if (!(System.getProperty("ONLINE_JUDGE") != null))
			System.out.println(Arrays.deepToString(o));
	}
}




Measured memory_bytes: 21716