akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <climits>
#include <limits>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <unordered_map>
#include <random>
#define _USE_MATH_DEFINES
#include <cmath>
#include <complex>
#include <cfloat>

using namespace std;

#define INFD numeric_limits<double>::infinity()
#define INFL (int)1e8
#define INFLL (long long)1e15
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
#define bitmanip(m,val) static_cast<bitset<(int)m>>(val)
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

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


//solve x, y s.t. mx+ny=gcd(m,n)
class Extended_Euclid {
private:
  ll m, n;
  vvll mx_multiply(vvll mx1, vvll mx2) {
    vvll ret(mx1.size(), vll(mx2[0].size(), 0));
    Loop(i, mx1.size()) {
      Loop(j, mx1[0].size()) {
        Loop(k, mx2[0].size()) {
          ret[i][j] += mx1[i][k] * mx2[k][j];
        }
      }
    }
    return ret;
  }
public:
  ll x, y, gcd;
  Extended_Euclid(ll M, ll N) {
    m = M;
    n = N;
    vll r(100), k(100);
    bool swapflag = false, m_negflag = false, n_negflag = false;
    if (m < n) { swap(m, n); swapflag = true; }
    if (m < 0) { m *= -1; m_negflag = true; }
    if (n < 0) { n *= -1; n_negflag = true; }
    r[0] = m;
    r[1] = n;
    int h = 1;
    while (1) {
      k[h - 1] = r[h - 1] / r[h];
      r[h + 1] = r[h - 1] % r[h];
      if (r[h + 1] == 0) break;
      h++;
    }
    gcd = r[h];
    vvll mx1 = { { 0, 1 },{ 1, (-1) * k[h - 1] } };
    Loopr(i, h - 1) {
      vvll mx2 = { { 0, 1 },{ 1, (-1) * k[i] } };
      mx1 = mx_multiply(mx1, mx2);
    }
    x = mx1[0][0];
    y = mx1[0][1];
    if (n_negflag) { n *= -1; y *= -1; }
    if (m_negflag) { m *= -1; x *= -1; }
    if (swapflag) { swap(m, n); swap(x, y); }
  }
};


ll all_gcd(vll a) {
  ll ret = a[0];
  Loop1(i, a.size() - 1) {
    Extended_Euclid ee(ret, a[i]);
    ret = ee.gcd;
  }
  return ret;
}

bool solve(vll a, bool turn) {
  int even_cnt = 0;
  int odd_index = -1;
  Loop(i, a.size()) {
    if (a[i] % 2 == 0) even_cnt++;
    else odd_index = i;
  }
  if (even_cnt % 2 == 1) return turn;
  else {
    if (a.size() - even_cnt >= 2) return !turn;
    else if (a[odd_index] == 1) return !turn;
    // the unique hope
    else {
      a[odd_index]--;
      ll gcd = all_gcd(a);
      Loop(i, a.size()) {
        a[i] /= gcd;
      }
      return solve(a, !turn);
    }
  }
}

int main() {
  int n; cin >> n;
  vll a(n); Loop(i, n) cin >> a[i];
  bool ans = solve(a, 0);
  if (ans == 0) cout << "First" << endl;
  else cout << "Second" << endl;
}

Measured memory_bytes: 19824
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

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

const ll MOD = 1000000007; // 10^9 + 7

int compare(string a, string b) {
  int size_a = a.size();
  int size_b = b.size();

  if (size_a < size_b) return -1;
  else if (size_a > size_b) return 1;

  for (int i = 0; i < size_a; i++) {
    if (a[i] < b[i]) return -1;
    else if (a[i] > b[i]) return 1;
  }

  return 0;
}

void solve() {
  string a, b; cin >> a >> b;
  
  int c = compare(a, b);
  if (c == -1) outl("LESS");
  else if (c == 1) outl("GREATER");
  else outl("EQUAL");
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 888
import java.util.*;
import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) {
		long[] a = new long[5];
		int i;
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		for(i=0; i<5; i++) {
			a[i] = sc.nextLong();
		}
		sc.close();
		sc = null;
		long min = min(min(min(a[0],a[1]),min(a[2],a[3])),a[4]);
		if(min >= n) System.out.println(5);
		else if(n % min == 0) {
			System.out.println(n / min + 4);
		} else {
			System.out.println(n / min + 1 + 4);
		}
	}
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef vector<llong> V;

#define _ cin.tie(0);ios::sync_with_stdio(false);

int main(){ _;
  V a(3);
  REP(i,3) cin>>a[i];
  llong ans=0;
  VSORT(a);
  ans+=a[1]-a[0]+a[2]-a[1];
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
//Author ::  ABHINAV3010 ::

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define endl "\n"
#define all(x) (x).begin(), (x).end()
#define fast ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
typedef pair<ll,ll> p;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;
ll mod=1000000007;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll power(ll x, ll y, ll p=mod)
{ll res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1;x = (x*x) % p;}return res;}
void dfs(ll n, vector< vector<ll> >&adj,vector<ll>&ans,vector<bool>&visited,multiset<ll>&s,ll src,vector<ll>&v)
{
    visited[src]=true;
    ll prev=-1;
    if(s.empty())
    {
        s.insert(v[src]);
    }else
    {
        auto it=s.rbegin();
        if(v[src]>(*it))
        {
            s.insert(v[src]);
        }else
        {
            s.insert(v[src]);
            auto x=s.find(v[src]);
            x++;
            prev=*x;
            s.erase(x);
        }
    }
    ans[src]=s.size();
    for(auto y:adj[src])
    {
        if(visited[y]==false)
        {
            dfs(n,adj,ans,visited,s,y,v);
        }
    }
    s.erase(v[src]);
    if(prev!=-1)
    {
        s.insert(prev);
    }
}
int main()
{
fast;
ll n;
cin>>n;
vector<ll>v;
v.pb(0);
for(ll i=0;i<n;i++)
{
    ll a;
    cin>>a;
    v.pb(a);
}
vector< vector<ll> >adj(n+1);
for(ll i=0;i<n-1;i++)
{
    ll a,b;
    cin>>a>>b;
    adj[a].pb(b);
    adj[b].pb(a);
}
vector<ll>ans(n+1,-1);
multiset<ll>s;
vector<bool>visited(n+1,false);
dfs(n,adj,ans,visited,s,1,v);
for(ll i=1;i<=n;i++)
{
    cout<<ans[i]<<endl;
}

return 0;
}


Measured memory_bytes: 40336
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  
  vector<int> data(N);
  
  for(int i=0; i<N; i++){
    cin >> data.at(i);
  }
  
  int count=0, max=0, i=0;
  
  while(i<N){
    max=0;
    int temp=0;
    for(int j=0; j<N; j++){
      if(max<data.at(j)){
        temp=j;
        max=data.at(j);
      }
      else if(max == data.at(j)) data.at(j)=0;
    }
    if(max==0) break;
    data.at(temp)=0;
    count++;
    i++;
  }
  
  cout << count << endl;
}
      


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

int main(){
    string s;
    cin >> s;
    vector<char> S;
    for(int i=0;i<s.size();i++){
        S.push_back(s[i]);
    }
    for(int i=0;i<S.size();i++){
       int n_count = count(S.begin(),S.end(),S[i]); 
       if(n_count%2==1){
           cout << "No" << endl;
           return 0;
       }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair
#define endl '\n'
#define _ << ' '
#define min3(a, b, c) min(a, min(b, c))
#define min4(a, b, c, d) min(min(a, d), min(b, c))

using namespace std;
const ll mod = (ll)1e9+7;
const ll INF = (ll)1e9+1;

string str, in;
int n, m;

bool ok(int i)
{
    for(int j=0; j<m; j++)
    {
        if(str[i+j]=='?') continue;
        if(str[i+j]!=in[j]) return 0;
    }
    return 1;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef ONLINE_JUDGE
    //freopen("B.txt", "r", stdin);
    #endif
    cin >> str >> in;
    n = (int)str.length(); m = (int)in.length();
    for(int i=n-m; i>=0; i--)
    {
        if(ok(i))
        {
            for(int j=0; j<i; j++)
            {
                if(str[j]=='?') cout << 'a';
                else cout << str[j];
            }
            cout << in;
            for(int j=i+m; j<n; j++)
            {
                if(str[j]=='?') cout << 'a';
                else cout << str[j];
            }
            return 0;
        }
    }


    cout << "UNRESTORABLE";
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] rabbits = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			rabbits[i] = sc.nextInt();
		}
		int count = 0;
		for (int i = 1; i <= n; i++) {
			if (rabbits[rabbits[i]] == i)
				count++;
		}
		System.out.println(count / 2);
	}
}

Measured memory_bytes: 32396
A = []
a = [1]*9
for i in range(3):
    A += input().split()
n = int(input())
for i in range(n):
    b = input()
    if b in A:
        a[A.index(b)] = 0

for i in range(3):
    if a[3*i] + a[3*i+1] + a[3*i+2] == 0 or a[i] + a[i+3] + a[i+6] == 0:
        print('Yes')
        break
else:
    if a[0] + a[4] + a[8] == 0 or a[2] + a[4] + a[6] ==0:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 9220
n=int(input())
A=list(map(int,input().split()))
a,b=sum(A)-A[0],A[0]
cnt=abs(a-b)
for i in range(1,n-1):
    b +=A[i]
    a -=A[i]
    cnt=min(cnt,abs(a-b))
print(cnt)

Measured memory_bytes: 24832
#include <bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)(x.size()))
#define FOR(i,s,n) for (ll i = (s); (i) < (n); ++i)
#define FORD(i,s,l) for (ll i = (s); (i) >= l; --i)
#define F first
#define S second
#define TC int __tc; cin >> __tc; FOR(case_num,1,__tc+1)
#define TEST(x,i) ((x)&(1ll<<(i)))
#define SET(x,i) ((x)|(1ll<<(i)))
#define FLIP(x,i) ((x)^(1ll<<(i)))
#define CLEAR(x,i) ((x)&~(1ll<<(i)))

const double pi = 4 * atan(1);
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAXN = 200005;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n;
	cin >> n;
	ll d;
	cin >> d;
	d=d*d;
	
	int c = 0;
	FOR(i,0,n){
		ll x,y;
		cin >> x >> y;
		if (x*x+y*y <= d) {
			c++;
		}
	}
	cout << c << "\n";
}


Measured memory_bytes: 3688
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <climits>
#include <set>

#define DEBUG(x) cout << "> " << #x << ": " << x << "\n";

using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {

	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";

    return out;

}


int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	string s;
	cin >> s;
	int k;
	cin >> k;

	if (s[0] - '0' > 1) {
		cout << s[0] << "\n";
	} else {
		int i = 0;
		int last_one_pos = 0;
		while (s[i] - '0' == 1 && i < s.size()) {
			++last_one_pos;
			++i;
		}

		if (k <= last_one_pos) {
			cout << 1 << "\n";
		} else {
			cout << s[i] << "\n";
		}
	}

	return 0;

}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
const ll INF = (1ll << 60);

struct MaxFlow {
  struct Edge {
    ll s, t, capacity, flow;
    Edge(ll s, ll t, ll capacity) : s(s), t(t), capacity(capacity), flow(0) {}
  };

  struct ResidualEdge {
    bool reversed;
    Edge *edge;
    ResidualEdge() {}
    ResidualEdge(bool reversed, Edge *edge) : reversed(reversed), edge(edge) {}
  };

  ll N;
  vector<Edge *> edges;

  MaxFlow(ll N, vector<Edge> edges) : N(N) {
    this->edges.clear();
    for (Edge e : edges) {
      this->edges.push_back(new Edge(e.s, e.t, e.capacity));
    }
  }

  ~MaxFlow() {
    for (Edge *e : edges) {
      delete e;
    }
  }

  ll calculate(ll s, ll t) {
    ll current_flow = 0;

    while (true) {
      vector<vector<ResidualEdge>> G(N);

      for (Edge *e : edges) {
        if (e->flow < e->capacity) {
          G[e->s].emplace_back(false, e);
        }

        if (0 < e->flow) {
          G[e->t].emplace_back(true, e);
        }
      }

      vector<ll> dist(N, INF);
      vector<ll> prev(N);
      vector<ResidualEdge> trace(N);

      dist[s] = 0;
      queue<ll> q;
      q.push(s);

      while (q.size()) {
        ll fr = q.front();
        q.pop();
        for (ResidualEdge e : G[fr]) {
          ll to = e.reversed ? e.edge->s : e.edge->t;

          if (dist[to] > dist[fr] + 1) {
            dist[to] = dist[fr] + 1;
            prev[to] = fr;
            trace[to] = e;
            q.push(to);
          }
        }
      }

      if (dist[t] == INF) {
        return current_flow;
      }

      vector<ResidualEdge> traces;

      {
        ll i = t;
        while (i != s) {
          traces.push_back(trace[i]);
          i = prev[i];
        }
      }

      ll new_flow = INF;
      for (ResidualEdge e : traces) {
        if (e.reversed) {
          new_flow = min(new_flow, e.edge->flow);
        } else {
          new_flow = min(new_flow, e.edge->capacity - e.edge->flow);
        }
      }

      for (ResidualEdge e : traces) {
        if (e.reversed) {
          e.edge->flow -= new_flow;
        } else {
          e.edge->flow += new_flow;
        }
      }

      current_flow += new_flow;
    }
  }
};

int main() {
  ll N;
  cin >> N;
  vi a(N);
  for (ll i = 0; i < N; i++) {
    cin >> a[i];
  }
  vector<MaxFlow::Edge> edges;
  for (ll i = 1; i <= N; i++) {
    for (ll j = i; j <= N; j += i) {
      edges.emplace_back(i, j, INF);
    }
  }
  for (ll i = 1; i <= N; i++) {
    if (a[i - 1] < 0) {
      edges.emplace_back(0, i, -a[i - 1]);
    } else {
      edges.emplace_back(i, N + 1, a[i - 1]);
    }
  }

  MaxFlow maxFlow(N + 2, edges);
  ll f = maxFlow.calculate(0, N + 1);
  ll ans = 0;
  for (ll i = 0; i < N; i++) {
    if (a[i] > 0)
      ans += a[i];
  }
  cout << ans - f << endl;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
    map<string , int> mp;
    mp["SUN"]=7;
    mp["SAT"]=1;
    mp["FRI"]=2;
    mp["THU"]=3;
    mp["WED"]=4;
    mp["TUE"]=5;
    mp["MON"]=6;
    
    string s;
    cin>>s;
    cout<<mp[s]<<"\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MAX_N=100;
int N,K;
int X[MAX_N]; 
int main(){
	cin>>N>>K;
	for(int i=0;i<N;++i)cin>>X[i];
	int ans=0;
	for(int i=0;i<N;++i){
		int tmp=min(X[i],K-X[i]);
		ans+=tmp;
	}
	cout<<ans*2<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define gcd __gcd
#define in(a) scanf("%d",&a)
#define in2(a,b) scanf("%d%d",&a,&b)
#define in3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define read(v,i,n) for(i=0;i<n;i++)in(v[i])
#define twod(mat,i,j,n,m) rep(i,n){rep(j,m)in(mat[i][j]);}
#define sc(ch) scanf("%c",&ch)
#define sstr(str) scanf("%s",str)
#define pr(n) printf("%d ",n)
#define out(n) printf("%d\n",n)
#define llin(a) cin >> a
#define llpr(a) cout << a << " "
#define llout(a) cout << a << endl
#define yes printf("YES\n")
#define no printf("NO\n")
#define lin printf("\n")
#define dbg(v,i,n) for(i=0;i<n;i++)pr(v[i]); lin
#define ck printf("continue\n")
#define all(vec) vec.begin(),vec.end()
#define asc(vec) sort(vec.begin(),vec.end())
#define lower(v,k) lower_bound(v.begin(),v.end(),k)-v.begin()
#define upper(v,k) upper_bound(v.begin(),v.end(),k)-v.begin()
#define tf(mytuple) get<0>(mytuple)
#define ts(mytuple) get<1>(mytuple)
#define tt(mytuple) get<2>(mytuple)
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define viii vector<pair<pair<int,int>,int> >
#define vvii vector<vector<pair<int,int> > >
#define lp(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define M 1000000007
#define N 200005  //check the limits, man
// read the constraint properly (ll vs int)
typedef long long int ll;
ll const H = 1e15;
ll sum[N];
vvii ad(N);
ll ar[4*N],lazy[4*N];
int lft(int p)
{
    return 2*p;
}
int rht(int p)
{
    return 2*p+1;
}
void process(int l,int h,int p)
{
    if(lazy[p]!=0)
    {
        ar[p]+=lazy[p];
        if(l!=h)
            lazy[lft(p)]+=lazy[p],lazy[rht(p)]+=lazy[p];
        lazy[p]=0;
    }
    return ;
}
void update(int a,int b,ll x,int l,int h,int p)
{
    if(a>h || b<l)
        return ;
    if(a<=l && b>=h)
    {
        lazy[p]+=x;
        return ;
    }
    process(l,h,p);
    int m=(l+h)>>1;
    update(a,b,x,l,m,lft(p));
    update(a,b,x,m+1,h,rht(p));
    ar[p]=max(ar[lft(p)]+lazy[lft(p)],ar[rht(p)]+lazy[rht(p)]);
    return ;
}
ll query(int a,int b,int l,int h,int p)
{
    if(a>h || b<l)
        return -H;
    if(a<=l && b>=h)
        return ar[p]+lazy[p];
    process(l,h,p);
    int m=(l+h)>>1;
    return max(query(a,b,l,m,lft(p)),query(a,b,m+1,h,rht(p)));
}
int main()
{
    int n,m,l,r,a,i,j;
    in2(n,m);
    while(m--)
    {
        in3(l,r,a);
        sum[l]+=a;
        ad[r].pb({l,-a});
    }
    ll ans=0;
    ll x;
    for(i=1;i<=n;i++)
    {
        update(0,i-1,sum[i],0,n,1);
        x=query(0,i-1,0,n,1);
        ans=max(ans,x);
        update(i,i,x,0,n,1);
        m=ad[i].size();
        rep(j,m)
            update(0,ad[i][j].F-1,ad[i][j].S,0,n,1);
    }
    llout(ans);
}


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

int main () {
    string s, t; cin >> s >> t;
    map<char, int> r, r_;
    for (char c = 'a'; c <= 'z'; c++) {
        r[c] = -1;
        r_[c] = -1;
    }
    
    for (int i = 0; i < s.size(); i++) {
        r[s[i]]++;
        r_[t[i]]++;
    }
    bool can = true;
    for (int i = 0; i < s.size(); i++) {
        if (r[s[i]] >= 0) {
            if (r[s[i]] != r_[t[i]]) can = false;
        } 
        if (r_[t[i]] >= 0) {
            if (r[s[i]] != r_[t[i]]) can = false;
        } 
        if (r[s[i]] < 0) {
            r_[t[i]] = r[s[i]];
        } 
        if (r[t[i]] < 0) {
            r[s[i]] = r_[t[i]];
        }
    }
    if (can) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 776
//bismillahir rahmanir rahim            //Author:Fayed Anik

#include <bits/stdc++.h> 

using namespace std;


#define         ll                         long  long
#define         lf                         double 
#define         pb(x)                      push_back(x)
#define         ull                        unsigned long long
#define         sfl(a)                     scanf("%lld",&a)
#define         sf(a)                      scanf("%d",&a)
#define         pf(a)                      printf("%d\n",a)
#define         pfl(a)                     printf("%lld\n",a)
#define         pdl(a)                     printf("%llf\n",a)
#define         FOR(x,n)                   for(ll x=1;x<=n;++x)
#define         vii                        vector< ll > v
#define         pi                         3.14159265359
#define         mex                        10000000
#define         pii                        pair< ll , ll >
#define         mem(m,a)                   memset( m, a,sizeof m)
#define         mp(a,b)                    make_pair(a,b)
#define         maxn                       100000
#define         mod                        1000000007
#define         INF                        1e17
#define         f1                         first
#define         f2                         second
#define         all(v)                     v.begin(),v.end()
#define         PI                         acos(-1)
#define         printminusone              printf("-1\n")
#define         bug                        printf("bug")

int main(){
	ll H,W,h,w;
	cin>>H>>W>>h>>w;
	ll ans=H*W;
	ans-= h*W;
	ans-=(H-h)*w;
	pfl(ans);
}



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;
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define pf push_front
#define PI acos(-1)
#define EPS 1e-5
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define forn(i, n) for(ll i=0;i<(ll)n;i++)
#define fi first
#define se second
 

int main() {
	int h, n;
	cin >> h >> n;
	ll sum = 0;
	forn(i, n) {
		int x;
		cin >> x;
		sum += x;
	}
	if(h > sum) cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}



Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
#define ft first
#define sd second
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;
typedef pair<long long,long long> pll;

const int MAX=100005;
const int oo=1000000009;
int dp[MAX];

int main() {
    #ifndef LOCAL
    fastIO;
    #endif
    int n,k;
    memset(dp,-1,sizeof(dp));
    cin >> n >> k;
    int alturas[n];
    for(int i=0;i<n;i++){
        cin >> alturas[i];
    }
    dp[0]=0;
    for(int i=1;i<n;i++){
        dp[i]=oo;
        for(int j=1;j<=k;j++){
            if(i-j>-1) dp[i]=min(dp[i],dp[i-j]+abs(alturas[i]-alturas[i-j]));
        }
    }
    cout << dp[n-1] << endl;
    return 0;
}



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

int main() {

    int N;
    cin >> N;

    switch (N % 10) {
        case 2:
        case 4:
        case 5:
        case 7:
        case 9:
            cout << "hon";
            break;
        case 0:
        case 1:
        case 6:
        case 8:
            cout << "pon";
            break;
        case 3:
            cout << "bon";
            break;
    }
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=12e4;

int p;
int s[20];

int main(){
	ios::sync_with_stdio(0);
	int n,m;
	cin>>n>>m;
	for(int i=0,k;i<m;i++){
		cin>>k;
		for(int j=0,w;j<k;j++){
			cin>>w;
			s[w-1]|=(1<<i);
		}
	}
	for(int i=0,w;i<m;i++){
		cin>>w;
		p|=(w<<i);
	}
	int ans=0;
	for(int i=0;i<(1<<n);i++){
		int b=0;
		for(int j=0;j<n;j++)
			if(i>>j&1)b^=s[j];
		if(b==p)ans++;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
cnt = 0
conseq = 1
for i in range(n-1):
    if a[i+1] == a[i]:
        conseq += 1
    else:
        cnt += conseq // 2
        conseq = 1
cnt += conseq // 2
print(cnt)

Measured memory_bytes: 3060
s = [int(x) for x in list(input())]
cand = []
for c1, c2, c3 in zip(s, s[1:], s[2:]):
  res = abs(c1 * 100 + c2 * 10 + c3 - 753)
  cand.append(res)
print(min(cand))
  


Measured memory_bytes: 2940
from collections import Counter

n = int(input())

s = [input() for i in range(n)]
m = Counter(s)

maxl = 0
ans = []
for i in m.most_common():
    maxl = max(maxl, i[1])
    if maxl == i[1]:
        ans.append(i[0])

ans.sort()
for i in ans:
    print(i)


Measured memory_bytes: 45040
N = int(input())
xyh = []
for i in range(N):
    xyh.append([int(i) for i in input().split()])

#サンプルを用意
for x,y,h in xyh:
    if h!=0:
        xs,ys,hs=x,y,h


for cx in range(100+1):
    for cy in range(100+1):
        guessed_H = hs+abs(xs-cx)+abs(ys-cy)
        if all([max(0,guessed_H-abs(cx-x)-abs(cy-y))==h for x,y,h in xyh]):
            print(cx,cy,guessed_H)

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

ll N, K;

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

    std::cin >> N >> K;

    ll cnt = 0;

    if(K == 0){
        cnt = N * N;
    }else{
        for(ll b=K+1;b<=N;++b){
            cnt += (b - K) * (N / b);

            if(N % b >= K){
                cnt += N % b - K + 1;
            }
        }
    }

    std::cout << cnt << std::endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
struct S{
	int x,y,r;
};
int main(){
	int m,n,t,u,ans,INF=1<<30;
	while(cin>>n>>m,n){
		int d[n][10],cost[n][10][m+1],x[n][10];
		rep(i,n){
			rep(j,10){
				d[i][j]=x[i][j]=0;
				rep(k,m+1)cost[i][j][k]=INF;
			}
			cin>>t; rep(j,t)cin>>x[i][j],cin>>d[i][j];
		}
		queue<S> F; S s; ans=INF;
		rep(i,10)rep(j,(m?2:1))if(d[j][i]){
			s.x=i,s.y=j,s.r=m-j;
			F.push(s),cost[j][i][m-j]=0;
		}
		while(!F.empty()){
			S cs=F.front(); F.pop();
			rep(j,(cs.r?2:1)){
				if(cs.y+j+1<n)rep(i,10)if(d[cs.y+j+1][i]){
					s=cs; s.y=cs.y+j+1,s.x=i,s.r-=j;
					u=x[s.y][i]-x[cs.y][cs.x];
					t=cost[cs.y][cs.x][cs.r]+(d[cs.y][cs.x]+d[s.y][i])*(u>0?u:-u);
					if(cost[s.y][i][s.r]>t)cost[s.y][i][s.r]=t,F.push(s);
				}
				if(cs.y+j+1>=n&&ans>cost[cs.y][cs.x][cs.r])ans=cost[cs.y][cs.x][cs.r];
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1412
/**
*    author:  souzai32
*    created: 21.08.2020 00:48:22
**/

#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
typedef long long ll;
using namespace std;

int main() {

    int h,w;
    cin >> h >> w;
    vector<vector<char>> a(h,vector<char>(w));
    vector<vector<bool>> t(h,vector<bool>(w));
    vector<vector<int>> d(h,vector<int>(w));
    queue<tuple<int,int,int>> que;
    rep(i,h){
        rep(j,w){
            cin >> a[i][j];
            if(a[i][j]=='#'){
                que.push(tuple<int,int,int>(i,j,-1));
                t[i][j]=true;
            }
        }
    }

    tuple<int,int,int> p;
    int i=0;
    while(!que.empty()){
        p=que.front();
        que.pop();
        int x=get<0>(p),y=get<1>(p),z=get<2>(p)+1;
        d[x][y]=z;
        if(x-1>=0){
            if(!t[x-1][y]){
                que.push(tuple<int,int,int>(x-1,y,z));
                t[x-1][y]=true;
            }
        }if(x+1<h){
            if(!t[x+1][y]){
                que.push(tuple<int,int,int>(x+1,y,z));
                t[x+1][y]=true;
            }
        }if(y-1>=0){
            if(!t[x][y-1]){
                que.push(tuple<int,int,int>(x,y-1,z));
                t[x][y-1]=true;
            }
        }if(y+1<w){
            if(!t[x][y+1]){
                que.push(tuple<int,int,int>(x,y+1,z));
                t[x][y+1]=true;
            }
        }
        i++;
        if(i==1e8) break;
    }

    // cout << endl;
    // rep(i,h){
    //     rep(j,w) cout << d[i][j];
    //     cout << endl;
    // }
    int ans=0;
    rep(i,h){
        rep(j,w) ans=max(ans,d[i][j]);
    }
    cout << ans << endl;

    return 0;
}

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

int memo[50];

int fib(int n){
	  if(memo[n] != -1)
			return memo[n];
	  
	  if(n==0 or n==1){
			memo[n] = 1;
			return 1;
	  }
	  int ans = fib(n-1) + fib(n-2);
	  memo[n] = ans;
	  return ans;
}

int main (){

	  int n;
	  cin >> n;
	  memset(memo,-1,sizeof(memo));
	  cout << fib(n) << endl;

}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

const int mod = 1000000007;

struct mint{
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){};
    mint operator-() const{
        return mint(-x);
    }
    mint& operator+=(const mint a){
        if((x+=a.x) >= mod) x -= mod;
        return *this;
    } 
    mint& operator-=(const mint a){
        if((x+= mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const{
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const{
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const{
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const{
        if(!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if(1&t) a *= *this;
        return a;
    }

    mint inv() const{
        return pow(mod-2);
    }
    mint& operator/=(const mint a){
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const{
        mint res(*this);
        return res /= a;
    }
};

struct combination{
    vector<mint> fact, ifact;
    combination(int n):fact(n+1), ifact(n+1){
        assert(n < mod);
        fact[0] = 1;
        for(int i=1; i<=n; i++) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for(int i=n; i>=1; i--) ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k){
        if(k<0 || k>n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

int main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    ll ans = 0;
    rep(i, 60){
        ll x=0;
        rep(j, n){
            if((a[j]>>i)&1) x++;
        }
        ll tmp = x*(n-x)%mod;
        rep(j, i){
            tmp = tmp*2%mod;
        }
        ans += tmp;
        ans %= mod;
    }

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

Measured memory_bytes: 2560
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
int main(){
	int w, h;
	cin >> w >> h;
	string s;
	cin >> s;
	REP(i, h) {
		REP(q, w) {
			if (i == 0||i == h-1) {
				if (q == 0 || q == w - 1) {
					cout << "+";
					continue;
				}
			}
			if (i == 0 || i == h - 1) {
				cout << "-";
			}
			else if (q == 0 || q == w - 1) {
				cout << "|";
			}
			else {
				if (i == h / 2 && q == w / 2) {
					cout << s;
				}
				else {
					cout << ".";
				}
			}
		}
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3160
n = int(input())
w = [int(i) for i in input().split()]

ans = 5050
s1 = 0 
s2 = 0
for t in range(1,n):
	for i in range(0,t):
		s1 += w[i]
	for j in range(t,n):
		s2 += w[j]
	if ans > abs(s1 -s2):
		ans = abs(s1 - s2)
	s1, s2 = 0, 0
print(ans)

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

using namespace std;

long long addition(const string& numbers, const int& positionOfPlus);

int main() {
    string numbers;
    cin >> numbers;
    
    long long answer = 0;
    for (int bit = 0; bit < (1 << (numbers.size() - 1)); ++bit) {
        answer += addition(numbers, bit);
    }
    cout << answer << endl;       
}

long long addition(const string& numbers, const int& positionOfPlus) {
    long long sum = 0;
    long long term = 0;
    for (size_t i = 0; i < numbers.size(); ++i) {
        term *= 10;
        term += numbers.at(i) - '0';
        if (positionOfPlus & (1 << i) || i == numbers.size() - 1) {
            sum += term;
            term = 0;
        }
    }
    return sum;
}

Measured memory_bytes: 3628
//...بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ...
// Rafid

#include <iostream>
#include <set>
using namespace std;
int main(){
    int n;
    cin>>n;
    if(n==3||n==5||n==7){cout<<"YES";}
    else{cout<<"NO";}
}


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

using namespace std;

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

    int N; cin>>N;
    long ga,sa,ba,gb,sb,bb; cin>>ga>>sa>>ba>>gb>>sb>>bb;
    struct Stat {
        long f, t;
    };
    Stat stats[3] = {
            Stat{min(ga,gb), max(ga,gb)},
            Stat{min(sa,sb), max(sa,sb)},
            Stat{min(ba,bb), max(ba,bb)},
    };
    bool st[3] = {ga <= gb, sa <= sb, ba <= bb};

    long NN = 0;
    for (int i = N/stats[0].f; i >= 0; i--) {
        if (!st[0])
            i = 0;
        auto nn = N - stats[0].f*i;
        long ss = stats[0].t*i;
        for (int j = nn/stats[1].f; j >= 0; j--) {
            if (!st[1])
                j = 0;
            auto nnn = nn - stats[1].f*j;
            auto k = nnn/stats[2].f;
            if (!st[2])
                k = 0;
            long score = ss + stats[1].t*j + stats[2].t*k + nnn-stats[2].f*k;
            NN = max(NN, score);
        }
    }
    long ans = 0;
    for (int i = NN/stats[0].f; i >= 0; i--) {
        if (st[0])
            i = 0;
        auto nn = NN - stats[0].f*i;
        long ss = stats[0].t*i;
        for (int j = nn/stats[1].f; j >= 0; j--) {
            if (st[1])
                j = 0;
            auto nnn = nn - stats[1].f*j;
            auto k = nnn/stats[2].f;
            if (st[2])
                k = 0;
            long score = ss + stats[1].t*j + stats[2].t*k + nnn-stats[2].f*k;
            ans = max(ans, score);
            if (st[2])
                j = 0;
        }
    }
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 256
All = [[[0 for x in range(10)] for y in range(3)] for z in range(4)]

N = int(input())

i = 0
while i < N:
	b, f, r, v = map(int,input().split())
	All[b-1][f-1][r-1] += v
	i += 1

for x in range(4):
	for y in range(3):
		for z in range(10):
			print(" {}".format(All[x][y][z]), end = "")
			if z == 9:
				print("")
	if x != 3 and y == 2:
		for j in range(20):
			print("#", end = "")
		print("")

Measured memory_bytes: 7652
#include<set>
    #include<map>
    #include<cmath>
    #include<queue>
    #include<bitset>
    #include<string>
    #include<cstdio>
    #include<cctype>
    #include<cassert>
    #include<cstdlib>
    #include<cstring>
    #include<sstream>
    #include<iostream>
    #include<algorithm>
     
    #define For(i,x,y) for (int i=x;i<y;i++)
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define lf else if
     
    #define dprintf(...) fprintf(stderr,__VA_ARGS__)
    using namespace std;
     
    typedef long long ll;
    typedef double db;
    typedef pair<int,int> pii;
    typedef vector<int> Vi;
     
    int IN(){
    	int c,f,x;
    	while (!isdigit(c=getchar())&&c!='-');c=='-'?(f=1,x=0):(f=0,x=c-'0');
    	while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return !f?x:-x;
    }
     
    const int N=200000+19;
    const db pi=acos(-1.0);
     
    vector<pii> V;
    int x[N],y[N];
    int X1,Y1,X2,Y2,n,tmp;
    db ans;
     
    int cal(){
    	static int stk[N],top;
    	For(i,0,V.size()){
    		int pos=lower_bound(stk+1,stk+top+1,V[i].se)-stk;
    		stk[pos]=V[i].se;
    		if (pos==top+1) top++;
    	}
    	return top;
    }
     
    int main(){
    	X1=IN(),Y1=IN(),X2=IN(),Y2=IN();
    	n=IN();
    	For(i,1,n+1) x[i]=IN(),y[i]=IN();
    	if (X1>X2) swap(X1,X2),swap(Y1,Y2);
    	if (Y1>Y2){
    		Y1*=-1;Y2*=-1;
    		For(i,1,n+1) y[i]*=-1;
    	}
    	For(i,1,n+1)
    		if (X1<=x[i]&&x[i]<=X2&&Y1<=y[i]&&y[i]<=Y2){
    			V.pb(mp(x[i],y[i]));
    		}
    	sort(V.begin(),V.end());
    	tmp=cal();
    	ans=100ll*(abs(X1-X2)+abs(Y1-Y2));
    	ans+=tmp*(5*pi-20);
    	if (tmp==abs(X2-X1)+1||tmp==abs(Y2-Y1)+1) ans+=5*pi;
    	printf("%.20lf\n",ans);
    }

Measured memory_bytes: 4336
n, k = map(int, input().split())
s = list(str(input()))

L = []
cur = s[0]
cnt = 0
for i in range(n):
    if s[i] == cur:
        cnt += 1
    else:
        L.append((cnt, int(cur)))
        cnt = 1
        cur = s[i]
else:
    L.append((cnt, int(cur)))

#print(L)

t = 0
S = 0
C = 0
ans = 0
for s in range(len(L)):
    while C <= k and t < len(L):
        if C == k and L[t][1] == 0:
            break
        S += L[t][0]
        if L[t][1] == 0:
            C += 1
        t += 1
    #print(S, C)
    ans = max(ans, S)
    if s == t:
        t += 1
    else:
        S -= L[s][0]
        if L[s][1] == 0:
            C -= 1
print(ans)

Measured memory_bytes: 51336
N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7


def pow(x, t):
    if t == 0:
        return 1
    a = pow(x, t >> 1)
    return a * a * (x ** (t & 1)) % MOD


fact = [0] * N
fact[0] = 1
for i in range(1, N):
    fact[i] = fact[i - 1] * i
    fact[i] %= MOD
ifact = [0] * N
ifact[N - 1] = pow(fact[N - 1], MOD - 2)
for i in range(N - 1, 0, -1):
    ifact[i - 1] = ifact[i] * i
    ifact[i - 1] %= MOD


def nCr(n, r):
    if r < 0 or r > n:
        return 0
    return fact[n] * ifact[r] * ifact[n - r] % MOD


A.sort()
ans = 0
for i in range(K, N + 1):
    C = nCr(i - 1, K - 1)
    ans += A[i - 1] * C
    ans -= A[N - i] * C
    ans %= MOD
print(ans)


Measured memory_bytes: 15568
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iomanip>


#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;


// <<fixed<<setprecision(6)<<


int gcd(lint x, lint y){
  return y==0 ? x:gcd(y,x % y);
}


int combi(int n, int r){
  int num = 1;
  for(int i = 1; i <= r; i++){
    num = num * (n - i + 1) / i;
  }
  return num;
}


int main(){
  int a,b;
  cin>>a>>b;
  if(a>=b){
    cout<<'1'<<endl;
  }
  else{
    int count=1;
    for(int i=a;i<b;i+=a){
      count++;
    }
    cout<<count<<endl;
  }
}


Measured memory_bytes: 3092
//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

typedef long long ll ;
typedef double db;
typedef unsigned long long ull ;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define for0(i,n)          for(int i=0;i<n;i++)
#define for1(i,n)          for(int i=1;i<=n;i++)
#define forab(a,b)       for(int i=a;i<=b;i++)
//#define gcd(a, b)     __gcd(a, b)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)     cout<<"Case "<<z<<": "<<x<<"\n"
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)

using namespace std;

int main()
{
	string s;
	cin>>s;
	if(s== "ABC") cout<<"ARC";
	else cout<<"ABC";
	cout<<nw;
	return 0;
}

Measured memory_bytes: 3544
from collections import deque
n=int(input())
Deq=deque()
for i in range(n):
    command=input().split()
    if len(command)>1:
        x=command[1]
    if command[0]=="insert":
        Deq.appendleft(x)

    elif command[0]=="delete":
        try:
            Deq.remove(x)
        except:
            pass

    elif command[0]=="deleteFirst":
        Deq.popleft()


    elif command[0]=="deleteLast":
        Deq.pop()
print(*Deq)



Measured memory_bytes: 69732
function solve()
    n, m, x = [parse(Int, x) for x in split(readline())]
    c = zeros(Int, n)
    a = zeros(Int, n, m)
    for i=1:n
        l = [parse(Int, x) for x in split(readline())]
        c[i] = l[1]
        a[i, :] = l[2:end]
    end

    min_p = sum(c) + 1
    for v=0:2^n-1
        p = 0
        r = zeros(Int, m)
        for i=0:n-1
            if v & (1 << i) != 0
                p += c[i+1]
                r += a[i+1, :]
            end
        end
        if minimum(r) >= x
            min_p = min(min_p, p)
        end
    end
    min_p > sum(c) ? -1 : min_p
end

println(solve())


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

typedef long long ll;
ll mod = 1000000000 + 7;

ll modpow(ll a, ll n, ll mod){
  ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

ll nCr(ll n, ll r, ll mod){
  ll res = n;
  for(int i = 2; i <= r; i++){
    res = res * (n + 1 - i) % mod;
    res = res * modpow(i, mod -2, mod) % mod;
  }
  return res;
}

int main(){
  ll n,a,b;
  cin >> n >> a >> b;

  ll ans = modpow(2, n, mod) - nCr(n, a, mod) - nCr(n,b,mod) - 1;
  ans = ans + mod + mod + mod;
  ans = ans % mod;
  cout << ans << endl;
}

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

typedef long long ll;
using namespace std;

int main() {
    int A, B, K;
    cin >> A >> B >> K;
    for (int i = 100;; i--) {
        if (A % i == 0 && B % i == 0) {
            K--;
            if (K == 0) {
                cout << i << endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <bitset>
#include <queue>

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

void solve() {
    ll x;
    cin >> x;
    ll num = 100;
    int year = 0;
    while(true) {
        num += num*0.01;
        year++;
        if(num >= x) {
            break;
        }
    }
    cout << year;
}

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

Measured memory_bytes: 3164
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int n,k;
ll a[100010];
ll dp[110][100010];
ll suma[110][100010];
ll modul = 1000000007;

int main()
{
	ios::sync_with_stdio(false);	
	cin.tie(0);
	
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	
	for(int i=1;i<=n;i++)
		dp[i][0]=suma[i][0]=1;
	for(int j=1;j<=k;j++)
	{
		if(j<=a[1])
			dp[1][j]=1;
		else
			dp[1][j]=0;
		suma[1][j]=suma[1][j-1]+dp[1][j];
	}
	for(int i=2;i<=n;i++)
		for(int j=1;j<=k;j++)
			dp[i][j]=(suma[i-1][j]-(j>a[i]?suma[i-1][j-a[i]-1]:0))%modul, suma[i][j]=(suma[i][j-1]+dp[i][j])%modul;
	
	/*for(int i=1;i<=n;i++)
	{
		for(int j=0;j<=k;j++)
			cout<<dp[i][j];
		cout<<endl;
	}*/
	if(dp[n][k]<0)
		dp[n][k]+=modul;	
	cout<<dp[n][k];
	return 0;
}


Measured memory_bytes: 161280
import java.util.*;
import java.lang.*;
  
public class Main{
  public static void main(String[] args){
    Scanner stdIn=new Scanner(System.in);
    int i=0,x=stdIn.nextInt();
    while(x!=0){
	i++;
	System.out.println("Case "+i+": "+x);
	x=stdIn.nextInt();
    }
  }
}



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

int main() {
    int n;
    cin >> n;
    vector<int> num(n);
    for(int i=0; i<n; i++){
        cin >> num[i];
    }
    for(int i=n-1; i>=0; i--){
        cout << num[i];
        if(i != 0){
            cout << " ";
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 1196
n=int(input())
a=list(map(int,input().split()))

x=[]
ans=0
for i in a:
    if i%2==0 :
        x.append(i)
y=[]
for j in x:
    if j%3==0 or j%5==0:
        y.append(j)

if len(x)==len(y):
    print("APPROVED")
else:
    print("DENIED")


Measured memory_bytes: 9176
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long
int C[200010];
int ans[200010];
int previ[200010];
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    rep(i, N) cin >> C[i];
    ans[0] = 1;
    rep(i, 200010) previ[i] = -1;
    rep(i, N) {
        if(i != 0 && (previ[C[i]] == -1 || C[i] == C[i - 1])) {
            ans[i] = ans[i - 1];
        } else if (i != 0) {
            ans[i] = (ans[i - 1] + ans[max(0LL, previ[C[i]])]) % mod;
        }
        previ[C[i]] = i;
    }
    cout << ans[N - 1] << endl;


    return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
#include <string.h>
#include <cstring>

using namespace std;

int main(){
    
    char s[100];
    cin >> s;
    int ans;
    ans = strlen(s);
    for(int i=0;i<ans;i++){
        cout << "x" ;
    }
    return 0;
}

Measured memory_bytes: 256