akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pr;
typedef vector<pr> vp;
typedef vector<vp> vpp;
typedef vector<vector<ll> > graph;
#define pb push_back
#define mp make_pair
#define maxi INT_MAX
#define mini INT_MIN
#define endl '\n'
void set_val(vector<ll>& v, ll val){for(ll i=0;i<v.size();i++) v[i]=val;}

ll mod = pow(10,9) + 7;
ll modulo = 998244353;
ll i_mov[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
ll j_mov[8] = {1, 1, 1, 0, -1, -1, -1, 0};

vector<vector<int>> g;
vector<int> parent, depth, subsize;

ll power(ll a, ll n)
{
    if(n==0)
    return 1;
    ll temp = power(a,n/2);
    if(n%2==0)
    return (temp*temp)%mod;
    return (((temp*temp)%mod)*a)%mod;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    // cout<<fixed;
    // cout<<setprecision(18);
    ll n, k;
    cin>>n>> k;
    vector<ll> count(k+1,0);
    ll ans = 0;
    for(int i=k;i>0;i--)
    {
        ll t = floor(k/i);
        ll temp = power(t,n);
        for(int j=2*i; j<=k; j+=i)
        temp=(temp-count[j])%mod;
        count[i]=temp;
    }
    for(int i=1;i<=k;i++)ans= (ans+(i*count[i])%mod)%mod;
    cout<<ans<<endl;
    
    
    
    
} 

Measured memory_bytes: 3992
#include <bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
const int N=1e5+1e2;

int n,m,k,Ans=inf;
int a[N],sum[N];
int main()
{
	//freopen("Atcoder.in","r",stdin);
	//freopen("Atcoder.out","w",stdout);
	cin>>n>>k;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++){
		if(i+k-1>n)break;
		int Ptans=a[i+k-1]-a[i];
		if(a[i+k-1]<=0)Ans=min(Ptans-a[i+k-1],Ans);
		else if(a[i]>=0)Ans=min(Ptans+a[i],Ans);
		else Ans=min(min(Ptans-a[i],Ptans+a[i+k-1]),Ans);
	}
	printf("%d\n",Ans);
	return 0;
}


Measured memory_bytes: 640
import sys
input=sys.stdin.readline

def main():
    H,W,A,B = map(int,input().split())
    for h in range(H):
        if h < B:
            print("0"*A+"1"*(W-A))
        else:
            print("1"*A+"0"*(W-A))

if __name__ == '__main__':
    main()


Measured memory_bytes: 3956
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        boolean isS = false;
        while (n!=0){
            if(n%10 == 7){
                isS = true;
                break;
            }
            n/=10;
        }

        System.out.println(isS?"Yes":"No");
    }
}


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

#define rep(i, n) for  (int i = 0; i < (int)n; i++)
#define vec vector

int main(void)
{
	map<int, int> mp;
	int n,  m;
	cin >> n;
	rep(i, n) {
		int d;
		cin  >> d;
		mp[d]++;
	}
	cin >> m;
	rep(i, m) {
		int t;
		cin >>  t;
		if (!mp[t]) {
			printf("NO\n");
			return 0;
		}
		mp[t]--;
	}
	printf("YES\n");
	return 0;
}

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

long long md(pair<long long,long long> x,pair<long long,long long> y){
    return max(x.first,y.first)-min(x.first,y.first)+max(x.second,y.second)-min(x.second,y.second);
}

int main(){
    int N,ans=0,cnt=0;
    string S;
    cin >> N >> S;
    for(int i=0;i<S.size();i++){
        if(S[i]=='I'){
            cnt++;
            ans=max(ans,cnt);
        }
        else
        cnt--;
    }
    cout << ans << endl;
}

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

using namespace std;

const int MAX = 100000;

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

	vector<int> v;
	v.push_back(1);
	int s6 = 1, s9 = 1;
	for (int i = 1; i < 7; i++) {
		s6 *= 6;
		v.push_back(s6);
		s9 *= 9;
		if (s9 <= MAX)
			v.push_back(s9);
	}
	sort(v.begin(), v.end());
	int n;
	cin >> n;
	int dp[MAX + 1];
	dp[0] = 0;
	for (int i = 1; i <= n; ++i) {
		dp[i] = dp[i - 1] + 1;
		for (int j = 1; (j < v.size()) && i >= v[j]; j++) {
			dp[i] = min(dp[i], dp[i - v[j]] + 1);
		}
	}
	cout << dp[n];
	return 0;
}


Measured memory_bytes: 640
using CompLib.Util;
using System;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int a = sc.NextInt();
        int b = sc.NextInt();
        int c = sc.NextInt();

        if (a == b && b != c)
        {
            Console.WriteLine("Yes");
            return;
        }
        if (b == c && c != a)
        {
            Console.WriteLine("Yes");
            return;
        }
        if (c == a && a != b)
        {
            Console.WriteLine("Yes");
            return;
        }

        Console.WriteLine("No");
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;
    class Scanner
    {
        private int _index;
        private string[] _line;
        const char separator = ' ';

        public Scanner()
        {
            _index = 0;
            _line = new string[0];
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(separator);
                _index = 0;
            }
            return _line[_index++];
        }
        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(separator);
            _index = _line.Length;
            return _line;
        }
        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
    }
}

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

int main(){
    string s;
    cin>>s;
    int count=0;
    if (s[0]=='1'){count+=1;}
    if (s[1]=='1'){count+=1;}
    if (s[2]=='1'){count+=1;}
    cout<<count<<endl;
}

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

int main(void){
    int N,AC,WA,TLE,RE;
    cin>>N;
    string s;
    AC = WA = TLE = RE = 0;

    for(int i=0;i<N;i++){
        cin>>s;
        if(s == "AC")AC++;
        if(s == "WA")WA++;
        if(s == "TLE")TLE++;
        if(s == "RE")RE++;
    }

    cout<<"AC x "<<AC<<endl;
    cout<<"WA x "<<WA<<endl;
    cout<<"TLE x "<<TLE<<endl;
    cout<<"RE x "<<RE<<endl;

    return 0;

}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
// const int MOD = 1e9 + 7;

int main() {
    int A, B;
    cin >> A >> B;
    string S;
    cin >> S;
    if ((int)S.size() != A + B + 1) {
        cout << "No\n";
        return 0;
    }
    for (int i = 0; i < A; i++) {
        if (!('0' <= S[i] && S[i] <= '9')) {
            cout << "No\n";
            return 0;
        }
    }
    if ('-' != S[A]) {
        cout << "No\n";
        return 0;
    }
    for (int i = A + 1; i < A + B + 1; i++) {
        if (!('0' <= S[i] && S[i] <= '9')) {
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>

using namespace std;

vector<int> blue;
vector<int> red;
vector<int> redpair;
vector<int> v;
vector<vector<int> >c;

int m = 0;
int n = 0;

int gcd(int x,int y){
    if(x % y == 0){
        return y;
    }
    return gcd(y,x%y);
}

bool match(int x){
    if(x == -1){
        return 1;
    }
    for(int i = 0;i < n;i++){
        if(c[x][i] == 1 && v[i] == 0){
            v[i] = 1;
            if(match(redpair[i])){
                redpair[i] = x;
                return 1;
            }
        }
    }
    return 0;
}


int main(){
    while(cin >> m >> n){
        if(m == 0 && n == 0){
            break;
        }
        blue.clear();
        red.clear();
        redpair.clear();
        v.clear();
        c.clear();
        for(int i = 0;i < m;i++){
            int tmp = 0;
            cin >> tmp;
            blue.push_back(tmp);
        }
        for(int i = 0;i < n;i++){
            int tmp = 0;
            cin >> tmp;
            red.push_back(tmp);
            redpair.push_back(-1);//-1??§?????¢??????????????¶????????¨???
            v.push_back(0);
        }
        for(int i = 0;i < m;i++){
            c.push_back(vector<int>());
            for(int j = 0;j < n;j++){
                c[i].push_back(gcd(blue[i],red[j]) != 1);
            }
        }
        int ans = 0;
        for(int i = 0;i < m;i++){
            for(int j = 0;j < n;j++){
                v[j] = 0;
            }
            if(match(i)){ans++;}
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 2156
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define MOD 1000000007
#define pie 3.14159265358979323846264338327950L
#define N 100005
#define M 1e6+9
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define vecl vector<ll>
#define umap unordered_map<ll,ll>
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define endl "\n"
#define int long long
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};  
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}

// ll n,k,a,b,c,d,x,y,z,m,l;
ll ans;
vecl arr(N);
ll dp[509][509];
ll pre[N];



void test_case() {

    
   string x, y;
   cin>>x>>y;

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

   string u;
   cin>>u;

   if(u==x) {
       a--;
   } else {
       b--;
   }

   cout<<a<<" "<<b<<endl;








}


int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout<<fixed<<setprecision(20);

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


    int t = 1;
    // cin >> t;
    while(t--)
    {   
        test_case();
    }
}


Measured memory_bytes: 3768
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define mod 1000000007 //10^9+7
#define P pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
int n;
string s;
signed main(){
    cin>>n>>s;
    if(n%2)puts("No");
    else{
        string a=s.substr(0,n/2),b=s.substr(n/2,n/2);
        if(a==b)puts("Yes");
        else puts("No");
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef map<int,int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vl;
typedef vector<vector<ll>> vll;
typedef vector<bool> vb;
typedef set<int> si; 
typedef queue<int> qi;
typedef stack<int> sti;
typedef priority_queue<int> pqi;
#define fori(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,b,a) for(int i = (b); i >= (a); --i)
#define all(a) (a).begin(), (a).end()
//#define __builtin_popcountll bitCountLL
//#define __builtin_popcount bitCount
//__builtin_ctz 末尾0的个数, __builtin_clz 前导0的个数
//__builtin_ffs 最后一个1的位置
mt19937 mt_rand(chrono::high_resolution_clock::now().time_since_epoch().count());
//std::uniform_int_distribution<long long> rg(1,1e18);
#define maxn 100005
#define Mod 1000000007
const int INF = 2e9;
const ll ML = 4e18;
    
void solve() {
    string s;
    cin >> s;
    int ans = 0;
    fori(i,0,3) {
        if(s[i] == 'R') {
            int j = i;
            while(j < 3 && s[j] == 'R') j++;
            ans = max(ans, j - i);
            i = j;
        }
    }
    cout << ans << endl;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	//cout.precision(30); cout << fixed;
//	freopen("D:\\data_in.txt", "r", stdin);
   
    solve();
   
    /*
    clock_t start,finish;
    start = clock();
    
    finish = clock();
    cout << "\n" << (double)(finish - start) / (double)(CLOCKS_PER_SEC) * 1000 << "ms" << endl;
    */
    return 0;
}

/***************************************************************
 question:
 idea:
 tag:
 record:
 ***************************************************************/


Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int c,m,n;
	cin >> c;
	while(c--){
		cin >> m >> n;
		if(m*m + n*n <= 1){
			cout << 'C' << endl;
			continue;
		}
		int ct = 0;
		int size = 20000;
		for(int x = -sqrt(size) ;x*x <= size;++x){
			for(int y = -sqrt(size) ;y*y <= size;++y){
				if(x==y && x==0)continue;
				int sqsum = x*x + y*y;
				int a = x*m + y*n, b = x*n - y*m;
				if((a == 0 || a % sqsum == 0) && (b == 0 || b % sqsum == 0)){
					ct++;
					//					cout << "x:" << x << " y:" << y << endl;
				}
			}
		}
		if(ct == 8)cout << 'P' << endl;
		else cout << 'C' << endl;
	}
  return 0;
}

Measured memory_bytes: 3116
import sys

a, b, c = map(int, input().split())
k = int(input())
for x in range(k+1):
    for y in range(x, k+1):
        if a * (2**x) < b * (2**(y-x)) < c* (2**(k-x-y)):
            print("Yes")
            sys.exit()
else:
    print("No")

Measured memory_bytes: 9204
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <set>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <map>
#include <iomanip>
#include <numeric>

using namespace std;

typedef long long ll;

#define forn(i,n) for(int i = 0; i < int(n);++i)
#define pb push_back
#define vi vector<int>
#define vb vector<bool>
#define vll vector<ll>
#define sz(x) (int)x.size()

void solve(){

}

int main() {
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    ll n, k, q;
    cin >> n >> k >>q;
    vi a(n,k);
    ll x;
    vb dead(n,false);
    int  t = q;
    while(q--){
        cin >> x;
        x--;
        a[x]++;
    }
    
    for(auto i: a){
        if(i - t > 0){
            cout << "Yes\n";
        }else{
            cout << "No\n";
        }
    }
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

using namespace std;

bool left_[26];
const char* left_str = "abcdefgqrstvwxz";

inline bool isLeft(char c)
{
    return left_[c - 'a'];
}

int main()
{
    for (int i = 0; i < 15; i++) {
        left_[left_str[i] - 'a'] = true;
    }
    while (true) {
        string str;
        cin >> str;
        if (str.size() == 1 and str[0] == '#') {
            break;
        }
        bool l = isLeft(str[0]);
        int cnt = 0;
        for (int i = 1; i < str.size(); i++) {
            bool l2 = isLeft(str[i]);
            if (l != l2) {
                cnt++;
                l = l2;
            }
        }
        cout << cnt << endl;
    }

    return 0;
}

Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define sd second
#define ft first
#define pr pair
#define vl vector<ll>
#define vs vector<string>
#define vmp vector<pair<ll,ll>>
#define en "\n"
#define lb lower_bound
#define ub upper_bound
#define vll vector<vector<ll>>
#define vmpl vector<vector<pair<ll,ll>>>
#define st size()
#define al(v) v.begin(),v.end()
#define cast static_cast<char>
#define ins insert
#define fata_fat ios_base::sync_with_stdio(false); cin.tie(NULL);
ll M=1e9+7,MAX=1e18,MIN=-1e18;
void bhaag()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}
int main()
{   
     bhaag(); fata_fat;
     ll a,b,c,i,k,l=0; cin>>a>>b>>c>>k;
     for(i=0;i<k;i++)
     {
         if(a<b&&b<c){l=1; break;}
         else
         {
             if(a>=b)b=b*2;
             else c=c*2;
         }
     } if(a<b&&b<c)l=1;
     if(l==1)cout<<"Yes";
     else cout<<"No";
}


Measured memory_bytes: 3648
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 1<<30
#define MOD 1000000007
#define mod 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef long long int LL;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
char dir[4]={'u','l','d','r'};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//---------------------------------------------------------------------------
int b[200001],w[200001];
//---------------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    int n;string s;
    cin>>n>>s;
    for(int i=0;i<n;i++){
        if(s[i]=='#')b[i]++;
        if(i)b[i]+=b[i-1];
    }
    for(int i=n-1;i>=0;i--){
        if(s[i]=='.')w[i]++;
        if(i<n-1)w[i]+=w[i+1];
    }
    ll ans=INF;
    for(int i=0;i<n-1;i++){
        chmin(ans,b[i]+w[i+1]);
    }
    chmin(ans,w[0]);
    chmin(ans,b[n-1]);
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------

/*
 10
 ...##.#.##
ll n;cin>>n;
vector<ll>a(n);
for(ll i=0;i<n;i++)
    cin>>a[i];
 
ll n;cin>>s;
string s;cin>>s;

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

ll n;cin>>n;
vector<Pll>xy;
for(ll i=0;i<n;i++){
    ll x,y;cin>>x>>y;
    xy.pb({x,y});
}
*/


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

int main(){
  string s;
  ll q;
  cin >> s >> q;
  deque<char> dS(s.size());
  for(int i=0; i<s.size(); i++) dS[i] = s[i];
  
  
  int flag = 0;
  for(ll i=0; i<q; i++){
    int t; cin >> t;
    
    
    if(t==2){
      int f; char c;
      cin >> f >> c; f--;
      
      if(flag) f = 1 - f;
      if(f==0) dS.push_front(c);
      else dS.push_back(c);
    
    }else{
      flag = 1 - flag;
    
    }
  }
  
  if(flag) reverse(dS.begin(), dS.end());
  
  for(auto s:dS) cout << s;
  cout << endl;
  
  return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef pair<ll, int> PILL;
typedef pair<ll, ll> PLL;

const int MAX_N = 1e5+5;
const int M = 1e6;
const ll INF = (ll)(1e18);
const int inf = 1e9;
const ll MOD = 1000000007LL;

void solve() {

}



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

    int n;
    string s, t;
    cin >> n >> s >> t;

    for (int i = 0; i < n; i++) {
        cout << s[i] << t[i];
    }




    return 0;
}


Measured memory_bytes: 256
N, M, X = [int(x) for x in input().split()]
CA = []
f = False
ans = 10**9
for _ in range(N):
    lst = [int(x) for x in input().split()]
    CA.append(lst)
for i in range(2**N):
    tmp = [0] * M
    c = 0
    for j in range(N):
        if ((i >> j) & 1):
            ca = CA[j]
            c += ca[0]
            for k in range(M):
                tmp[k] += ca[k+1]
    if min(tmp) >= X:
        f = True
        ans = min(ans, c)
print(ans if f else -1)


Measured memory_bytes: 68828
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
typedef pair<ll,ll> pll;
void read(int& x){ scanf("%d",&x); }
void read(ll& x){ scanf("%lld",&x); }
template<typename T,typename... Args>
void read(T& a,Args&... b){ read(a); read(b...); }
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define eb emplace_back
#define x first
#define y second

char s[100010]; int m;
int n_, n;
pp dd[100010];
int targ[100010];

int par[100010];
int diff[100010];
int r(int x){ return (x==par[x])?x:(par[x]=r(par[x])); }

int main()
{
	scanf("%s", s+1); m = strlen(s+1);
	read(n_);
	for(int i=1; i<=n_; ++i){
		int l, r; read(l, r);
		if(m%2==1 && r == m/2+1) --r;
		if(m%2==1 && l == m/2+1) ++l;
		if(l>r) continue;
		if(l <= m/2){
			if(r <= m/2){
				dd[++n] = {m+1-r, m+1-l};
			} else {
				if(l+r == m+1) continue;
				if(l > m+1-r){
					l = m+2-l;
				} else {
					r = r+1;
					l = m+1-l;
					swap(l, r);
				}
				dd[++n] = {l, r};
			}
		} else {
			dd[++n] = {l, r};
		}
		//printf("Converted to: %d %d\n", dd[n].x, dd[n].y);
	}
	for(int i=m/2+2; i<=m; ++i){
		targ[i] = ((52 + s[m+1-i]) - s[m+2-i]) % 26;
	}
	int from = (m+1)/2+1;
	//for(int i=from; i<=m; ++i) printf("targ[%c] = %d\n", s[i], targ[i]);
	for(int i=from; i<=m+1; ++i) par[i]=i, diff[i]=((targ[i]+52)-(s[i]-s[i-1])) % 26;
	for(int i=1; i<=n; ++i){
		int a, b; tie(a, b) = dd[i]; ++b;
		a=r(a); b=r(b);
		if(a!=b){
			diff[b] += diff[a];
			par[a] = b;
		}
	}
	for(int i=from; i<=m+1; ++i) if(par[i] == i){
		if(diff[i]%26 && r(m+1)!=i){
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}


Measured memory_bytes: 1664
#include <stdio.h>

int main (void)
{
    char s[12];
    int i;
    scanf("%s",s);
    for(i=0;i<4;i++){
        printf("%c",s[i]);
    }
    putchar(' ');
    for(i=4;i<12;i++){
        printf("%c",s[i]);
    }
    printf("\n");
    return 0;
}

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

typedef int64_t Int;
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << '\n'; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) std::cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << '\n';
}

void solve() {
    Int a, b, x;
    cin >> a >> b >> x;
    print(a <= x and x <= a + b ? "YES" : "NO");
}

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


Measured memory_bytes: 3620
use whiteread::parse_line;

fn main() {
    let (x1, y1, x2, y2): (i32, i32, i32, i32) = parse_line().unwrap();
    let xd = x2 - x1;
    let yd = y2 - y1;
    let x3 = x2 - yd;
    let y3 = y2 + xd;
    let x4 = x3 - xd;
    let y4 = y3 - yd;
    println!("{} {} {} {}", x3, y3, x4, y4);
}


Measured memory_bytes: 2168
#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <queue>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
template<class T> inline void chmin(T& a, T b) {if (a>b) a=b; }
template<class T> inline void chmax(T& a, T b) {if (a<b) a=b; }
inline void print() { cout << endl; }
template <class Head, class... Tail> inline void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " "; print(forward<Tail>(tail)...);}
template <class T> inline void print(vector<T>& vec) { for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " "; } cout << endl;}
template <class T> inline void print(vector<vector<T>>& df) { for (auto& vec : df) { print(vec); }}

typedef long long ll;
const ll LINF = 1e18;
const int INF = 1e9;


int main() {
    int N, M; cin >> N >> M;
    priority_queue<int> products;
    REP(i, N) {
        int p; cin >> p;
        products.push(p);
    }
    REP(i, M) {
        int p = products.top();
        products.pop();
        products.push(p/2);
    }
    ll res = 0;
    while(!products.empty()) {
        res += products.top();
        products.pop();
    }

    print(res);

    return 0;
}

bool myComparison(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return a.second>=b.second;
}

int main2() { 
    int N, M; cin >> N >> M;
    vector<ll> A(N);
    REP(i, N) {
        ll a; cin >> a;
        A[i] = a;
    }

    vector<pair<ll, ll>> big; // (A.idx, val)
    int maxBit = 63;
    REP(s, maxBit) {
        int shift = maxBit-s;
        REP(i, N) {
            if(A[i] & (1 << shift)) {
                // print("shift", shift);
                // big.push_back(make_pair(i, A[i]));
                big.push_back(make_pair(A[i], i));
            }
        }
        // print(A);


        if(big.size() > 0) {
            // print("----");
            // sort(big.begin(), big.end(), myComparison);//greater<pair<int, int>>());
            sort(big.begin(), big.end(), greater<pair<int, int>>());
            // REP(i, big.size()) {
            //     print("====", big[i].first, big[i].second);
            // }

            REP(i, big.size()) {
                // print("i=", i, "big v=", big[i].second, "A idx=", big[i].first);
                // A[big[i].first] = A[big[i].first] >> 1;
                A[big[i].second] = A[big[i].second] >> 1;
                // print("new A[big[i].first]=", A[big[i].first]);
                // print(A);
                M--;
                // print("M=", M);
                if(M<=0) {
                    break;
                }
            }
        }
        if(M<=0) {
            break;
        }
        big.clear();
    }

    ll res = 0;
    REP(i, N) {
        res += A[i];
    }
    cout << res << endl;;

    return 0;
}

Measured memory_bytes: 892
a = list(map(int,input().split()))
ans = 0
if (a[0]%2+a[1]%2+a[2]%2) == 1:
    a = [i+1 if (i%2)==0 else i for i in a]
    ans += 1
    b,a[a.index(min(a))] = (max(a) - min(a))//2,max(a)
    c,a[a.index(min(a))] = (max(a) - min(a))//2,max(a)
    ans += (b+c)
elif (a[0]%2+a[1]%2+a[2]%2) == 2:
    a = [i+1 if (i%2)==1 else i for i in a]
    ans += 1
    b,a[a.index(min(a))] = (max(a) - min(a))//2,max(a)
    c,a[a.index(min(a))] = (max(a) - min(a))//2,max(a)
    ans += (b+c)
else:
    b,a[a.index(min(a))] = (max(a) - min(a))//2,max(a)
    c,a[a.index(min(a))] = (max(a) - min(a))//2,max(a)
    ans += (b+c)
print(ans)

Measured memory_bytes: 3188
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		String B = sc.next();
		sc.close();
		String[] bs_str = B.split("\\.");
		long ans = (A * Integer.parseInt(bs_str[0]+bs_str[1]))/100;
		System.out.println(ans);
	}
}


Measured memory_bytes: 39280
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
long long X=0,x=0,ans=1000000000000000000LL;
cin>>n;
vector<long long> a(n);
for(int i=0;i<n;i++){
cin>>a[i];
X+=a[i];
}
for(int i=0;i<n;i++){
x+=a[i];
if(i+1<n)ans=min(ans,abs(X-2*x));
}
cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include<stdio.h>
int main(){
    int n;
    int b;
    scanf("%d",&n);
    while(n!=0){
        b=n%10;
        if(b==7){
            printf("Yes");
            return 0;
        }
        n=n/10;
        if(n==0){
            printf("No");
            return 0;
        }
    }
}

Measured memory_bytes: 1712
S = input()
one = 0
two = 0
strs = ["", ""]

for s in S:
    if strs[0] == s:
        one += 1
    elif strs[1] == s:
        two += 1
    elif strs[0] == "":
        strs[0] = s
        one += 1
    elif strs[1] == "":
        strs[1] = s
        two += 1
    else:
        print("No")
        break
    if one > 2 or two > 2:
        print("No")
        break
else:
    print("Yes")

Measured memory_bytes: 38384
# include<iostream>
#include <string>

using namespace std;
int main() {
	int a = 0;
	int b = 0;
	string c;
	int k = 0;
	while (true)
	{
		cin >> a >> c >> b;
		if (c == "+") {
			k = a + b;
		}
		if (c == "-") {
			k = a - b;
		}
		if (c == "*") {
			k = a * b;
		}
		if (c == "/") {
			k = a / b;
		}

		if (c == "?") {
			break;
		}
		cout << k << endl;
	}
}

Measured memory_bytes: 3132
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define nthElement(x) find_by_order(x)
#define lessThan(x) order_of_key(x)
#define dd double
#define pb push_back
#define pf push_front
#define ll long long
#define ull unsigned long long
#define ld long double
#define mx 200
#define mod 1000000007
#define fr first
#define se second
#define End cout<<"\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define memo(Array,val) memset(Array, val, sizeof Array)
#define PI acos(-1)
#define per(i) cout<<fixed<<setprecision(i)
#define con continue
#define all(ele) (ele).begin(),(ele).end()
#define Ones(x) __builtin_popcount(x)
#define trailingZero(x) __builtin_ctz(x)
#define len(ele) (ele).size()

template<typename... T> void get(T&... args) { ((cin >> args), ...); }

template<typename... T> void Get(T&... args){ ((getline(cin,args)), ...); }

template<typename... T> void print(T&&... args) { ((cout << args << ""), ...); }

bool check(ll n, ll pos){ return (n&(1<<pos)); }
bool Set(ll n, ll pos) {  return (n | (1<<pos)); }
ld LOG(ld b, ld e){ return log(b)/log(e); }
ld rad(ld x) {  return ((ld)PI*x)/180.0; }

/// Code Starts From Here.............................................///

int tc=1;

void solve(int kk)
{
    map<string,int> mp;
    string s1;
    int n;
    cin >> n;
    for(int i=0; i<n; i++)
        cin >> s1, mp[s1]++;
    cout << "AC x " << mp["AC"] << "\n";
    cout << "WA x " << mp["WA"] << "\n";
    cout << "TLE x " << mp["TLE"] << "\n";
    cout << "RE x " << mp["RE"] << "\n";
}

int main()
{
   //freopen("text.txt", "r", stdin);
   //freopen("text2.txt", "w", stdout);
   fast;
   int kk=0;
   //cin >> tc;
   //scanf("%d", &tc);
   while(++kk<=tc) solve(kk);

   return 0;
}


Measured memory_bytes: 3684
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<string>vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  bool frag1=true;
  for(int i=1;i<N;i++){
    for(int j=0;j<i;j++){
      if(vec.at(i)==vec.at(j)){
        frag1=false;
      }
      else{
      }
    }
  }
  bool frag2=true;
  for(int i=0;i<N-1;i++){
    string s,t;
    s=vec.at(i);
    t=vec.at(i+1);
    if(s.at(s.size()-1)!=t.at(0)){
      frag2=false;
    }
    else{
    }
  }
  if(frag1==true&&frag2==true){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N 
using namespace std;
bool cur1;
int n;
inline void Rd(int &res){
	char c;res=0;
	while(c=getchar(),c<48);
	do res=(res<<3)+(res<<1)+(c^48);
	while(c=getchar(),c>47);
	return;
}
bool cur2;
int main(){
//	printf("%lf MB\n",(&cur2-&cur1)/1024.0/1024);
	int d;
	Rd(n);Rd(d);
	printf("%d\n",(n+2*d)/(2*d+1));
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define all(v) v.begin(),v.end()
#define fin(a,n) for(int i=a;i<n;i++)
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;

int main() {
    int a,b,c;
    cin>>a>>b>>c;
    if(a==b && b==c)
    	cout<<1;
    else if(a==c || a==b || b==c )
    	cout<<2;
    else 
    	cout<<3;
	
	return 0;
}


Measured memory_bytes: 256
import sys
from math import factorial

MOD = 10**9 + 7

def solve():
    N = int(input())
    ans = factorial(N) % MOD
    print(ans)
    
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None


if __name__ == '__main__':
    solve()

Measured memory_bytes: 4092
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        vector<string> s(n);
        for(int i=0; i<n; ++i)
            cin >> s[i];

        for(int i=0; i<n; ++i){
            for(int j=0; j<n; ++j){
                if(i != j && s[j].find(s[i]) != string::npos){
                    s.erase(s.begin() + i);
                    -- i;
                    -- n;
                    break;
                }
            }
        }

        vector<vector<int> > connect(n, vector<int>(n, 0));
        for(int i=0; i<n; ++i){
            for(int j=0; j<n; ++j){
                for(unsigned k=1; k<=min(s[i].size(), s[j].size()); ++k){
                    if(s[j].substr(0, k) == s[i].substr(s[i].size()-k))
                        connect[i][j] = k;
                }
            }
        }

        vector<vector<string> > dp(1<<n, vector<string>(n, string(101, ' ')));
        for(int i=0; i<n; ++i)
            dp[1<<i][i] = s[i];

        for(int i=0; i<(1<<n); ++i){
            bitset<10> bs(i);
            for(int j=0; j<n; ++j){
                if(!bs[j])
                    continue;
                for(int k=0; k<n; ++k){
                    if(bs[k])
                        continue;

                    string t = dp[i][j];
                    t += s[k].substr(connect[j][k]);
                    bs[k] = true;
                    if(t.size() < dp[bs.to_ulong()][k].size())
                        dp[bs.to_ulong()][k] = t;
                    else if(t.size() == dp[bs.to_ulong()][k].size())
                        dp[bs.to_ulong()][k] = min(dp[bs.to_ulong()][k], t);
                    bs[k] = false;
                }
            }
        }

        string ret(101, ' ');
        for(int i=0; i<n; ++i){
            if(dp[(1<<n)-1][i].size() < ret.size())
                ret = dp[(1<<n)-1][i];
            else if(dp[(1<<n)-1][i].size() == ret.size())
                ret = min(dp[(1<<n)-1][i], ret);
        }
        cout << ret << endl;
    }
}

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

int main(){
    int k;
    string s;
    cin >> k >> s;
    if(s.size() <= k) cout << s << endl;
    else{
        for(int i = 0; i < k; i++){
            cout << s[i];
        }
        cout << "..." << endl;
    }
}

Measured memory_bytes: 3592
#include<stdio.h>
int main(){
  int a,b,c,max,mid,min,i,x_d,x_n,num,j,tmp;
  int cnt[3];
  scanf("%d%d%d",&a,&b,&c);
  cnt[0]=a;
  cnt[1]=b;
  cnt[2]=c;
  for(i=0;i<3;i++){
    for(j=i;j<3;j++){
      if(cnt[i]<cnt[j]){
        tmp=cnt[i];
        cnt[i]=cnt[j];
        cnt[j]=tmp;
      }
    }
  }
  max=cnt[0];
  mid=cnt[1];
  min=cnt[2];
  //printf("%d\n",cnt[0]);
  //printf("%d\n",cnt[1]);
  //printf("%d\n",cnt[2]);
  x_d=max-mid;
  x_n=max-min;
  if(x_d%2==x_n%2){
    num=x_d+(x_n-x_d)/2;
  }
  else{
    max+=1;
    min+=1;
    x_d=max-mid;
    x_n=max-min;
    num=1+x_d+(x_n-x_d)/2;
  }
  printf("%d\n",num);
  return 0;
}

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

int main() {
    while(1) {
        int H, W;
        cin >> H >> W;
        if (H == 0 && W == 0) {
            break;
        }

        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                cout << "#";
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3072
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using namespace std;

struct BoolName : numpunct<char> {
  string t, f;
  BoolName (string t = "Yes", string f = "No") : t(t), f(f) {}
  string do_truename() const {return t;}
  string do_falsename() const {return f;}
};

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
    cout.imbue(locale(cout.getloc(), new BoolName));
  }
} initializer;

template<typename T> istream& operator>>(istream &s, vector<T> &v) {
  for (T &t : v) s >> t;
  return s;
}

template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
  for (const T &t : v) s << t << endl;
  return s;
}

void set_bool_name(string t, string f) {
  cout.imbue(locale(cout.getloc(), new BoolName(t, f)));
}

int main() {
  int d;
  cin >> d;
  cout << "Christmas";
  for (int i = 25; i > d; --i) cout << " Eve";
  cout << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<queue>
using namespace std;
#include<stdio.h>
int main(void){
while(1){
pair<int,int> s,t,g;
queue<pair<int,int> > u;
int i,j,k,m[18][18]={0},x,y,n,b=0;
scanf("%d%d",&x,&y);
if(x==0&&y==0){
break;
}
g.first=x;
g.second=y;
s.first=1;
s.second=1;
for(i=0;i<=x+1;i++){
	for(j=0;j<=y+1;j++){
		if(j==0||j==y+1){
			m[i][j]=1;
		}
		else if(i==0||i==x+1){
			m[i][j]=1;
		}
	}
}
scanf("%d",&n);
for(k=0;k<n;k++){
	scanf("%d%d",&x,&y);
	m[x][y]=1;
}
u.push(s);
while(!u.empty()){
	t=u.front();
	if(m[t.first+1][t.second]!=1){
		t.first++;
		u.push(t);
		t.first--;
	}
	if(m[t.first][t.second+1]!=1){
		t.second++;
		u.push(t);
		t.second--;
	}
	if(u.front()==g){
		b++;
		u.pop();
	}
	else{
		u.pop();
	}
}
printf("%d\n",b);
}
return 0;
}

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

using namespace std;

const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
int modpow(int x,int y,int md=mod){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
multiset<int>S;
int n;
int a[100005];
bool pos=false,neg=false;
vector<pair<int,int> >ans;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		S.insert(a[i]);
		if(a[i]>=0)pos=true;
		if(a[i]<=0)neg=true;
	}
	if(pos&&neg){
		vector<int>v(next(S.begin()),prev(S.end()));
		int Pos=*S.rbegin(),Neg=*S.begin();
		for(auto x:v){
			if(x>=0){
				ans.push_back(make_pair(Neg,x));
				Neg-=x;
			}else{
				ans.push_back(make_pair(Pos,x));
				Pos-=x;
			}
		}
		ans.push_back(make_pair(Pos,Neg));
		cout<<Pos-Neg<<endl;
	}else{
		if(pos){
			int tmp=*S.begin();
			S.erase(S.begin());
			while(S.size()>1){
				ans.push_back(make_pair(tmp,*S.begin()));
				tmp-=*S.begin();
				S.erase(S.begin());
			}
			ans.push_back(make_pair(*S.begin(),tmp));
			tmp=*S.begin()-tmp;
			cout<<tmp<<endl;
		}else{
			int tmp=*S.rbegin();
			S.erase(S.find(tmp));
			while(S.size()){
				ans.push_back(make_pair(tmp,*S.begin()));
				tmp-=*S.begin();
				S.erase(S.begin());
			}
			cout<<tmp<<endl;
		}
	}
	for(auto p:ans){
		cout<<p.first<<" "<<p.second<<endl;
	}
	return 0;
}

Measured memory_bytes: 7916
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vt vector
#define pb push_back
#define pob pop_back
#define vi vt<int>
#define vvi vt<vi>
#define vii vt<ii>
#define vvii vt<vii>
typedef long long ll;
#define For(i,a,b) for(int i = a; i < b; i++)
#define foR(i,a,b) for(int i = a; i <= b; i++)
#define roF(i,a,b) for(int i = a - 1; i >= b; i--)
#define Rof(i,a,b) for(int i = a; i >= b; i--)
const int mod = 1000000007;
int Cib[1000001], Chiwb[1000001];

int binpow(int a, int b){
	if(b == 0){
		return 1;
	}
	int temp = binpow(a,b>>1);
	if((b&1) == 0){
		return temp*temp%mod;
	}else{
		return a*temp%mod*temp%mod;
	}
}

int modulo(int a){
	return binpow(a,1000000005);
}

signed main (){
	/*
	freopen(".inp","r",stdin);
	freopen(".out","w",stdout);
	*/
	int h, w, a, b, sum = 0;
	cin >> h >> w >> a >> b;
	Cib[1] = 1;
	foR(i,2,h-a){
		Cib[i] = Cib[i-1]*(i+b-2)%mod*modulo(i-1)%mod;
	}
	Chiwb[h] = 1;
	Rof(i,h-1,1){
		Chiwb[i] = Chiwb[i+1]*(w-b+h-i-1)%mod*modulo(h-i)%mod;
	}
	foR(i,1,h-a){
		sum = (sum + Cib[i]*Chiwb[i])%mod;
	}
	cout << sum;
}



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


int main() {
    int init = 100;
    ll money = init;
    ll x;
    cin >> x;

    ll ans = 1;
    while(true) {
        money = money*1.01;
        if (money >= x) {
            cout << ans << endl;
            return 0;
        }
        ans++;
    }

    return 0;
}



Measured memory_bytes: 3624
N = int(input())
if N % 2:
  print(0)
else:
  k = N // 10
  ans = k
  n = 50
  c = 2 
  while n <= N:
    ans += c*(N//n) - (c-1)*(N//n)
    n *= 5
    c += 1
  print(ans)


Measured memory_bytes: 38564
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>

int main(){

    int n, k, cont = 1, cont1 = 1, total;

    scanf("%d%d", &n, &k);

        for (int i = 0; i < n; i++) {
            cont *= 2;
            cont1 += k;
            if (cont <= cont1) {
                total = cont;
                cont1 = total;
            }else
                total = cont1;
                cont = total;
        }

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

    return 0;
}


Measured memory_bytes: 128
import math
N = int(input())
CSF = [list(map(int, input().split())) for _ in range(N - 1)]

ans = [0 for _ in range(N)]
for i in range(N - 1):
	for j in range(i, N - 1):
		if ans[i] < CSF[j][1]:
			ans[i] = CSF[j][1]
		else:
			ans[i] = CSF[j][1] + math.ceil((ans[i] - CSF[j][1]) / CSF[j][2]) * CSF[j][2]
		ans[i] += CSF[j][0]
ans[N - 1] = 0
[print(i) for i in ans]


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep
#define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for
#define rfor(i,a,b) for(int (i) = (b); (i) >= (a); --(i)) //Reversi for

int main()
{
    int x,a,b;
    cin >> x >> a >> b;
    if (abs(a-x) > abs(b-x)) {
        cout << "B" << endl;
    }else{
        cout << "A" << endl;
    }
}

Measured memory_bytes: 256
#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int a[5],b;
	for (int i = 0; i < 5;++i){
		scanf_s("%d", &a[i]);
	}
	for (int i = 0; i < 5; ++i) {
		for (int j = 4; j > i; --j) {
			if (a[j] > a[j - 1]) {
				b = a[j - 1]; a[j - 1] = a[j]; a[j] = b;
			}
		}
	}
	for (int i = 0; i < 5; ++i) {
		if (i != 0)printf(" ");
		printf("%d", a[i]);
	}
	printf("\n");
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
ll mod=1e9+7;

int main() {
  double a,b,x;
  cin >> a >> b >> x;
  double ans;
  if(x<=a*a*b/2.0) {
    ans=atan(a*b*b/2.0/x);
  }
  else {
    ans=atan((a*a*b-x)*2.0/(a*a*a));
  }
  ans=ans/M_PI*180;
  cout << fixed << setprecision(10) << ans << endl;
}

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

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = (a); i < (b); i++)
#define chmax(x, v) do { x = max(x, v); } while (0)
#define chmin(x, v) do { x = min(x, v); } while (0)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

using namespace std;
// {{{ Modint
// using mint = modint<1000000007>;
// mint x = 2;
// std::cout << x.a << std::endl;
template <std::int64_t M>
class modint {
  public:
    int64_t a;

    explicit constexpr modint(const int64_t x = 0) noexcept :
      a((x % M + M) % M) {}
    constexpr int64_t &value() noexcept { return a; }
    constexpr const int64_t &value() const noexcept { return a; }
    constexpr modint operator+(const modint rhs) const noexcept {
      return modint(*this) += rhs;
    }
    constexpr modint operator-(const modint rhs) const noexcept {
      return modint(*this) -= rhs;
    }
    constexpr modint operator*(const modint rhs) const noexcept {
      return modint(*this) *= rhs;
    }
    constexpr modint operator/(const modint rhs) const noexcept {
      return modint(*this) /= rhs;
    }
    constexpr modint &operator+=(const modint rhs) noexcept {
      a += rhs.a;
      if (a >= M) {
        a -= M;
      }
      return *this;
    }
    constexpr modint &operator-=(const modint rhs) noexcept {
      if (a < rhs.a) {
        a += M;
      }
      a -= rhs.a;
      return *this;
    }
    constexpr modint &operator*=(const modint rhs) noexcept {
      a = a * rhs.a % M;
      return *this;
    }
    constexpr modint &operator/=(modint rhs) noexcept {
      int64_t exp = M - 2;
      while (exp) {
        if (exp % 2) {
          *this *= rhs;
        }
        rhs *= rhs;
        exp /= 2;
      }
      return *this;
    }
    constexpr modint pow(ll t) const {
      if (!t) return modint(1);
      modint a = pow(t>>1);
      a *= a;
      if (t&1) a *= *this;
      return a;
    }
};
// }}}
using mint = modint<1000000007>;

ll N;
uint64_t popcnt(uint64_t n)
{
  uint64_t c = 0;
  c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555);
  c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333);
  c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f);
  c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff);
  c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff);
  c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff);
  return(c);
}

// dp[i][bit]: i番目の男性までの人がマッチ済みで、残りがbitの女性が残っているときのパターン数
mint dp[22][3000000];
ll a[30][30];

signed main() {
  cin >> N;
  ll ALL = (((ll)1) << N) - 1;
  rep(i,N)
    rep(j,N)
      cin >> a[i][j];

  rep(j, N) {
    if (a[0][j]) {
      dp[0][ ALL - (1 << j) ] = mint(1);
    } else {
      dp[0][ ALL - (1 << j) ] = mint(0);
    }
  }
  rep(i, N) rep(bit, 1 << N) {
    if (popcnt(bit) != N-1-i) continue;
    ll ni = i+1;
    if (ni >= N) continue;
    rep(j, N) {
      if ((bit & (1 << j)) == 0) continue;
      if (a[ni][j] == 0) continue;
      dp[ni][bit - (1 << j)] += dp[i][bit];
    }
  }
  cout << dp[N-1][0].value() << endl;
  return 0;
}


Measured memory_bytes: 332032