akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define MOD 1000000009
const long long INF = 1LL<<60;

int main() {
    int h,w;
    cin>>h>>w;

    vector<vector<int>> a(h,vector<int>(w,0));

    rep(i,h){
        rep(j,w){
            cin>>a[i][j];
        }
    }
    vector<int> ans1,ans2,ans3,ans4;

    rep(i,h){
        rep(j,w){
            if(i%2==0){
                if(a[i][j]%2==1){
                    if(j!=w-1){
                        ans1.push_back(i+1);
                        ans2.push_back(j+1);
                        ans3.push_back(i+1);
                        ans4.push_back(j+2);
                        a[i][j+1]++;
                    }
                    else if(i!=h-1){
                        ans1.push_back(i+1);
                        ans2.push_back(j+1);
                        ans3.push_back(i+2);
                        ans4.push_back(j+1);
                        a[i+1][j]++;
                    }
                }
            }
            else{
                int k=w-1-j;
                if(a[i][k]%2==1){
                    if(k!=0){
                        ans1.push_back(i+1);
                        ans2.push_back(k+1);
                        ans3.push_back(i+1);
                        ans4.push_back(k);
                        a[i][k-1]++;
                    }
                    else if(i!=h-1){
                        ans1.push_back(i+1);
                        ans2.push_back(k+1);
                        ans3.push_back(i+2);
                        ans4.push_back(k+1);
                        a[i+1][k]++;
                    }
                }
            }
        }
    }

    cout<<ans1.size()<<endl;
    rep(i,ans1.size()) cout<<ans1[i]<<" "<<ans2[i]<<" "<<ans3[i]<<" "<<ans4[i]<<endl;
}

Measured memory_bytes: 5224
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input!{
        n: String,
    }
    println!("{}", if n.contains('7') { "Yes" } else { "No" });
}


Measured memory_bytes: 2112
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();

    long[] a = new long[n];
    long[] plus = new long[n];
    for(int i=0; i<n; i++){
      a[i] = sc.nextLong();
    }

    plus[n- 2] = a[n - 1];

    long base = 1000000007;

    for(int i=n - 3; i >= 0; i--){
      plus[i] += (a[i+1] + plus[i+1]) % base;
    }

    long result = 0;

    for(int i=0; i<n - 1; i++){

      result += ((plus[i] * a[i]));
      result = result % base;
    }

    System.out.println(result);

    return;

  }
}


Measured memory_bytes: 62564
#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 rrng(a) a.rbegin(),a.rend()
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_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) cerr<<#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 tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
int getInt(){int x;scanf("%d",&x);return x;}
template<typename T>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>ostream& operator<<(ostream&o,const v(T)&v){if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v){return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v){return o<<v.fi<<","<<v.se;}
template<typename T>bool mins(T& x,const T&y){if(x>y){x=y;return true;}else return false;}
template<typename T>bool maxs(T& x,const T&y){if(x<y){x=y;return true;}else return false;}
template<typename T>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 main() {
  int n;
  scanf("%d",&n);
  vi a, b;
  rep(i,n) {
    int x,y;
    scanf("%d%d",&x,&y);
    a.pb(x+y);
    b.pb(x-y);
  }
  sort(rng(a));
  sort(rng(b));
  ll ans = max(a.back()-a[0], b.back()-b[0]);
  cout<<ans<<endl;
  return 0;
}






















Measured memory_bytes: 5104
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( stdin . lock ( ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

use std::cmp::Ordering;

fn main() {
    input! {
        a: String,
        b: String
    }

    let ret = if a.len() > b.len() {"GREATER"}
        else if a.len() < b.len() {"LESS"}
        else {
            match a.cmp(&b) {
                Ordering::Less => {"LESS"},
                Ordering::Equal => {"EQUAL"},
                Ordering::Greater => {"GREATER"}
            }
        };
    
    println!("{}", ret);
}

Measured memory_bytes: 4352
#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 repk(i,m,n) for(int i=m;i<n;i++)
#define OKawaiiKoto ios::sync_with_stdio(false);cin.tie(0);
#define F first
#define S second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
using namespace std;
const int MOD1=1e9+7;
const int MOD2=998244353;
const ll INF=2*1e18;
const ld PI=3.14159265358979323846;
ll dp[200005],p1[200005],p2[200005];
int main()
{
    OKawaiiKoto
    rep1(i,200000)
    {
        ll a=i,cnt=0;
        while(a>0)
        {
            if(a%2) cnt++;
            a/=2;
        }
        dp[i]=dp[i%cnt]+1;
    }
    ll n,sum=0;
    string s;
    cin>>n>>s;
    rep(i,n) if(s[i]=='1') sum++;
    if(sum==0)
    {
        rep(i,n) cout<<"1\n";
        return 0;
    }
    if(sum==1)
    {
        rep(i,n)
        {
            if(s[i]=='1') cout<<"0\n";
            else
            {
                if(s[n-1]=='1'||i==n-1) cout<<"2\n";
                else cout<<"1\n";
            }
        }
        return 0;
    }
    p1[0]=1%(sum-1),p2[0]=1%(sum+1);
    rep1(i,n)
    {
        p1[i]=p1[i-1]*2%(sum-1);
        p2[i]=p2[i-1]*2%(sum+1);
    }
    ll cur1=0,cur2=0;
    rep(i,n)
    {
        if(s[i]=='1')
        {
            cur1=(cur1+p1[n-1-i])%(sum-1);
            cur2=(cur2+p2[n-1-i])%(sum+1);
        }
    }
    rep(i,n)
    {
        if(s[i]=='1') cout<<dp[(cur1-p1[n-1-i]+sum-1)%(sum-1)]+1<<"\n";
        else cout<<dp[(cur2+p2[n-1-i])%(sum+1)]+1<<"\n";
    }
}


Measured memory_bytes: 8440
using System;

namespace ABC043B{
    public class Program{
        public static void Main(string[] args){
            var sr = new StreamReader();
            //---------------------------------
            var S = sr.Next<string>();

            var res = "";
            foreach(var c in S){
                if(c == 'B'){
                    if(!string.IsNullOrEmpty(res)) res = res.Remove(res.Length - 1);
                } else{
                    res += c;
                }
            }

            Console.WriteLine(res);
            //---------------------------------
        }
    }

    public class StreamReader{
        private readonly char[] _c = {' '};
        private int _index = -1;
        private string[] _input = new string[0];

        public T Next<T>(){
            if(_index == _input.Length - 1){
                _index = -1;
                while(true){
                    string rl = Console.ReadLine();
                    if(rl == null){
                        if(typeof(T).IsClass) return default(T);
                        return (T)typeof(T).GetField("MinValue").GetValue(null);
                    }
                    if(rl != ""){
                        _input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries);
                        break;
                    }
                }
            }
            return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture);
        }

        public T[] Next<T>(int x){
            var ret = new T[x];
            for(var i = 0; i < x; ++i) ret[i] = Next<T>();
            return ret;
        }

        public T[][] Next<T>(int y, int x){
            var ret = new T[y][];
            for(var i = 0; i < y; ++i) ret[i] = Next<T>(x);
            return ret;
        }
    }
}

Measured memory_bytes: 2904
#include <bits/stdc++.h>
#define ll long long
#define MAX 500005
#define P ((ll)1e9+7)
using namespace std;

ll qpow(ll a, ll n){
    ll res = 1;
    while(n){
        if(n&1) res = res*a%P;
        a = a*a%P, n >>= 1;
    }
    return res;
}
ll inv(ll x){
    return qpow(x, P-2);
}

int n, cnt;
int head[MAX], vet[MAX], Next[MAX];
ll f[MAX], sz[MAX], fac[MAX], g[MAX];

void init(){
    fac[0] = 1;
    for(int i = 1; i < MAX; i++){
        fac[i] = fac[i-1]*i%P;
    }
}

void add(int x, int y){
    cnt++;
    Next[cnt] = head[x];
    head[x] = cnt;
    vet[cnt] = y;
}

void dfs(int x, int fa){
    sz[x] = 1;
    for(int i = head[x]; i; i = Next[i]){
        int v = vet[i];
        if(v == fa) continue;
        dfs(v, x);
        sz[x] += sz[v];
    }
    f[x] = fac[sz[x]-1];
    for(int i = head[x]; i; i = Next[i]){
        int v = vet[i];
        if(v == fa) continue;
        f[x] = f[x]*inv(fac[sz[v]])%P*f[v]%P;
    }
    g[x] = f[x];
}

void dfs2(int x, int fa){
    for(int i = head[x]; i; i = Next[i]){
        int v = vet[i];
        if(v == fa) continue;
        ll t = fac[n-1]*inv(fac[n-1-sz[v]])%P, d = fac[n-1]*inv(fac[sz[v]-1])%P;
        ll F = g[x]*inv(t)%P*fac[sz[v]]%P*inv(f[v])%P;
        g[v] = g[v]*F%P*d%P*inv(fac[n-sz[v]])%P;
        dfs2(v, x);
    }
}

int main()
{
    init();
    cin >> n;
    int x, y;
    for(int i = 1; i < n; i++){
        scanf("%d%d", &x, &y);
        add(x, y), add(y, x);
    }
    dfs(1, 0);
    g[1] = f[1];
    dfs2(1, 0);
    for(int i = 1; i <= n; i++){
        printf("%lld\n", g[i]);
    }

    return 0;
}


Measured memory_bytes: 22400
a,b=map(int,input().split())
z,x,c,v=10*b,10*b+10-1,50*a//4,50*(a+1)//4-1
for i in range(max(z,c),min(x,v)+1):
  if i*8//100==a and i//10==b:print(i);exit()
else:print(-1)

Measured memory_bytes: 3060
#include<iostream>
#include<map>
#include<string.h>
#include<queue>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<cstdlib>
#include<math.h>
#include<set>
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; }



#define rep(n) for(int i=0;i<n;i++)
typedef pair<int, int> pii;

typedef long long ll;
typedef pair<ll, ll>pll;
const int MOD = 1000000007;
const int INF = 1 << 29;




int main() {
	int n;
	
	set<int>st;

	cin >> n;
	
	rep(n) {
		int aa;
		cin >> aa;
		st.insert(aa);
	}

	int cnt = 0;

	for (auto x : st) {
		cnt++;
	}
	

	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <vector>
 
using namespace std;
 
struct Node{
    Node(){
        brother = parent = -1;
        height = depth = num_of_children = 0;
    }
    int parent,brother,depth,num_of_children,height;
    vector<int> children;
};
 
void calcDepth(Node nodes[],int root_id){
    for(int i = 0;i < nodes[root_id].num_of_children;i++){
        nodes[nodes[root_id].children[i]].depth = nodes[root_id].depth+1;
        calcDepth(nodes,nodes[root_id].children[i]);
    }
}
 
void calcHeight(Node nodes[],int height,int parent){
    nodes[parent].height = max(nodes[parent].height,height+1);
    if(nodes[parent].parent != -1) calcHeight(nodes,height+1,nodes[parent].parent);
}
 
int main(){
    int n,id,left_id,right_id,root_id;
    scanf("%d",&n);
    Node nodes[n];
 
    for(int i = 0; i < n; i++){
        scanf("%d %d %d",&id,&left_id,&right_id);
        if(left_id != -1){
            nodes[id].children.push_back(left_id);
            nodes[id].num_of_children++;
            nodes[left_id].parent = id;
        }
        if(right_id != -1){
            nodes[id].children.push_back(right_id);
            nodes[id].num_of_children++;
            nodes[right_id].parent = id;
        }
        if(left_id != -1 && right_id != -1){
            nodes[left_id].brother = right_id;
            nodes[right_id].brother = left_id;
        }
    }
 
    for(root_id = 0; root_id < n; root_id++){
        if(nodes[root_id].parent == -1) break;
    }
 
    if(n > 1){
        calcDepth(nodes,root_id);
 
        for(int i = 0; i < n; i++){
            if(nodes[i].num_of_children == 0) calcHeight(nodes,0,nodes[i].parent);
        }
    }
 
    for(int i = 0; i < n; i++){
        printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d,"
                ,i,nodes[i].parent,nodes[i].brother,nodes[i].num_of_children,nodes[i].depth,nodes[i].height);
        if(nodes[i].parent == -1){
            printf(" root\n");
        }else if(nodes[i].num_of_children == 0){
            printf(" leaf\n");
        }else{
            printf(" internal node\n");
        }
 
    }
}


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

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define CON 1000000000000
#define SIX 1000000
using namespace std;

int main() {

  double t,x;
  cin >> t >> x;
  float a = t/x;
  cout << a << endl;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

vector<vector<int>> e;
vector<ll> ans;

void rec(int now,int p,ll hold){
	ans[now] = hold;
	for(int v:e[now]){
		if(v != p){
			rec(v,now,hold+ans[v]);
		}
	}
}

int main(){
	int n,q;
	cin >> n >> q;
	e.resize(n);
	ans.resize(n,0LL);

	for(int i = 0;i < n-1;i++){
		int a,b;
		cin >> a >> b;
		a--,b--;
		e[a].push_back(b);
		e[b].push_back(a);
	}

	for(int i = 0;i < q;i++){
		int p;
		ll x;
		cin >> p >> x;
		p--;
		ans[p] += x;
	}

	rec(0,-1,ans[0]);

	for(int i = 0;i < n;i++)cout << ans[i] << endl;
}


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

int main() {

	int a, b;
	cin >> a >> b;
	if (a > 0 && b > 0)
		cout << "Positive";
	else if (a < 0 && b < 0){
		if ((b - a + 1) % 2 == 0)
			cout << "Positive";
		else
			cout << "Negative";
	}else 
		cout << "Zero";

	return 0;
}


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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<LL, LL> PLL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N, L; cin >> N >> L;
  VS vs(N);
  REP(i,N) cin >> vs[i];
  SORT(vs);

  for(auto&& s: vs) cout << s;
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<vector>
using namespace std;

long long n,m;
typedef pair<long long,long long> P;

bool sortp(const P& a,const P&b){
	return a.first<b.first;
}




int main()
{
	cin>>n>>m;
	vector<P> ab(n);
	for(int i=0;i<n;i++)
	{
		cin>>ab[i].first>>ab[i].second;
	}
	sort(ab.begin(),ab.end(),sortp);
	long long ans=0;
	long long hon=0;
	for(int i=0;i<n;i++)
	{
		if(hon+ab[i].second<=m){
			hon+=ab[i].second;
			ans+=(ab[i].second*ab[i].first);
		}else if(hon+ab[i].second>m){
			ans+=((m-hon)*ab[i].first);
			break;
		}
		if(hon>=m)
			break;
	}

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

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, m, x, y, a, b, c = -328, d = 328;
    cin >> n >> m >> x >> y;
    while (n--) cin >> a, c = max(c, a);
    while (m--) cin >> b, d = min(d, b);
    if (c < d && c < y && d > x) cout << "No ";
    cout << "War";
}


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

int main() {
	int n, m, c, d=0, count=0;
	int a[20], b[20];

	cin >> n >> m >> c;

	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[j];
			d += a[j] * b[j];
		}
		if (d + c > 0) count++;
		d = 0;
	}
	
	cout << count << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int H = 0;
  int W = 0;
  int i, j;

  do{
    scanf("%d %d", &H, &W);

    if(H == 0 && W == 0)
      break;
    
    for(i = 0; i < H; i++){
      for(j = 0; j < W; j++)
	putchar('#');
      
      putchar('\n');
    }
    putchar('\n');
    
  }while (1);
  
  return 0;
}  

Measured memory_bytes: 572
#include<bits/stdc++.h>
#define int long long 
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(a) a.begin(),a.end()
#define ld long double
#define ub upper_bound
#define lb lower_bound
#define pii pair<int,int>
using namespace std;
signed main()
{
    fast;
    string s;
    cin>>s;
    int n = s.size();
    while(n--)
    	cout<<"x";
}   

Measured memory_bytes: 256
// SeeAlso: https://atcoder.jp/contests/abc062/tasks/abc062_b

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define MAX 100
#define NIL -1
#define MOD 1000000007

typedef int _loop_int;
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// 最大公約数
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
// 最小公倍数
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }

int H,W;
char a[MAX][MAX];

int main() {
    cin >> H >> W;

    REP(i, H) {
        REP(j, W) {
            cin >> a[i][j];
            
        }
    }

    for(int h = 0;h<(H+2);h++) {
        for(int w = 0;w<(W+2);w++) {
            if (h==0||h==H+1) {
                cout << '#';
            } else if (w==0||w==W+1) {
                cout << '#';
            } else {
                cout << a[h-1][w-1];
            }
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define x first
#define y second
#define MX 200000
#define P 1000000007
using namespace std;
typedef long long lnt;
typedef pair<int,int> pii;
template <class T> inline void read(T &x) {
	x = 0; int c = getchar(), f = 1;
	for (; !isdigit(c); c = getchar()) if (c == 45) f = -1;
	for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0');
}
int n, h, w; pii p[3005];
lnt fac[MX+5], inv[MX+5], f[3005][2];
void init() {
	fac[0] = inv[0] = inv[1] = 1;
	for (int i = 1; i <= MX; i++) fac[i] = fac[i-1]*i%P;
	for (int i = 2; i <= MX; i++) inv[i] = P-P/i*inv[P%i]%P;
	for (int i = 1; i <= MX; i++) (inv[i] *= inv[i-1]) %= P;
}
lnt C(int n, int m) {return fac[n]*inv[m]%P*inv[n-m]%P;}
lnt calc(int u, int v) {
	if (p[u].x > p[v].x || p[u].y > p[v].y) return 0;
	return C(p[v].x+p[v].y-p[u].x-p[u].y, p[v].x-p[u].x);
}
int main() {
	read(h), read(w), read(n), init();
	for (int i = 1; i <= n; i++)
		read(p[i].x), read(p[i].y);
	sort(p+1, p+n+1), f[0][0] = 1;
	p[0] = pii(1, 1), p[++n] = pii(h, w);
	for (int i = 1; i <= n; i++)
		for (int j = 0; j < i; j++)
			(f[i][0] += f[j][1]*calc(j,i)%P) %= P, 
			(f[i][1] += f[j][0]*calc(j,i)%P) %= P;
	return printf("%lld\n", (f[n][1]-f[n][0]+P)%P), 0;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 int n;
 cin>>n;
 double ar[n+1];
 for(int i=1;i<=n;i++)
 {
      cin>>ar[i];
 }
 double ans=0,dp[n+1][n+1];
 memset(dp,0,sizeof(dp));
 dp[1][0]=1-ar[1];
 dp[1][1]=ar[1];
 for(int i=2;i<=n;i++)
 {
      for(int j=0;j<=i;j++)
      {
           dp[i][j]=(1-ar[i])*dp[i-1][j];
           dp[i][j]+=ar[i]*dp[i-1][j-1];
      }
 }

 
 for(int i=0;i<=n;i++)
 {
      if(i>(n-i))
      {
           ans+=dp[n][i];
      }
 }
 
 std::cout << std::setprecision(9) << ans << '\n';

}

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


int main() {
    string A,B;

    cin >> A >> B;

    if(A.size() > B.size()){
      cout << "GREATER" << endl;
    }else if(A.size() < B.size()){
      cout << "LESS" << endl;
    }else{
      for(int i=0;i<A.size();++i){
        if(A.at(i) > B.at(i)){
          cout << "GREATER" << endl;
          break;
        }else if(A.at(i) < B.at(i)){
          cout << "LESS" << endl;
          break;
        }
        if(i+1 == A.size()) cout << "EQUAL" << endl;
      }
    }
    return 0;
}


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

using namespace std;
#define N 100005
#define ll long long
int arr[N];


int main()
{
    int n;
    cin>>n;
    for(int i = 1 ; i <= n ; i++)
    {
        int x;
        cin>>x;
        arr[x] = i;
    }
    for(int i = 1 ; i <= n ; i++)
        cout<<arr[i]<<" ";
    return 0;
}
/*
2 3
10 1
1
15 1
2
30 2
1 2
*/


Measured memory_bytes: 3928
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD 1e9+7
#define EPS 1e-8
#define INF 1e9+10
typedef long long ll;
using namespace std;
int main()
{
  int N;
  string S;
  cin >> N >> S;

  rep(i,S.length()){
    cout << (char)('A'+(S[i]-'A'+N)%26);
  }

  cout << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
#define lli long long int
#define mod 1000000007
#define pb push_back
#define mk make_pair
#define fastio ios_base::sync_with_stdio(false); cout.tie(NULL);
using namespace std;

int main()
{
	fastio;
	lli s,w;
	cin>>s>>w;
	if(w>=s)
		cout<<"unsafe";
	else
		cout<<"safe"; 
	return 0;
}


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

int keta(int);

int main() {
  int N,x,ans;

  cin >> N;

  for (int i=1; i<=N; i++) {
    x = keta(i);
    if (x%2 != 0) ++ans;
    }
    cout << ans << endl;
}

int keta(int num) {
  int count =0;
  while (num>0) {
    num/=10;
    ++count;
  }

  return count;
}


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

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

	int a, b, c;
	cin >> a >> b >> c;
	for (int i = 1; i <= 100; ++i){
		if ((b*i+c)%a == 0){
			cout << "YES" << "\n";
			return 0;
		}
	}
	cout << "NO" << "\n";
	return 0;
}

Measured memory_bytes: 256
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if(B==A):
    print("YES")
elif (B > A):
    if(B+W*T <= A+V*T):
        print("YES")
    else:
        print("NO")
else:
    if(B-W*T >= A-V*T):
        print("YES")
    else:
        print("NO")

Measured memory_bytes: 9196
#include<iostream>
using namespace std;
int main()
{
  char s1,s2,s3;
  int cnt=0;
  cin >>s1>>s2>>s3;
  if(s1=='1'){
    cnt++;
  }
  if(s2=='1'){
    cnt++;
  }
  if(s3=='1'){
    cnt++;
  }
  cout<<cnt<<endl;
}


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


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



	if(a != 1 && b != 1){
		cout << 1 << endl;
	}else if(a != 2 && b != 2){
		cout << 2 << endl;
	}else{
		cout << 3 << endl;
	}
}


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

int main() {
	
	char b;
	cin >>b;
	
	if(b=='A'){
		
		cout <<'T' <<endl;
		
	}
	if(b=='T'){
		
		cout <<'A' <<endl;
		
	}
	if(b=='C'){
		
		cout <<'G' <<endl;
		
	}
	if(b=='G'){
		
		cout <<'C' <<endl;
		
	}
	
}

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

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MOD 1000000007
#define endl '\n'
#define EPS 1e-9
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define SQ(a) (a)*(a)
#define debg(x) cout<<#x<<' '<<x<<endl;

typedef long long ll;
typedef unsigned long long ull;
typedef std::vector<int> vi;
typedef std::pair<int, int> pi;
typedef long double ld;
#define REP(i, a, b) for(ll i=a; i<b; ++i)

using namespace std;

int count_ones(int n){
	int ans = 0;
	while(n){
		if(n&1)
			ans++;
		n>>=1;
	}
	return ans;
}

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

bool is_coprime(ull a, ull b){
	if(gcd(a, b) == 1)
		return true;
	return false;
}

void print_vector_pair(auto &inv){
	for(auto x: inv)
		cout<<x.F<<' '<<x.S<<endl;
	cout<<endl;
}

void print_vector(auto &inv){
	for(auto x: inv)
		cout<<x<<' ';
	cout<<endl;
}

void print_vector_vector(auto sorted_by_x){
	for(auto x: sorted_by_x){
		for(auto i: x)
			cout<<i<<' ';
		cout<<endl;
	}
	
}

bool chk(auto a, auto b){
	int s = a.size();
	bool res = true;
	for(int i=0; i<s; ++i){
		if(a[i] != b[i])
			res = false;
	}
	return !res;
}

typedef struct cord{
	int x, y;
}cord;

long double dist(cord pt1, cord pt2){
	long double x = abs(pt1.x - pt2.x);
	long double y = abs(pt1.y - pt2.y);
	return sqrt((x*x*(ld)1) + (y*y*(ld)1));
}

std::vector<bool> v(10000000);

void sieve(){
	for(ll i=0; i<10000000; ++i)
		v[i] = true;	
	v[0] = false;
	v[1] = false;
	
	for(ll i=4; i<10000000; i+=2)
		v[i] = false;

	for(ll i=3; i<10000000; i+=2){
		if(v[i]){
			for(ll j=(2*i); j<10000000; j+=i)
				v[j] = false;
		}
	}

}

ull fact(int n){
	ull f[n+1] = {0};
	f[0] = 1;
	for(int i=1; i<=n; ++i){
		f[i] = i*f[i-1];
	}
	return f[n];
}

ull ncr(ull n, ull r){
	return ((ull)fact(n) / ((ull)fact(r) * (ull)(fact(n-r))));
}

ull choose(unsigned long long n, unsigned long long k) {
    if (k > n) {
        return 0;
    }
    unsigned long long r = 1;
    for (unsigned long long d = 1; d <= k; ++d) {
        r *= n--;
        r /= d;
    }
    return r;
}

ll binpow_without_recursion(ll a, ll b){ // faster than previous
	ll res = 1;
	while(b){
		if(b&1)
			res = res*a;
		a *= a;
		b >>= 1;
	}
	return res;
}
	
ll f(int l, int r, std::vector<ll> &a, std::vector<ll> &b){
	ll mul = 0;
	for(int i=l; i<=r; ++i)
		mul += a[i]*b[i];
	return mul;
}


int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//fast;
	int n;
	cin>>n;

	vi a(n, 0);
	vi dp(n, 0);

	REP(i, 0, n)	cin>>a[i];

	dp[1] = abs(a[1] - a[0]);

	for(int i=2; i<n; ++i){
		//debg(i);
	//	debg(abs(a[i-2] - a[i] + dp[i-2]));
	//	debg(abs(a[i-1] - a[i] + dp[i-1]));
		dp[i] = min(abs(a[i-2] - a[i]) + dp[i-2], abs(a[i-1] - a[i]) + dp[i-1]);
	//	cout<<endl;
	}
	//print_vector(dp);
	cout<<dp[n-1]<<endl;
	return 0;
}



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

int main() {
    ll k,a,b;
    cin>>k>>a>>b;
    ll q=1;
    for(ll i=a;i<=b;i++)
    {
        if(i%k == 0)
        {
            cout<<"OK";
            q=0;
            break;
        }
        
    }
    if(q) cout<<"NG";
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
const ll INF = 1LL << 60;
const double pi = acos(-1.0);

int main() {
    string s, t; cin >> s >> t;
    ll n = s.size(), m = t.size();
    ll ans = INF;
    rep(i, n-m+1) {
        string sub = s.substr(i, m);
        ll cnt = 0;
        rep(j, m) cnt += (sub[j] == t[j]);
        //cout << sub << ' ' << cnt << endl;
        chmin(ans, m-cnt);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3636
import java.util.*;
import java.util.function.Predicate;

public class Main {

    public static void main(String[] args) {
        new Main().run();
    }


    void run() {
        Scanner cin = new Scanner(System.in);
        int N = cin.nextInt();
        int K = cin.nextInt();
        System.out.println(dfs(N, K, 1));
    }

    // 残り回数、K、今の値を引数に持ち、この状態からの最小値を返す。
    int dfs(int remain, int K, int now){
        if(remain == 0) return now; //残り回数が0であれば、nowをそのまま返す。
        //残り回数が残っていれば、残り回数を1減らし、2倍したパターンと、Kを足したパターンの最小値を返す
        return Math.min(dfs(remain-1, K, now*2), dfs(remain-1, K, now + K));
    }
}


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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if(A+B+C>=22) cout << "bust" << endl;
  else cout << "win" << endl;
}

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

typedef long long ll;

int main(){
  int n,m,x;
  int c[14];
  int a[14][14];
  int i,j,k,l;
  ll min = 100100100;
  int sum[14];
  int flag = 0;
  ll value;

  scanf("%d %d %d", &n, &m, &x);

  for(i = 0;i < n;i++){
    scanf("%d", &c[i]);
    for(j = 0;j < m;j++) scanf("%d", &a[i][j]);
  }

  for(i = 0;i < (1 << n);i++){
    for(l = 0;l < m;l++) sum[l] = 0;
    flag = 0;
    value = 0;

    for(j = 0;j < n;j++){
      if(i & (1 << j)){
        for(k = 0;k < m;k++){
          sum[k] += a[j][k];
        }
        value += c[j];
      }
    }

    for(l = 0;l < m;l++){
      if(sum[l] < x){
        flag = 1;
      }
    }

    if(flag == 0){
      if(min > value) min = value;
    }
  }

  if(min == 100100100) printf("-1\n");

  else printf("%lld\n", min);

  return 0;
}

Measured memory_bytes: 1732
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　 |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/





int A, N, M;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A >> N >> M;

    int ans = 0;
    rep(ya, 1, 10101) {
        ll x = 1;
        rep(i, 0, N) x *= ya;
        if (M < x) break;

        int y = 0;
        while (x) {
            y += x % 10;
            x /= 10;
        }

        if (y + A == ya) ans++;
    }
    cout << ans << endl;
}



Measured memory_bytes: 3164
#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  int H, W;
  cin >> H >> W;

  string board[H];
  rep(i,H) cin >> board[i];

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

  rep(i,H){
    rep(j,W){
      if (board[i][j] == '#') continue;

      int num = 0;//爆弾が周囲8方向に隣接する個数
      rep(d,8){
        int newi = i + dx[d];//解説ではconst int になっているが？
        int newj = j + dy[d];

        if(newi < 0 || newi >= H) continue;
        if(newj < 0 || newj >= W) continue;
        if (board[newi][newj] == '#') num++;
      }
      board[i][j] = char(num + '0');
    }
  }
  rep(i,H) cout << board[i] << endl;
}


Measured memory_bytes: 3616
n,W=map(int,input().split())
w=[0]*n
v=[0]*n
for i in range(n):
    w[i],v[i]=map(int,input().split())
dp=[0]*(W+1)
for i in range(n):
    j=W
    while j>=w[i]:
        dp[j]=max(dp[j],dp[j-w[i]]+v[i])
        j-=1

print(dp[W])

Measured memory_bytes: 41452
package main

import (
	"bufio"
	. "fmt"
	"os"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	in := bufio.NewReader(os.Stdin)
	var n, k int
	Fscan(in, &n, &k)
	a := make([]int, n)
	for i := range a {
		Fscan(in, &a[i])
	}
	Print(sort.Search(1e9, func(l int) bool {
		if l == 0 {
			return false
		}
		c := 0
		for _, v := range a {
			c += (v - 1) / l
		}
		return c <= k
	}))
}


Measured memory_bytes: 5936
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <functional>
#include <string>
#include <stack>
#include <map>

using namespace std;
using ll = long long;
ll mod = 1e9 + 7;

ll calc(int a, ll b)
{
	if (b == 0)
		return 1;
	if (b % 2 == 0)
	{
		ll d = calc(a, b / 2);
		return (d * d) % mod;
	}
	else
	{
		return(a * calc(a, b - 1)) % mod;
	}
}
int main()
{
	int n;
	cin >> n;

	vector <int> imamade(n, 1);
	map<int, int> m;

	int last = 0;
	for (int i = 0; i < n; i++)
	{
		
		int c;
		cin >> c;
		if (i>0)
		{
			imamade[i] = imamade[i - 1];
		}
		if (last != c)
		{

			if (m[c] != 0)
			{
				imamade[i] += imamade[m[c] - 1];
			}

			m[c] = i + 1;
			last = c;
		}
		imamade[i] %= mod;
	}

	cout << imamade[n-1] << endl;

	return 0;
}

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

#define INF 2147483600

int main(){
  int n;
  cin>>n;
  vector<pair<long, long>> vec(n);
  rep(i,n) cin>>vec[i].se >> vec[i].fi;

  sort(all(vec), greater<pair<long,long>>());

  int l=0, r=n+1;
  while(r-l>1){
    int k = (r+l)/2;

    auto f = [&](){
      if(k==0) return true;
      // fi:b, se:a
      priority_queue<long> pq;
      long acc = 0;
      rep(i,k){
        pq.push(vec[i].se);
        acc += vec[i].se;
      }
      if(acc <= k*vec[k-1].fi) return true;
      repl(i,k,n){
        long mx = pq.top(); pq.pop();
        acc -= mx;
        pq.push(min(mx, vec[i].se));
        acc += min(mx, vec[i].se);

        if(acc <= k*vec[i].fi) return true;
      }
      return false;
    };

    if(f()) l = k;
    else r = k;
  }

  cout << l << endl;

  return 0;
}

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

int N,A,B,C;
vector<int> l(8);

int dfs(int k,int a,int b,int c){
	if(k==N){
		if(a>0 && b>0 && c>0) return abs(A-a)+abs(B-b)+abs(C-c)-30;
		else return 99999999;
	}
	int ans=dfs(k+1,a,b,c);
	ans=min(ans,dfs(k+1,a+l[k],b,c)+10);
	ans=min(ans,dfs(k+1,a,b+l[k],c)+10);
	ans=min(ans,dfs(k+1,a,b,c+l[k])+10);
	return ans;
}

int main(){
	cin >> N >> A >> B >> C;
	for(int i=0;i<N;i++)cin >> l[i];
	cout << dfs(0,0,0,0) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
constexpr int MOD = 1e9 + 7;

constexpr int MAX = 1001;
long long fac[MAX], inv[MAX], finv[MAX];
void CombInit(){
    fac[0] = inv[0] = finv[0] = 1;
    fac[1] = inv[1] = finv[1] = 1;
    for(int i=2; i<MAX; ++i){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}


int main() {
    int n, k; cin >> n >> k; 
    if(n > k) {
        cout << 0 << endl;
        return 0;
    }
    CombInit();
    cout << fac[k] * finv[k-n] % MOD << '\n';
    return 0;
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vs> vvs;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
using P = pair<ll,ll>;
#define REP(i, n) for (ll i = 0; i < (int)(n); i++)
#define RREP(i, n) for (ll i = (int)(n)-1; i > -1 ; i--)
#define IN(T, x) T x;cin >> x;
#define AIN(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i];}
#define A2IN(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) SORT(a);reverse(ALL(a))
#define pb push_back
#define mp make_pair
#define PF first
#define PS second
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T &val){fill( (T*)array, (T*)(array+N), val );}
#define OUT(x) cout << x << endl
#define BOUT(b) if(b){OUT("Yes");}else{OUT("No");}
const ll MOD = 100000007;
const ll INF = 10e9;
#define PI 3.14159265369;
ll dx[4] = {1,-1,0,0};
ll dy[4] = {0,0,1,-1};
ll ddx[8] = {1,1,1,-1,-1,-1,0,0};
ll ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main() {
  IN(ll,N);
  IN(string,S);
  string ans = "";
  REP(i,S.size()){
    int x = (int)(S.at(i) - 'A');
    x = (x+N)%26;
    ans.push_back((char)(x + (int)('A')));
  }
  OUT(ans);
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>
#include <utility>
#include <unordered_map>

using namespace std;
typedef long long int ll;

#define SP(x) setprecision((int)x)
#define SW(x) setw(x)    // 桁数指定
#define SF(c) setfill(c) // 埋め文字指定('0')
#define ALL(v) v.begin(), v.end()

int main(int argc, char const *argv[])
{
    ll n;
    cin >> n;
    map<ll, ll> m;
    for (ll i = 0; i < n; i++)
    {
        ll temp;
        cin >> temp;
        m[temp]++;
    }
    for (auto t : m)
    {
        if (t.second > 1)
        {
            cout << "NO" << endl;
            exit(0);
        }
    }
    cout << "YES" << endl;
}

Measured memory_bytes: 12800
#include<iostream>
#include<cmath>
#include<math.h>
using namespace std;

void kock(int n, double p1[2], double p2[2]){
    if(n==0){
        return;
    }
    double a[2], b[2], c[2];
    double rad = M_PI/3;
    a[0] = (2*p1[0] + p2[0])/3;
    a[1] = p1[1] + (p2[1]-p1[1])/3;
    c[0] = p2[0] - (p2[0]-p1[0])/3;
    c[1] = p2[1] - (p2[1]-p1[1])/3;
    b[0] = (c[0]-a[0])*cos(rad) - (c[1]-a[1])*sin(rad) + a[0];
    b[1] = (c[0]-a[0])*sin(rad) + (c[1]-a[1])*cos(rad) + a[1];
    
    kock(n-1, p1, a);
    cout << fixed << a[0] << " " << fixed << a[1] << endl;
    kock(n-1, a, b);
    cout << fixed << b[0] << " " << fixed << b[1] << endl;
    kock(n-1, b, c);
    cout << fixed << c[0] << " " << fixed << c[1] << endl;
    kock(n-1, c, p2);
}

int main(){
    int n;
    cin >> n;
    double p1[2] = {0, 0}, p2[2] = {100, 0};
    cout << fixed << p1[0] << " " << fixed << p1[1] << endl;
    kock(n, p1, p2);
    cout << fixed << p2[0] << " " << fixed << p2[1] << endl;
    return 0;
}


Measured memory_bytes: 3220
import java.util.*;
import java.io.*;

public class Main {
	double[] grade_500 = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
	double[] grade_1000 = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
	String[] grade = {"AAA", "AA", "A", "B", "C", "D", "E"};
	public void solve() throws IOException{
		while( stdIn.hasNext() ){
			double x = stdIn.nextDouble();
			double y = stdIn.nextDouble();
			int g1 = 7; int g2 = 7;
			for(int i = 0; i < 7; i++){
				if( x < grade_500[i] ){
					g1 = i;
					break;
				}
			}
			for(int i = 0; i < 7; i++){
				if( y < grade_1000[i] ){
					g2 = i;
					break;
				}
			}
			int index = Math.max(g1, g2);
			if( index == 7 ){
				writer.println("NA");
			} else {
				writer.println(grade[index]);
			}
				
		}
		writer.flush();
	} 
			
	public static void main (String args[]) throws IOException {
		new Main().run();
	}
	Scanner stdIn;
	PrintWriter writer;
	
	public void run() throws IOException{
		stdIn = null;
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			writer = new PrintWriter(System.out);
			solve();
			stdIn.close();
			writer.close();
		} catch (Exception e){
			e.printStackTrace();
			System.exit(1);
		}
	}
}

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

int main(){
  int k,n;
  cin >> k >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++) cin >> a.at(i);
  int tmp=a.at(0)+k-a.at(n-1);
  for(int i=1;i<n;i++){
    if(tmp < a.at(i)-a.at(i-1)) tmp = a.at(i)-a.at(i-1);
  }
  cout << (k-tmp) << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string>

#define FastIO 						\
		ios::sync_with_stdio(0); 	\
		cin.tie(NULL); 				\
		cout.tie(NULL);

using namespace std;

typedef long long ll;

void solve() {
	int t, d, s;
	cin >> d >> t >> s;
	if (t * s >= d) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
	
}

int main() {
	// FastIO;
	int n = 1;
	// cin >> n;
	while (n--) {
		solve();
	}
}


Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <string.h>
#include <set>
#include <map>
#include <assert.h>
#include <algorithm>
#include <queue>
#include <bitset>
#include <stack>
#include <chrono>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define ll long long
#define MOD 1000000007
#define INF 1000000000000000000
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
// Read the question carefully and see all the given sample tests
// Think about the correctness before implementing

int main()
{
	int n,m;
	cin >> n >> m;
	int a[m];
	map <int, int>ma;
	ll b[n+1];
	for(int i=0;i<m;i++)
	{	
		cin>>a[i];
		ma[a[i]]=1;
	}
	b[0]=1;
	if(ma[1]!=1)
	b[1]=1;
	else
	b[1]=0;
	for(int i=2;i<=n;i++)
	{
		if(ma[i]==1)
		b[i]=0;
		else
		b[i]=(b[i-1]+b[i-2])%MOD;
	}
	cout<<b[n]<<"\n";
}


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


int main(void){
  string s; cin >> s;
  int x = s.size();
  for(int i = 0; i < x; i++){
    if(i % 2 == 0 && s.at(i) != 'h'){
      cout << "No" << endl;
      return 0;
    }
    else if(i % 2 == 1 && s.at(i) != 'i'){
      cout << "No" << endl;
      return 0;
    }
  }
  if(s.at(x - 1) != 'i'){
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" <<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int dp[20005][100][5];
string s;
int n,k;
int Rec(int index,int zeros,bool flag){
    if(zeros > k)   return 0;
    if(index == n)
        return zeros == k;
    if(dp[index][zeros][flag] + 1)    return dp[index][zeros][flag];
    int Res  =0;
    int Limit = flag?9:s[index];
    for(int i =0; i<=Limit; i++){
        Res+=Rec(index+1,zeros + (i!=0),!flag && i == s[index]?0:1);
    }
    return dp[index][zeros][flag] = Res;
}

main()
{

    cin>>s>>k;
    n = s.length();
    for(int i = 0 ; i<n; i++)
        s[i] = s[i]-'0';
    memset(dp,-1,sizeof(dp));
    cout<<Rec(0,0,0);





    return 0;
}


Measured memory_bytes: 39296
#include<bits/stdc++.h>
using namespace std;
#define F(i,s,e) for(int i=s;i<e;++i)
#define ll long long

int main()
{
    int r;
    cin >> r;
    if(r < 1200)
        cout << "ABC" << endl;
    else if(r <2800)
        cout << "ARC" << endl;
    else
        cout << "AGC" << endl;
    return 0;
}

Measured memory_bytes: 256