akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define MOD 1000000007
#define INF 9223372036854775807

signed main()
{
int x=0,y=0,z=0,w=0,n=0,m=0;
string s;
std::cin >> s;
std::vector<int> v(26);
rep(i,s.size()){
  v[s[i]-'a']++;
}
rep(i,v.size()){
  if(v[i]%2!=0){
    std::cout << "No" << '\n';
    return 0;
  }
}
std::cout << "Yes" << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}

signed main()
{
  int N, M, Q;
  cin >> N >> M >> Q;
  vector<vector<int>> C(N, vector<int>(N, 0));
  for (int i = 0; i < M; i++)
  {
    int L, R;
    cin >> L >> R;
    C.at(L - 1).at(R - 1)++;
  }
  
  for (int i = 1; i < N; i++)
  {
    for (int j = 0; j < N - i; j++)
    {
      C.at(j).at(j + i) += C.at(j).at(j + i - 1) + C.at(j + 1).at(j + i) - C.at(j + 1).at(j + i - 1);
    }
  }
  
  for (int i = 0; i < Q; i++)
  {
    int p, q;
    cin >> p >> q;
    cout << C.at(p - 1).at(q - 1) << endl;
  }
  
}

Measured memory_bytes: 2944
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++) cin >> a[i];
  sort(a,a+n);int d=-1,ans=-1,cnt=0,c=0;
  bool flag=false;
    for(int j=0;j<n;j++){
      if(d==a[j]) continue;
      if(d!=a[j]) {
        d=a[j]; cnt=0;
      }
      for(int i=c;i<n;i++){
        if(d-1==a[i]||d==a[i]||d+1==a[i]) {
          cnt++;
          if(flag==false&&d-1==a[i]){
            flag=true;c=i;
          }
        }
        if(a[i]>d+1) break;
      }
      flag=false;
      ans=max(ans,cnt);
    }
    cout <<ans <<endl;
  }


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

const string YES = "Yes";
const string NO = "No";

void solve(std::string S){
    if(S == "AAA" || S == "BBB") {
        cout << NO << endl;
    }else {
        cout << YES << endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


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

using namespace std;

int main()
{
	string odd, even;
	cin >> odd;
	cin >> even;
	int i;
	int size = even.length();

	for (i=0;i<odd.length();i++)
	{
		cout << odd[i];
		if (i+1<=size)
			cout << even[i];
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define get(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
const ll mod = 1e18;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
void solve() {
	int x;
	cin >> x;
	for (int i = 1; i <= 360; i++) {
		if ((x*i) % 360 == 0) {
			cout << i << endl;
			return;
		}
	}
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int T_ = 1;
	//cin >> T_;
	for (int i = 0; i < T_; i++)solve();
	return 0;
}







Measured memory_bytes: 3648
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <typeinfo>
#include <tuple>
using namespace std;

#define MOD 1000000007
#define INF 1e9+7
#define INF_LONG 1e18
#define rep(i, n) for(int i=0; i<n; ++i)
#define rep1(i, n) for(int i=1; i<=n; ++i)
#define rrep(i, m, n) for(int i=m; i<n; ++i)
#define countof(array) (sizeof(array) / sizeof(array[0]))
typedef long long ll;

#define MAX_N 200000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
#define MAX_Q 100000

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

int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};

string as = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string ab = {"abcdefghijklmnopqrstuvwxyz"};

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

ll lcm(ll x, ll y) {
  return (x*y)/gcd(x, y);
}

void yes() {
  cout << "Yes" << endl;
}

void no() {
  cout << "No" << endl;
}

void print_array(int array[], int len) {

  for(int i=0; i<len; ++i) {
    cout << array[i] << endl;
  }

}

ll absolute(ll x) {
  return (x<0)? (-1)*x : x;
}

//g++ AtCoder.cpp -o AtCoder
//AtCoder

//--------------------------
int main() {

  int n, r;
  cin >> n >> r;

  if(n>=10) cout << r << endl;
  else cout << r + 100*(10-n) << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int N=2e5+10;
const int mod=0;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
int n,k,a[N],b[N],l[N],r[N],st[N],top=0;
ll s[N],f[N];
int tr[N<<2],tag[N<<2];
#define ls (o<<1)
#define rs (o<<1|1)
void modify(int o,int v) {
    tr[o]=tag[o]=v;
}
void down(int o) {
    if(!tag[o]) return;
    modify(ls,tag[o]);modify(rs,tag[o]);tag[o]=0;
}
void update(int o,int l,int r,int L,int R,int v) {
    if(L>R) return;
    if(L<=l&&r<=R) return modify(o,v);
    down(o);
    int mid=(l+r)>>1;
    if(L<=mid) update(ls,l,mid,L,R,v);
    if(R>mid) update(rs,mid+1,r,L,R,v);
}
int query(int o,int l,int r,int p) {
    if(l==r) return tr[o];
    down(o);
    int mid=(l+r)>>1;
    if(p<=mid) return query(ls,l,mid,p);
    return query(rs,mid+1,r,p);
}
ll query(int x) {
    int p=query(1,1,top,x);
    if(!p) return 0;
    return f[p]+(st[l[p]]-st[x]+k)%k;
}
int main() {
    cin>>n>>k;
    for(int i=1;i<=n;i++) {
        a[i]=gi();b[i]=gi();s[i]=s[i-1]+a[i];
        if(b[i]==2) l[i]=0,r[i]=k-1;
        else {
            l[i]=(-2ll*s[i-1]%k+k)%k,r[i]=(-2ll*s[i]%k+k)%k;
            if(2ll*a[i]>k) return puts("-1"),0;
        }
        st[++top]=l[i];st[++top]=r[i];
    }
    sort(st+1,st+top+1);top=unique(st+1,st+top+1)-st-1;
    for(int i=1;i<=n;i++) {
        l[i]=lower_bound(st+1,st+top+1,l[i])-st;
        r[i]=lower_bound(st+1,st+top+1,r[i])-st;
    }
    for(int i=n;i;i--) {
        f[i]=query(l[i]);
        if(l[i]>r[i]) update(1,1,top,r[i]+1,l[i]-1,i);
        else update(1,1,top,1,l[i]-1,i),update(1,1,top,r[i]+1,top,i);
    }
    ll ans=Inf;
    for(int i=1;i<=n;i++) ans=min(ans,query(r[i]));
    printf("%lld\n",ans+2ll*s[n]);
    return 0;
}


Measured memory_bytes: 11904
#include <iostream>

int main(int argc, char* argv[])
{
  int a,b,c;
  std::cin >> a >> b >> c;
  
  if ((a < b) && (b < c))
  {
    std::cout << "Yes" << std::endl;
  }
  else
  {
    std::cout << "No" << std::endl;
  }
  return 0;
}

Measured memory_bytes: 1156
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<utility>
#include<map>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 100000000
#define MOD 100000007
#define SIZE 100005
#define pi 	3.14159265358979323846


int main(){
	string str;
	ll n;

	cin >> str >> n;

	REP(i,n){
		string s;
		ll st,en;
		cin >> s >> st >> en;
		en++;
		if(s=="print"){
			FOR(j,st,en){
				cout << str[j];
			}
			cout << endl;
		}

		if(s=="replace"){
			string temp;
			cin >> temp;
			FOR(j,st,en){
				str[j] = temp[j-st];
			}
		}

		if(s=="reverse"){
			string temp = str;
			FORR(j,en,st){
				str[j] = temp[st+en-j-1];
			}
			//cout << "rev" << endl;
		}

		//cout << str << endl;
	}
}


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

int main() {
    int x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    vector<int> p(a);
    vector<int> q(b);
    vector<int> r(c);
    rep(i,a) cin >> p[i];
    rep(i,b) cin >> q[i];
    rep(i,c) cin >> r[i];

    sort(p.begin(), p.end());
    reverse(p.begin(), p.end());
    sort(q.begin(), q.end());
    reverse(q.begin(), q.end());
    sort(r.begin(), r.end());
    reverse(r.begin(), r.end());
    
    int s = 0;
    int t = 0;
    int u = 0;
    int64_t ans = 0;
    rep(i,x+y){
        int ps;
        if(s >= x) ps = -1;
        else ps = p[s];
        int qt;
        if(t >= y) qt = -1;
        else qt = q[t];
        int ru;
        if(u >= c) ru = -1;
        else ru = r[u];
        int d = max(ps,max(qt,ru));
        //cout << d << endl;
        ans += d;
        if(d == ru) u++;
        else if(d == ps) s++;
        else t++;
    }

    cout << ans << endl;
}


Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
using namespace std;
typedef long long int ll;

#define MOD 998244353


ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}

bool primeNumber(ll n){
    if(n < 2) return false;
    else{
        for(ll i = 2; i * i <= n; i++){
            if(n % i == 0) return false;
        }
        return true;
    }
}
  
  

int main(){
    char c;
    cin >>c;
    
    if (c == 'a' || c == 'e' ||c == 'i' ||c == 'o' ||c == 'u')cout << "vowel" << endl;
    else cout << "consonant" << 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 sf scanf
#define pf printf
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define mod 1000000007
#define maxn 100005
#define IN freopen("nocross.in","r",stdin)
#define OUT freopen("nocross.out","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define ROF(i,a,b) for(i=a ; i>=b ; i--)
#define DBG pf("Hi\n")
#define INF 2000000000000000000LL
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
// #define off 1000000
#define sq(x) ((x)*(x))

using namespace __gnu_pbds;
using namespace std ;

template <class T>  inline void smax(T &x,T y){ x = max((x), (y)); }
template <class T>  inline void smin(T &x,T y){ x = min((x), (y)); }

// typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
i64 a[100] ;
int main()
{
    i64 i , j , k , l , m ,  n ;

    cin>>n ;

    for(i=1 ; i<=n ; i++) scanf("%lld",&a[i]) ;

    i64 ans1 = 1 , ans2 = 1 ;

    for(i=1 ; i<=n ; i++)
    {
        ans1 = ans1*3 ;
        if(a[i]%2==0) ans2 = ans2*2 ;
    }

    printf("%lld\n",ans1-ans2) ;

    return 0 ;
}


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

using ll = long long;

template<typename T>
T gcd(T a, T b)
{
	if (a < b)	return gcd(b, a);
	T r;
	while ((r = a % b))
	{
		a = b;
		b = r;
	}
	return b;
}

template<typename T>
T lcm(T a, T b)
{
	return a * b / gcd(a, b);
}

template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
	x = 1;
	y = 0;
	T x0 = 0, y0 = 1;
	while (b != 0)
	{
		T q = a / b;
		a -= q * b;
		swap(a, b);
		x -= q * x0;
		swap(x, x0);
		y -= q * y0;
		swap(y, y0);
	}
	return a;
}

template<typename T>
T inv_mod(T a, T mod)
{
	T t1, t2;
	ext_gcd(a, mod, t1, t2);
	t1 %= mod;
	if (t1 < 0)		t1 += mod;
	return t1;
}

template<typename T>
T combination_large(T n, T k, T mod)
{
	if (n < k || n < 0 || k < 0)	return 0;
	vector<T> inv(n + 1, 1), fact(n + 1, 1), fact_inv(n + 1, 1);
	for (T i = 2; i <= n; ++i)
	{
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		fact[i] = (fact[i - 1] * i) % mod;
		fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
	}
	return fact[n] * (fact_inv[k] * fact_inv[n - k] % mod) % mod;
}

template<typename T>
T combination(T n, T k, T mod = 1)
{
	vector<vector<T>> table(n + 1, vector<T>(k + 1, 1));
	for (T i = 1; i <= n; ++i)
	{
		table[i][0] = 1;
		for (T j = 1; j <= n; ++j)
		{
			table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % mod;
		}
	}
}


int main(int, char**)
{
	long long K;
	scanf("%lld",&K);

	vector<vector<ll>> table(K, vector<ll>(K, 0));
	for (ll i = 0; i < K; ++i)
	{
		for (ll j = 0; j < K; ++j)
		{
			table[i][j] = gcd(i + 1, j + 1);
		}
	}

	ll sum = 0;
	for (ll i = 0; i < K; ++i)
	{
		for (ll j = 0; j < K; ++j)
		{
			ll ij = table[i][j];
			for (ll k = 0; k < K; ++k)
			{
				sum += table[ij - 1][k];
			}
		}
	}
	cout << sum << endl;

	return 0;
}


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

using namespace std;

int N, mod, i2[10009], i3[10009];//[100][100][100];//[270 * 3][270 * 3][270 * 4];

int add (int x, int y) {int ans = x + y; if (ans >= mod) ans -= mod; return ans;}
int subtract (int x, int y) {if (x >= y) return x - y; return x - y + mod;}
int mul (int x, int y) {return 1LL * x * y % mod;}
void adto (int &x, int y) {x += y; if (x >= mod) x -= mod;}

int power (int a, int b)
{
    int p = 1;
    for (int i=0; (1<<i) <= b; i++)
    {
        if (b & (1 << i)) p = mul (p, a);
        a = mul (a, a);
    }
    return p;
}

int fac[2000009], inv[2000009];
void Prec (int lim){fac[0] = inv[0] = 1;for (int i=1; i<=lim; i++)fac[i] = mul (fac[i - 1], i);
inv[lim] = power (fac[lim], mod - 2);for (int i=lim - 1; i>=0; i--)inv[i] = mul (inv[i + 1], i + 1);}
int comb (int N, int K){if (K > N || N < 0 || K < 0) return 0; int ans = mul (fac[N], inv[N - K]);ans = mul (ans, inv[K]);return ans;}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d", &N, &mod), Prec(4 * N + 100);
/*dp[0][0][N] = 1;
for (int i=0; i<3 * N; i++)
{
    int ni = (i + 1) & 1;
    memset (dp[ni], 0, sizeof (dp[ni]));
    for (int j=0; j<=i; j++)
        for (int k=0; k<=4 * N; k++)
            if (dp[i & 1][j][k] > 0)
            {
                ///k = N + cnt1 - cnt2
                ///j = how many numbers smaller than or equal to i i have left
                adto (dp[ni][j + 1][k], dp[i & 1][j][k]);///don't group this one
                if (j >= 2)
                    adto (dp[ni][j - 2][k], mul (dp[i & 1][j][k], j * (j - 1)));
                if (j >= 1 && k > 0)
                    adto (dp[ni][j - 1][k - 1], mul (dp[i & 1][j][k], j));
                adto (dp[ni][j][k + 1], dp[i & 1][j][k]);
            }
}*/
int ans = 0;
//for (int k=N; k<=4 * N; k++)
  //  adto (ans, dp[(3 * N) & 1][0][k]);
i2[0] = i3[0] = 1;
int invv3 = power (3, mod - 2);
for (int i=1; i<=3 * N; i++)
    i2[i] = mul (i2[i - 1], inv[2]),
    i3[i] = mul (i3[i - 1], invv3);
for (int cnt1 = 0; cnt1 <= 3 * N; cnt1 ++)
    for (int cnt2 = 0; cnt2 <= cnt1 && 2 * cnt2 + cnt1 <= 3 * N; cnt2 ++)
        if ((3 * N - cnt1 - 2 * cnt2) % 3 == 0)
        {
            int cnt3 = (3 * N - cnt1 - 2 * cnt2) / 3;
            int curr = mul (mul (fac[3 * N], i2[cnt2]), i3[cnt3]);
            curr = mul (curr, inv[cnt1]), curr = mul (curr, inv[cnt2]), curr = mul (curr, inv[cnt3]);
            //printf ("%d %d %d -> %d\n", cnt1, cnt2, cnt3, curr);
            adto (ans, curr);
        }
printf ("%d\n", ans);
return 0;
}


Measured memory_bytes: 2432
//file_name:ABC85_D.cpp
#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 limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#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;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // int scan
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // matrix scan
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // string scan
    /*
    string s;
    cin >> s;
    */


int main() {
    int n;
    scanf("%d",&n);
    ll h;
    scanf("%lld",&h);
    ll a[n] = {};
    ll b[n] = {};
    ll m = 0;
    rep(i,n){
        scanf("%lld%lld",&a[i],&b[i]);
        if(a[i]>m){
            m=a[i];
        }
    }
    sort(a,a+n);
    sort(b,b+n);


    ll ans = 99999999999;
    ll bsum = 0;
    ll count = 0;

    for(int i = n-1;i>=0;i--){
        ll h2 = h;
        int ans2 = 0;
        bsum += b[i];
        //cout << b[i] << bsum;
        count++;
        ans2 += count;
        h2 -= bsum;
        if(h2<=0){
            if(ans2<ans){
                ans=ans2;
            }
            break;
        }
        if(h2%a[n-1]==0){
            ans2+=h2/m;
        }else{
            ans2+=h2/m+1;
        }
        if(ans2<ans){
            ans=ans2;
        }
    }



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



Measured memory_bytes: 1792
n, x=gets.split.map(&:to_i)

def pn(n)
	(2**(n+1))-1
end

def loopn(n,x)
	s = pn(n)
	return x == 1 ? 1 : 0 if n == 0
	case x
		when 0..1        then return 0
		when 2...s-1     then return loopn(n-1,x-1)
		when s-1         then return pn(n-1)
		when s           then return pn(n-1)+1
		when s+1...s*2-1 then return pn(n-1)+loopn(n-1,x-s)+1
		else                  return s
	end
end

p loopn(n,x)

Measured memory_bytes: 1788
N, M = map(int, input().split())

in_list = []
for i in range(N):
    in_list.append(list(map(int, input().split())))

k_list = []
for i in range(N):
    num = in_list[i][0]
    k_list = k_list + in_list[i][1: num + 1]

count = 0
for i in range(1, M + 1):
    if k_list.count(i) == N:
        count += 1
    else:
        pass

print(count)





Measured memory_bytes: 3060
# 集合の要素の管理は不要
# ある値がどこに属しているかが把握できれば良い
class Set
	attr_writer :overwrite

	def head
		return self unless @overwrite

		t = @overwrite.head
		@overwrite = t if t
		return @overwrite
	end
end

n, q = gets.split.map(&:to_i)

affiliation = []
n.times {|i| affiliation[i] = Set.new}

q.times do
	com, x, y = gets.split.map(&:to_i)
	set_x = affiliation[x].head
	set_y = affiliation[y].head

	case com
	when 0
		unless set_x == set_y
			set_x.overwrite = set_y.overwrite = Set.new
		end
	when 1
		p set_x == set_y ? 1 : 0
	end
end



Measured memory_bytes: 7912
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
const int INF = 999999999;
const int MOD = 1e9 + 7;
const double pi = 3.141592653589793238;

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (b + c <= a) {
		cout << min(b, c) << " " << 0 << endl;
	}
	else {
		cout << min(b, c) << " " << abs(min(0, a - (b + c))) << endl;
	}
}


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

const ll mod = 1e9 + 7;

ll dp[100010]; //ans
ll mm[100010]; //unsafe points
bool vis[100010];

ll rec(ll n){
    if(vis[n]) return dp[n];
    vis[n] = true;
    if(mm[n]) return dp[n] = 0;
    if(n == 0) return dp[n] = 1;
    if(n >= 2) return dp[n] = (rec(n - 1) + rec(n - 2)) % mod;
    return dp[n] = rec(n - 1);
}

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

    ll n,m;
    cin >> n >> m;
    
    rep(i,m){
        ll a;
        cin >> a;
        mm[a] = 1;
    }
    
    cout << rec(n) << endl;
    
}

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

using namespace std;

#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
// #define int ll
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define pb push_back
#define B begin()
#define E end()
#define sz(A) (ll)(A).size()
#define F first
#define S second
#define loop(z, v) for(auto &z: v)
#define sp << ' ' << 
#define sps << ' '
#define nl "\n"
// #define nl endl
#define fat 1000000007
// #define fat 998244353


int main()
{
    boost;
    ll tt = 1, n, m, k = 0, i, j;
    ll q, l = 0, r = 0, x, y, z, h, a, b, c, d;

    bool poss = true;

    // cin >> tt;
    for(int _ = 1; _ <= tt; _++){
        // cout << "Case #" << _ << ": ";
        cin >> n >> m >> x;

        vector<pair<int, vi>> books(n);
        for(i = 0; i < n; i++){
            cin >> books[i].F;
            for(j = 0; j < m; j++){
                cin >> a;

                books[i].S.pb(a);
            }
        }
        ll mask = 0;

        vi lvl(m, 0);
        ll ans = 1e9;
        for(mask = 0; mask < (1 << n); mask++){
            ll cost = 0;
            fill(lvl.B, lvl.E, 0);

            for(i = 0; i < n; i++){
                if(mask & (1 << i )){
                    cost += books[i].F;
                    for(ll j = 0; j < sz(lvl); j++){
                        lvl[j] += books[i].S[j];
                    }
                }
            }

            poss = true;
            for(ll i = 0; i < sz(lvl); i++){
                if(lvl[i] < x){
                    poss = false;
                    break;
                }
            }
            if(poss){
                ans = min(ans, cost);
            }
        }

        if(ans > 1e8){
            cout << -1 << nl;
        }
        else cout << ans << nl;
    }   
    return 0;
}

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


using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007


ll n;
string a, b;
int main(){
	cin >> n;
	cin >> a >> b;
	REP(i, n) {
		bool ok = true;
		FOR(j, i,n) {
			if (a[j] != b[j - i]) ok = false;
		}
		if (ok) {
			cout << i + n << endl;
			return 0;
		}
	}
	cout << n * 2 << endl;
	
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define rdll(x) scanf("%lld",&x);
int n,m,a,b,c;
bool rui[55][2505];
bool ok[55][55][105];
vector<int>edge[55];
int main(){
	cin>>n>>m>>a>>b>>c;
	rep(i,m){
		int x,y; cin>>x>>y;
		edge[x].pb(y);
	}
	repn(i,n) ok[i][i][0] = 1;
	repn(x,104){
		repn(i,n){
			repn(j,n){
				for(int k=0;k<edge[i].size();k++){
					int to = edge[i][k];
					if(ok[to][j][x-1]) ok[i][j][x] = 1;
				}
			}
		}
	}
	rui[n][0] = 1;
	for(int t=1;t<=n*n;t++){
		for(int v=1;v<=n;v++){
			int mask = 0;
			repn(u,n){
				if(ok[v][u][a] && rui[u][t-1]) mask|=1;
			}
			repn(u,n){
				if(ok[v][u][b] && rui[u][t-1]) mask|=2;
			}
			repn(u,n){
				if(ok[v][u][c] && rui[u][t-1]) mask|=4;
			}
			if(mask==7){
				rui[v][t]=1;
			}
			else if(rui[v][t-1]) rui[v][t] = 1;
		}
		if(rui[1][t]){
			cout<<t<<endl;
			return 0;
		}
	}
	cout<<"IMPOSSIBLE"<<endl;
}


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

int main() {
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  double x,y;
  x=h*30+m*0.5;
  y=m*6;
  double t=max(x,y)-min(x,y);
  t*=3.14159265358979;
  t/=180.0;
  double ans=sqrt(a*a+b*b-2.0*a*b*cos(t));
  cout<<fixed<<setprecision(13)<<ans;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> V(N);
  vector<int> C(N);
  vector<int> dis(N);
  int sum = 0;
  for(int i = 0; i < N; i++) cin >> V.at(i);
  for(int i = 0; i < N; i++){
    cin >> C.at(i);
    dis.at(i) = V.at(i) - C.at(i);
    if(dis.at(i) > 0){
      sum += dis.at(i);
    }
  }
  
  cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(ll i=0; i<(n); ++i)
#define rep1(i,n) for(ll i=1; i<=(n); ++i)
#define repi(i,a,b) for(ll i=a; i<=(b); ++i)
#define rrep(i,n) for(ll i=(n-1); i>=0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define print(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
using Edge = pair<ll,ll>;
using Graph = vector<vector<Edge>>;
typedef pair<ll,ll> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
ll devc(ll x, ll y){return 1 + (x-1)/y;}

ll solve(ll N){
    ll ans = 0;
    return ans;
}

int main(){
    ll N,M; cin >> N >> M;
    vector<ll> A(M),B(M);
    rep(i,M) cin >> A[i] >> B[i];
    
    vector<ll> x,y;
    rep(i,M) if(A[i] == 1) x.pb(B[i]);
    rep(i,M) if(B[i] == N) y.pb(A[i]);
    sort(ALL(x));
    sort(ALL(y));
    
    rep1(i,N) if(i != 1 && i != N) if(binary_search(ALL(x),i) && binary_search(ALL(y),i) ){ print("POSSIBLE"); return 0;}
    
    print("IMPOSSIBLE");
    return 0;
    
}

Measured memory_bytes: 5748
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n;
  cin >> n;
  vector<int> ls(n);
  for(int i = 0; i < n; i++) cin >> ls[i];
  sort(ls.begin(), ls.end());
  
  int count = 0;
  for(int i = 0; i < n - 2; i++){
    for(int j = i + 1; j < n - 1; j++){
      for(int k = j + 1; k < n; k++){
        if(ls[k] < ls[i] + ls[j]){
          count++;
        }
      }
    }
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int a, b, c;

	scanf("%d/%02d/%02d", &a, &b, &c);

	if (a != 2018)
		printf("2018/%02d/%02d\n", b, c);
	else
		printf("%d/%02d/%02d\n", a, b, c);

	return 0;


}


Measured memory_bytes: 128
/**
 *      ABC 68 C
 *      author  : kyomukyomupurin
 *      created : 2018-09-11 23:14:13
**/

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int N, M; cin >> N >> M;
    int a[M] = {}; int b[M] = {};
    for (int i = 1; i <= M; ++i) {
        cin >> a[i] >> b[i];
    }

    bool step1[N] = {}; bool step2[N] = {};

    for (int i = 1; i <= M; ++i) {
        if (a[i] == 1){
            step1[b[i]] = true;
        }
    }

    for (int i = 1; i <= M; ++i) {
        if (b[i] == N){
            step2[a[i]] = true;
        }
    }

    for (int i = 1; i <= M; ++i) {
        if (step1[i] && step2[i]){
            cout << "POSSIBLE" << '\n'; return 0;
        }
    }

    //cout << step1[1] << " " << step1[2] << " " << step2[1] << " " << step2[2] << endl;
    
    cout << "IMPOSSIBLE" << '\n';

    return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
void print() { cout << "\n"; }
template <class T> void print(const T &x) { cout << x << "\n"; }
template <class T, class... Args> void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
template <class T> void printVector(const vector<T> &v) {
    for(const T &x : v) {
        cout << x << " ";
    }
    cout << "\n";
}
using ll = long long;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

ll GCD(ll a, ll b) {
    if(b == 0)
        return a;
    else
        return GCD(b, a % b);
}

ll LCM(ll a, ll b) { return a * b / GCD(a, b); }

void solve() {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    if(A < B || D < B) {
        print("No");
        return;
    }
    if(C + 1 - B >= 0) {
        print("Yes");
        return;
    }
    ll g = GCD(B, D);
    ll l = (C - A) / g;
    ll r = (B - A) / g;
    if(C - A < 0 && (A - C) % g != 0) {
        l--;
    }
    // print(l, r, g);
    print((r - l >= 2) ? "No" : "Yes");
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
}

Measured memory_bytes: 256
#include <stdbool.h>
#include <stdio.h>
int main() {
	int n, ans = 0;
	char s[30000];
	scanf("%d%s", &n, s);
	for (int i = 0; i < 1000; i++) {
		int a, b, c;
		bool isA = false, isB = false, isC = false;
		a = i / 100;
		b = (i - a * 100) / 10;
		c = i % 10;
		for (int j = 0; j < n; j++) {
			if (!isA && s[j] == a + '0') {
				isA = true;
				continue;
			}
			if (!isB && isA && s[j] == b + '0') {
				isB = true;
				continue;
			}
			if (!isC && isB && s[j] == c + '0') {
				isC = true;
				continue;
			}
		}
		if (isA && isB && isC) {
			ans++;
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long
#define all(a) (a).begin(),(a).end()

using namespace std;

int main(int argc, char const *argv[]) {
  int n,m;
  //bool oneflag=false,nflag=false;
  scanf("%d%d",&n,&m);
  std::vector<int> a(m);
  std::vector<int> b(m);
  std::vector<int> amemo;
  std::vector<int> bmemo;
  for (int i = 0; i < m; i++) {
    std::cin >> a[i];
    std::cin >> b[i];
    if(a[i]==1){
      amemo.push_back(b[i]);
    }
    if(b[i]==n){
      bmemo.push_back(a[i]);
    }
  }
  //以上入力と行き先リスト//

  int asize=amemo.size();
  sort(all(bmemo));
  for (int i = 0; i < asize; i++) {
    if(binary_search(bmemo.begin(),bmemo.end(),amemo[i])){
      printf("POSSIBLE\n");
      return 0;
    }
  }
  printf("IMPOSSIBLE\n");
  return 0;
}


Measured memory_bytes: 2812
using System;
class Program
{
    static void Main(string[] args)
    {
        string[] x = Console.ReadLine().Split(' ');
        int a = int.Parse(x[0]);
        int b = int.Parse(x[1]);
        int n = b - a;
        int nisiNoTakasa = 0;
        for(int i = 1;i<n;i++)
        {
            nisiNoTakasa += i;
        }
        int yukinohukasa = nisiNoTakasa - a;
        Console.WriteLine(yukinohukasa);
    }

    
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef DEBUG
#define line() cerr << "[" << __LINE__ << "] ";
#define dump(i) cerr << #i ": " << i << " ";
#define dumpl(i) cerr << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    rep(i, 1, 4)
    {
        if (i != a && i != b)
        {
            cout << i << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy -2147382637
#define bql 2147483647
#define ll long long
#define ull unsigned long long
#define ld long double
#define il inline
#define sz(x) x.size()
#define maxn 100010
#define rp(i, l, r) for (int i = l; i <= r; i++)
#define rb(i, r, l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;
ll max(ll a,ll b){if(a>b)return a;else return b;}
ll min(ll a,ll b){if(a<b)return a;else return b;}
ll lowbit(ll x){return x&(-x);}
ll prime(ll x){
   if(x<=1)return false;
   for(int i=2;i<=int(sqrt(x));i++){
	   if(x%i==0)return false;
   }return true;
}
bool cmp(ll a,ll b){return a>b;}
ll gcd(ll a,ll b){ll r;while(b>0){r=a%b;a=b;b=r;}return a;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
inline ll read() {
	char c = getchar(); ll w = 1; ll x = 0;
	while (!isdigit(c))
		(c == '-') && (w = -w), c = getchar();
	while (isdigit(c))
		x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar();
	x *= w;
}
void fl(string name){
	freopen((name+".in").c_str(),"r",stdin);
	freopen((name+".out").c_str(),"w",stdout);
}
const int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1},
		  dy[8] = {0, 0, -1, 1, -1, -1, 1, 1};
int main(){
	fast;
	double n;
	cin>>n;
	cout<<n*n<<endl;
	return 0;
}/*『你强归你强，我永不示弱』*/





Measured memory_bytes: 256
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 1000000007 // 1e9+7
#define PI 3.1415926535
/*
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
*/
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1
#define LINF 1000000000000000001 // 1e18+1

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------
int mp[2]={-1,1};
ll x[1005],y[1005],z[1005];
int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  int n,m;cin>>n>>m;
  for(int i=1;i<=n;i++){
    cin>>x[i]>>y[i]>>z[i];
  }
  ll ans=-LINF;
  for(auto a:mp){
    for(auto b:mp){
      for(auto c:mp){
        ll summ[1005]={};
        ll cnt=0;
        for(int i=1;i<=n;i++){
          summ[i]+=a*x[i]+b*y[i]+c*z[i];
          // cout<<x[i]<<"\n";
        }
        sort(summ+1, summ+n+1);
        reverse(summ+1, summ+n+1);
        for(int i=1;i<=m;i++){
          cnt+=summ[i];
        }
        ans=max(ans, cnt);
      }
    }
  }
  P(ans);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

int main(){
    int N, A, B; cin >> N >> A >> B;
    cout << min(A, B) << " " << max(A+B-N, 0);
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AGC020B {
    class Program {
        static void Main(string[] args) {
            int K = int.Parse(Console.ReadLine());
            int[] input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            bool ok = true;
            if (input[K - 1] != 2) {
                ok = false;
            }
            long min = 2;
            long max = 3;
            for (int i = 1; i < K; i++) {
                if (!ok) {
                    break;
                }
                int num = input[K - 1 - i];
                if (num >= max * 2) {
                    ok = false;
                } else {
                    if (num > min) {
                        min = num;
                    } else {
                        min = (min + num - 1) / num * num;
                    }
                    max = (max / num) * num + (num - 1);
                }
            }
            if(min > max) {
                ok = false;
            }
            if (ok) {
                Console.WriteLine(min.ToString() + " " + max.ToString());
            } else {
                Console.WriteLine(-1);
            }
        }
    }
}

Measured memory_bytes: 26204
from operator import itemgetter
from math import gcd
from collections import Counter

N = int(input())
mod = int(1e9+7)

zero = 0
P = {}
for i in range(N):
  a,b = list(map(int, input().split()))
  if a == 0 and b == 0:
    zero += 1
    continue
  g = gcd(a,b)
  a,b = a//g, b//g
  if b < 0:
    a,b = -a,-b
  if b == 0 and a < 0:
    a,b = -a,b  
  #rot90
  rot90 = a<=0
  if rot90:
    a,b = b,-a
  #add
  if not (abs(a),b) in P:
    P[(a,b)] = [0,0]
  if not rot90 :
    P[(a,b)][0] += 1
  else:
    P[(a,b)][1] += 1
    
ans = 1
for k,v in P.items():
  #print(k,v)
  s,t = v
  wk = 1 + pow(2,s,mod) - 1 + pow(2,t,mod) - 1
  ans *= wk
  ans %= mod
  
ans += zero

print((ans - 1) % mod)

Measured memory_bytes: 140216
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
int main() {
	// your code goes here
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
	
	int n; cin>>n;
	bool ok=1;
	for(int i=0;i<n;i++)
	{
	    int p; cin>>p;
	    if( !(p&1) )
	    {
	        if( p%3!=0 && p%5!=0 ){ ok=0; break; }
	    }
	}
	if(ok) cout<<"APPROVED";
	else cout<<"DENIED";
	
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    int a[26]={0};
    for(int i=0;i<s.length();i++)
    {
        a[s[i]-'a']++;
    }
    bool p=true;
    for(int i=0;i<26;i++)
    {
        if(a[i]%2!=0)
        {
            p=false;
            break;
        }
    }
    if(p)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    return 0;
}







Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 25, M = 1e6 + 25, oo = 1e9, mod = 1e9 + 7;
const long long OO = 1e18+25;

int n,k, a[125], mem[N][2];

long long dp(int v=k,int turn=1)
{
    if(v < a[0]) return turn * -1;
    int &ret = mem[v][(turn==1)];
    if(ret != 0) return ret;
    for(int i=0; i<n && v >= a[i]; i++)
    {
        ret = dp(v-a[i], turn*-1);
        if(ret == turn) break;
    }
    return ret;
}

int main()
{
    //memset(mem, -1, sizeof mem);
    scanf("%d%d",&n,&k);
    for(int i=0; i<n; i++) scanf("%d",a+i);
    sort(a, a+n);
    printf("%s",(dp()==1?"First":"Second"));
    return 0;
}

Measured memory_bytes: 7296
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>

using namespace std;
typedef long long ll;
int N, K;
double x[60], y[60], c[60];

double dist(double s, double t, int i){
    return sqrt((s-x[i])*(s-x[i])+(t-y[i])*(t-y[i]));
}

double dist(int i, int j){
    return sqrt((x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i]));
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    cin >> N >> K;
    for(int i = 0; i < N; i++) cin >> x[i] >> y[i] >> c[i];
    double l = 0.0, r = 200000;
    int ct = 0;
    if(K == 1){
        cout << 0 << endl;
        return 0;
    }
    while(ct < 100){
        ct++;
        double p = (l+r)/2;
        int mx = 0;
        for(int i = 0; i < N; i++){
            for(int j = i+1; j < N; j++){
                double r1 = p/c[j];
                double r2 = p/c[i];
                if(dist(i, j) > r1+r2) continue;
                if(dist(i, j)+min(r1, r2) < max(r1, r2)) continue;
                double x1 = x[i]-x[j], y1 = y[i]-y[j];
                double a = (x1*x1+y1*y1+r1*r1-r2*r2)/2;
                double ds = y1*sqrt((x1*x1+y1*y1)*r1*r1-a*a)/(x1*x1+y1*y1);
                double dt = x1*sqrt((x1*x1+y1*y1)*r1*r1-a*a)/(x1*x1+y1*y1);
                double os = x[j]+a*x1/(x1*x1+y1*y1);
                double ot = y[j]+a*y1/(x1*x1+y1*y1);
                double s = os+ds;
                double t = ot-dt;
                int cnt = 0;
                for(int k = 0; k < N; k++){
                    if(dist(s, t, k) < p/c[k]) cnt++;
                }
                mx = max(mx, cnt);
                s = os-ds;
                t = ot+dt;
                cnt = 0;
                for(int k = 0; k < N; k++){
                    if(dist(s, t, k) < p/c[k]+1e-8) cnt++;
                }
                mx = max(mx, cnt);
            }
        }
        // cout << mx << "->";
        for(int i = 0; i < N; i++){
            int cnt = 0;
            for(int j = 0; j < N; j++){
                if(dist(i, j)+p/c[i] < p/c[j]+1e-8) cnt++;
            }
            mx = max(cnt, mx);
        }
        // cout << mx << endl;
        if(mx >= K) r = p;
        else l = p;
    }
    cout << l << endl;
}

Measured memory_bytes: 256
n=int(input())
a = list(map(int,input().split()))
even=[el for el in a if el % 2==0]
try:
  for a in even:
    if a % 3 == 0 or a % 5 == 0:
      flg = 1
    else:
      raise
except:
  print('DENIED')
else:
  print('APPROVED')

Measured memory_bytes: 3060
while(True):
  a, b, c = map(str, input().split())
  
  if b == "+" :
    print(int(a)+int(c))
  elif b == "-" :
    print(int(a)-int(c))
  elif b == "/" :
    print(int(a)//int(c))
  elif b == "*" :
    print(int(a)*int(c))
  else:
    break


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

int main() {
  ll n,ans;
  cin >> n;
  ans = n*(n-1)/2;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		long mod = 1000000007;
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.nextLine();
		String S = sc.nextLine();
		int[] cnt = new int[27];
		for(int i = 0; i < S.length(); i++) {
			cnt [S.charAt(i)-'a'] ++;
		}
		long ans = 1;
		long tmp;
		for(int i = 0; i < 27; i++) {
			ans += ans*cnt[i];
			ans%=mod;
		}
		--ans;
		System.out.println(ans);
	}

}


Measured memory_bytes: 25164
#include <bits/stdc++.h>
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using ll = long long;
const int INF = 0x3f3f3f3f;
using namespace std;

int n;
ll a[100003], b[100003], ans, x;
int main() {
    //freopen("jumping.in", "r", stdin);
    IOS
    cin >> n;
    for (int i = 0; i <= n; ++i) {
        cin >> a[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> b[i];
    }
    for (int i = 0; i < n; ++i) {
        x = min(a[i], b[i]);
        b[i] -= x;
        ans += x;
        x = min(a[i+1], b[i]);
        a[i+1] -= x;
        ans += x;
    }
    cout << ans << endl;

    return 0;


}


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

using namespace std;

vector<vector<int>> v;

void lol(int x, int k) {
	if (x == 1) {
		v.push_back({1,k,0});
		v.push_back({1,k,1});
		return;
	}
	if (x == 2) {
		v.push_back({1,k,0});
		v.push_back({1,k,1});
		v.push_back({1,k,2});
		return;
	}
	if (x%2 == 0) {
		v.push_back({1,k,x});
		x--;
	}
	v.push_back({k-1,k,0});
	v.push_back({k-1,k,x/2+1});
	lol(x/2,k-1);
}

int main() {
	int l;
	int n = 20;
	cin >> l;
	lol(l-1,n);
	int m = v.size();
	cout << n << " " << m << "\n";
	for (int i = 0; i < m; i++) {
		cout << v[i][0] << " " << v[i][1] << " " << v[i][2] << "\n";
	}
}

Measured memory_bytes: 256