akhauriyash/Code-Regression huggingface dataset:
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]
#![allow(deprecated)]

use std::cmp::*;
use std::collections::*;

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)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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")
    };
}

macro_rules! chmax {
    ($x:expr, $e:expr) => {
        if $x < $e {
            $x = $e;
        }
    };
}
macro_rules! chmin {
    ($x:expr, $e:expr) => {
        if $x > $e {
            $x = $e;
        }
    };
}

const INF: i64 = 1 << 60;

use std::ascii::AsciiExt;

fn alpha2num(c: char) -> usize {
    c.to_ascii_uppercase() as usize - 'A' as usize
}

fn shift_alpha(c: char, n: usize) -> char {
    let d = ((alpha2num(c) + n) % 26) as u8;
    (b'A' + d) as char
}

fn main() {
    input!{
        N: usize,
        S: chars,
    }
    let ans: String = S.into_iter().map(|c| shift_alpha(c, N)).collect();
    println!("{}", ans);
}


Measured memory_bytes: 4352
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

string S;
inline void solve(){
  IN(S);
  OUT(700+100*count(ALL(S),'o'));
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main() {
  string str;
  cin >> str;

  int q;
  cin >> q;

  string ord, p;
  int a = 0, b = 0;
  for (int i = 0; i < q; i++) {
    cin >> ord >> a >> b;

    if (ord == "print") {
      for (int j = a; j <= b; j++) {
	cout << str[j];
      }

      cout << endl;
    }

    if (ord == "reverse") {
      string tmp = str.substr(a, b-a+1);
      int n = tmp.size();
      for ( int j = 0; j < n; j++) {
	str[j+a] = tmp[n-j-1];
      }
    }

    if (ord == "replace") {
      cin >> p;
      str.replace(a,b-a+1,p);
    }
    
  }

  return 0;
}



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

#define ll long long
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MAX = 1e5 + 5;
int arr[MAX];

int main()
{
	IOS
	int t = 1;
	//cin >> t;
	while(t--)
	{
		char ch;
		cin >> ch;
		if(ch >= 97) cout << "a\n";
		else cout << "A\n";
	}
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

struct union_find {
    vector<int> parent; // parent. if the element itself is the parent, return -(the size of the group)

    union_find(int N) : parent(N) {
        parent = vector<int>(N, -1);
    }

    int root(int n) {
        if (parent[n] < 0) {
            return n;
        } else {
            return parent[n] = root(parent[n]);
        }
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) {
            return;
        }
        if (size_of(rx) < size_of(ry)) {
            swap(ry, rx);
        }
        parent[rx] += parent[ry];
        parent[ry] = rx;
    }

    bool same(int x, int y) {
        return root(x) == root(y);
    }

    int size_of(int n) {
        return -parent[root(n)];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M, K;
    cin >> N >> M >> K;
    union_find tree(N);
    vector<int> friends_count(N, 0);
    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        tree.unite(a, b);
        friends_count[a]++;
        friends_count[b]++;
    }
    vector<int> blocked(N, 0);
    for (int i = 0; i < K; i++) {
        int c, d;
        cin >> c >> d;
        c--;
        d--;
        if (tree.same(c, d)) {
            blocked[c]++;
            blocked[d]++;
        }
    }
    for (int i = 0; i < N; i++) {
        cout << tree.size_of(i) - friends_count[i] - blocked[i] - 1 << " ";
    }
    cout << "\n";
    return 0;
}


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

#define F first
#define S second
const long long mod = 1000000007;

unordered_map<int, int> mp;

int main() {
    int num, N;
    cin >> N;
    for(int i = 0;i < N;i++) {
        cin >> num;
        mp[num]++;
    }
    long long ans = 0;
    for(auto it = mp.begin();it != mp.end();it++) {
        if(it->first == it->second) {
            continue;
        }
        if(it->first < it->second) {
            ans += it->second-it->first;
        } else {
            ans += it->second;
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4260
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second > b.second; }

int main(){
    ll n;string s;cin>>n>>s;

    rep(i,s.size()){
        int abc=(s[i]-'A'+n)%26+'A';
        cout<<(char)abc;
    }
    cout<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <ctype.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long lint;


int main(){
    int n,m;
    cin >> n >> m;
    int a[n];
    int all=0;
    REP(i,n){
        cin >> a[i];
        all += a[i];
    }
    sort(a, a+n, greater<int>());
   
    
    REP(i,m){
     
        if(a[i]< all/(4.0*m)){
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
    return 0;
}


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

using namespace std;

typedef long long ll;
const int maxn = (int) 1e6 + 1;

int r, g, b, n, ans;
int main(){
    cin >> r >> g >> b >> n;
    for(int i = 0; i <= n / r; i++){
        for(int j = 0; j <= n / g; j++){
            int h = n - (r * i) - (j * g);
            if(h < 0){
                continue;
            }
            if(h % b == 0){
                ans++;
            }
        }
    }
    cout << ans;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;   
const int inf = (int) 1e9+7;
int n;
map<string,long long int> m;
int main(){
	fastIO;      	
	cin>>n;
	for(int i=0;i<n;i++){
		string x;
		cin>>x;
		sort(x.begin(),x.end());
		m[x]++;
	}
	long long int ans=0;
	for(auto x : m){
		ans+=((x.second*(x.second-1))/2);
	}
	cout<<ans<<'\n';
	return 0;
}

Measured memory_bytes: 11264
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {

    void solve() throws IOException {
        int k = ni(), s = ni();
        long ans = 0;
        for (int i = 0; i <= k; i++) {
            ans += Math.max(0, s - i + 1 - 2 * Math.max(0, s - i - k));
        }
        out.println(ans);
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    class INA {
        int[][] a;

        INA(int n, int m) throws IOException {
            this(n, m, -1);
        }

        INA(int n, int m, int t) throws IOException {
            a = new int[m][n];

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[j][i] = ni() + t;
                }
            }
        }

        int[] get(int i) {
            return a[i - 1];
        }
    }

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 8148
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>

using namespace std;


void solve() {
    int N, K; cin >> N >> K;
    map<char, int> score;
    cin >> score['s'] >> score['p'] >> score['r'];
    string T; cin >> T;

    int ans = 0;

    for (int i = 0; i < K; i++) {
        int j = i;
        ans += score[T[j]];
        char before = T[j];
        bool ok = false;

        j += K;

        while (j < N) {
            if (T[j] != before) {
                ans += score[T[j]];
                ok = false;
            }
            else {
                if (ok) ans += score[T[j]];
                ok = !ok;
            }
            before = T[j];
            j += K;
        }
    }

    cout << ans << endl;
}


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

Measured memory_bytes: 3772
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 4611686018427387903;
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

bool cmp(ll n, P const& p)
{
    return ((p.first > n));
}

int n;
VI a(1000100),b(1000100);
vector<vector<P>> d(5000000,vector<P>(0));
int boarder=2047;

void dfs(int v){
	if(v>=boarder||v>=n)
		return;
	if(v==0){
		d[v].push_back({b[v],a[v]});
		d[v].push_back({0,0});
	}
	else{
		for(auto p:d[(v+1)/2-1]){
			d[v].push_back({p.first+b[v],p.second+a[v]});
			d[v].push_back({p.first,p.second});
		}
	}
	if((v+1)*2<=n)
		dfs((v+1)*2-1);
	if((v+1)*2+1<=n)
		dfs((v+1)*2);
	sort(ALL(d[v]));
	ll mx=0;
	REP(i,d[v].size()){
		mx=max(mx,d[v][i].second);
		d[v][i].second=mx;
	}
}

int main(){
	cin >> n;
	REP(i,n) cin >> a[i] >> b[i];
	dfs(0);
	int q; cin >> q;
	ll v, l;
	while(q--){
		cin >> v >> l; v--;
		if(v<boarder){
			int it=upper_bound(d[v].begin(),d[v].end(),l,cmp)-d[v].begin();
			if(it==0)
				cout << 0 << endl;
			else
				cout << d[v][it-1].second << endl;
		}
		else{
			VI s(0);
			while(v>=boarder){
				s.push_back(v);
				v=(v+1)/2-1;
			}
			ll ans=0;
			REP(i,1<<s.size()){
				ll suma=0, sumb=0;
				REP(j,s.size()) if(i>>j&1){
					suma+=a[s[j]];
					sumb+=b[s[j]];
				}
				if(l-sumb<0)
					continue;
				int it=upper_bound(d[v].begin(),d[v].end(),l-sumb,cmp)-d[v].begin();
				if(it==0)
					ans=max(ans,suma);
				else
					ans=max(ans,suma+d[v][it-1].second);
			}
			cout << ans << endl;
		}
	}
	return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

template<typename T1,typename T2> inline void chmin(T1 &a, T2 b){ if(a > b) a = b; }
template<typename T1,typename T2> inline void chmax(T1 &a, T2 b){ if(a < b) a = b; }

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
const int MAX_N = 100010;

signed main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);

    int A, B, C, D;
    cin >> A >> B >> C >> D;

    int taka = A / D;
    if(A % D != 0) { taka++; }
    int ao = C / B;
    if(C % B != 0) { ao++; }

    if(taka >= ao) { printf("Yes\n"); }
    else { printf("No\n"); }

    return 0;
}


Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <iomanip>
#include <utility>
  
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
using namespace std;
      
int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n,p[10],q[10];
  cin>>n;
  rep(i,n){
    cin>>p[i];
  }
  rep(i,n){
    cin>>q[i];
  }

  int nasu=1;
  reps(i,n){
    nasu*=i;
  }

  int pans=0,qans=0;
  bool out[2][10]={false};
  pans+=nasu/n*(p[0]-1);
  qans+=nasu/n*(q[0]-1);
  out[0][p[0]]=true;
  out[1][q[0]]=true;
  nasu/=n;
  
  for(int i=1;i<=n-1;i++){
    int sum=1;
    reps(j,p[i]){
      if(!out[0][j]){
	sum++;
      }
    }
    pans+=nasu/(n-i)*sum;
    out[0][p[i]]=true;

    sum=1;
    reps(j,q[i]){
      if(!out[1][j]){
	sum++;
      }
    }
    qans+=nasu/(n-i)*sum;
    out[1][q[i]]=true;
    
    nasu/=(n-i);
  }
  cout<<abs(pans-qans)<<'\n';
  return 0;
}


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

int main(){
    int n;
    cin >> n;
    double p = 0;

    for(int i = 0; i < n; ++i){
        int a;
        cin >> a;
        p += 1.0/(double)a;
    }

    double ans = 1/p;

    cout << fixed << setprecision(15) << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    string s;
    cin >> s;
    if(s=="SAT"){
        cout<<1;
    }else if(s=="FRI"){
        cout<<2;
    }else if(s=="THU"){
        cout<<3;
    }else if(s=="WED"){
        cout<<4;
    }else if(s=="TUE"){
        cout<<5;
    }else if(s=="MON"){
        cout<<6;
    }else if(s=="SUN"){
        cout<<7;
    }
}



Measured memory_bytes: 888
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>
#include <set>
#include <list>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;

int main()
{
	int N;
	int a[1000];
	cin >> N;
	for(int i = 1; i <= N; i++){
		cin >> a[i];
	}
	
	int ans = 0;
	for(int i = 1; i <= N; i++){
		if(i % 2 == 1 && a[i] % 2 == 1){
			ans++;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3564
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll P = 1e9+7;
const ll N = 2e5+7;

vector<ll> g[N];
vector<ll> vis(N);

void dfs(ll node, ll mark){
	vis[node] = mark;

	for(auto &x : g[node]){
		if(!vis[x]){
			dfs(x,mark);
		}
	}
}


int main(){

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	ll t=1;
	// cin>>t;

	while(t--){
		ll n,m;
		cin>>n>>m;

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

		vector<ll>hash(n+7);
		a = 1;
		for(ll i=1;i<=n;++i){
			if(!vis[i]) dfs(i,a++);
		}

		for(auto &x : vis) hash[x]++;
		a = 0;
		for(ll i=1;i<=n;++i) a = max(a,hash[i]);

		cout<<a<<"\n";

	}	

	return 0;
}	

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

int main() {
	string s;
	cin >> s;
	sort(s.begin(), s.end());
	if (s.at(0) == s.at(1) && s.at(1) != s.at(2) && s.at(2) == s.at(3)) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 256
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	#n = int(input())
	#b , c = tin()
	#s = input()
	s=input()
	pre='C'
	ret = 0
	a_num=0
	for c in s:
		d = pre + c
		if d == 'AA':
			a_num += 1
		elif d == 'BA':
			a_num=1
		elif d == 'CA':
			a_num += 1
		elif d == 'AB':
			pass
		elif d== 'BB':
			a_num = 0
		elif d == 'CB':
			pass
		elif d == 'AC':
			a_num = 0
		elif d == 'BC':
			ret += a_num
		else:
			a_num = 0
		
		pre = c
	return ret
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 73748
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll,ll> pl;
typedef vector<pl> vpl;
int main() {
	ios::sync_with_stdio(0);
	ll k,x,y;
	cin >> k >> x >> y;
	bool rx = false,ry = false,sw = false;
	if(x < 0) {x *= -1;rx = true;}
	if(y < 0) {y *= -1;ry = true;}
	if(x < y) {swap(x,y);sw = true;}
	ll d = x+y;
	if(!(k%2)) {
		if(d%2) {
			cout << "-1\n";
			return 0;
		}
	}
	vpl res;
	if((d%2) && (d<k)) {
		res.push_back({x,x-k});
		res.push_back({x+(k+x-y)/2,x-(k+x-y)/2});
		res.push_back({x,y});
	} else {
		ll bs;
		if((d < k) && (!(d%2))) {
			bs = 2;
		} else {
			ll bt = (k-(d%k))%k;
			if(!(bt%2)) {
				bs = (d+k-1)/k;
			} else {
				bs = (d+k-1)/k+1;
			}
		}
		ll a = 0,b = 0;
		ll dec = (d-bs*k)/2;
		while(b-k >= dec) {
			b -= k;
			res.push_back({a,b});
		}
		if(b > dec) {
			a += k-(b-dec);
			b = dec;
			res.push_back({a,b});
		}
		while(a+k <= x) {
			a += k;
			res.push_back({a,b});
		}
		if(a < x) {
			b += k-(x-a);
			a = x;
			res.push_back({a,b});
		}
		while(b+k <= y) {
			b += k;
			res.push_back({a,b});
		}
	}
	cout << res.size() << '\n';
	for(int i=0;i<res.size();i++) {
		if(sw) {swap(res[i].first,res[i].second);}
		if(rx) {res[i].first *= -1;}
		if(ry) {res[i].second *= -1;}
		cout << res[i].first << " " << res[i].second << '\n';
	}
}


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

ll dp[1001][2][4];

string NN;
ll KK;
int rec(int k = 0, bool tight = true, ll sum = 0){
    //cout<<k<<endl;
  if (sum > 3) {
    return 0;
  }
  if (k == NN.size()) {
    return sum == KK;
  }

  int x = NN[k] - '0';
  int r = (tight ? x : 9);

  ll &res  = dp[k][tight][sum];
  if (~res) return res;
  res = 0;

  for (int i = 0; i <= r; ++i) {
    res += rec(k + 1, tight && i == r, sum + (i == 0 ? 0 : 1));
  }
  return res;
}

void solve(string N, long long K){
    NN = N;
    KK = K;
    rec();
    /*
    for(int i = 0;i < NN.size();i++){
        for(int j = 0;j < K+1;j++){
            cout<<dp[i][1][j]<<" ";
        }
        cout<<endl;
    }
    */
    cout<<dp[0][1][0]<<endl;
}

int main(){
    string N;
    cin >> N;
    long long K;
    scanf("%lld",&K);
    memset(dp, -1, sizeof(dp));

    solve(N, K);
    return 0;
}


Measured memory_bytes: 256
x,y,z,k = map(int,input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

a.sort(reverse=True),b.sort(reverse=True),c.sort(reverse=True)
ab = []
for i in range(x):
  for j in range(y):
    ab.append(a[i]+b[j])
ab.sort(reverse=True)
ab = ab[0:k]
abc = []
for i in ab:
  for j in c:
    abc.append(i+j)
abc.sort(reverse=True)
abc = abc[0:k]
for i in abc:
  print(i)

Measured memory_bytes: 151388
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007
#define llMAX 9223372036854775807
#define llMIN -9223372036854775808
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける

ll n,k,x,y;

int main(){
  ll ans=0;
  cin >> n ;
  n=n%10;
  if (n==3){
    cout<<"bon"<<endl;
    return 0;
  }

  if ((n==0)|(n==1)|(n==6)|(n==8)){
    cout<<"pon"<<endl;
    return 0;
  }
  
  
    cout<<"hon"<<endl;
    return 0;
  
  return 0;
}






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

int main(void)
{
        int N, T;
        cin >> N >> T;

        int c[N], t[N];
        int min_c = 10000;
        for (int i = 0; i < N; ++i) {
                cin >> c[i] >> t[i];
        }

        for (int i = 0; i < N; ++i) {
                if (t[i] <= T && c[i] < min_c)
                        min_c = c[i];
        }

        if (min_c == 10000)
                cout << "TLE" << endl;
        else
                cout << min_c << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int mod=1000000007;
inline void add(int &x,int y){(x+=y)>=mod?x-=mod:0;}
inline int kpow(int a,int b)
{
	int s=1;
	for(;b;b>>=1,a=1ll*a*a%mod)
		if(b&1)s=1ll*s*a%mod;
	return s;
}
int jc(int x)
{
	int s=1;
	for(int i=2;i<=x;++i)s=1ll*s*i%mod;
	return s;
}
int n,k,m,cnt,ans,f[25050][410],g[25050][410],a[25050],last[410];
bool vis[410];
int main()
{
	scanf("%d %d %d",&n,&k,&m);
	ans=1ll*(n-m+1)*kpow(k,n-m)%mod;
	int r=0;
	bool ok=0;
	for(int i=1;i<=m;++i)
	{
		scanf("%d",&a[i]);
		r=max(r,last[a[i]]+k);
		last[a[i]]=i;
		if(r==i)ok=1;
		if(!vis[a[i]])vis[a[i]]=1,++cnt;
	}
	if(ok);
	else if(cnt==m)
	{
		f[0][0]=1;
		for(int i=1;i<=n;++i)
		{
			int sf=0,sg=0;
			for(int j=k-1;j;--j)
			{
				add(sf,f[i-1][j]);
				add(sg,g[i-1][j]);
				add(f[i][j],sf);
				add(g[i][j],sg);
				if(j)f[i][j]=(f[i][j]+1ll*f[i-1][j-1]*(k-j+1))%mod,g[i][j]=(g[i][j]+1ll*g[i-1][j-1]*(k-j+1))%mod;
				if(j>=m)add(g[i][j],f[i][j]);
			}
		}
		int res=0;
		for(int i=1;i<k;++i)add(res,g[n][i]);
		ans=(ans+1ll*(mod-res)*jc(k-m)%mod*kpow(jc(k),mod-2))%mod;
	}
	else
	{
		memset(vis,0,sizeof(vis));
		for(int i=1;i<=m;++i)
			if(vis[a[i]]){f[0][i-1]=1;break;}
			else vis[a[i]]=1;
		memset(vis,0,sizeof(vis));
		for(int i=m;i;--i)
			if(vis[a[i]]){g[0][m-i]=1;break;}
			else vis[a[i]]=1;
		for(int i=1;i<=n;++i)
		{
			int sf=0,sg=0;
			for(int j=k-1;j;--j)
			{
				add(sf,f[i-1][j]);
				add(sg,g[i-1][j]);
				add(f[i][j],sf);
				add(g[i][j],sg);
				if(j)f[i][j]=(f[i][j]+1ll*f[i-1][j-1]*(k-j+1))%mod,g[i][j]=(g[i][j]+1ll*g[i-1][j-1]*(k-j+1))%mod;
			}
		}
		int res=0;
		for(int i=1;i<=n-m+1;++i)
		{
			int sf=0,sg=0;
			for(int j=1;j<k;++j)add(sf,f[i-1][j]),add(sg,g[n-m+1-i][j]);
			res=(res+1ll*sf*sg)%mod;
		}
		add(ans,mod-res);
	}
	printf("%d",ans);
	return 0;
}


Measured memory_bytes: 80384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  ll temp = 0;
  ll ans = 0;
  rep(i,n){
    if(i == 0) temp = a[i];
    if(i > 0){
      if(a[i] < temp){
        ans += temp - a[i];
      }
      if(temp <= a[i]){
        temp = a[i];
      }
    }
  }
  cout << ans << endl;
}

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

using namespace std;

const int N = 3000;

int n;
long double prob[N];
long double dp[N][N];

long double rec(int cur, int cnt) {
  if(cur == n) return cnt > (n - cnt);
  long double& cc = dp[cur][cnt];
  if(cc != -1) return cc;
  cc = rec(cur + 1, cnt + 1) * prob[cur] +
       rec(cur + 1, cnt) * (1 - prob[cur]);
  return cc;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cin >> n;
  for(int i = 0; i < N; ++i)
    for(int j = 0; j < N; ++j)
      dp[i][j] = -1;
  for(int i = 0; i < n; ++i)
    cin >> prob[i];
  cout << fixed << setprecision(15);
  cout << rec(0, 0) << "\n";
}

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

int main(){
	long long a, b, k;
	cin >> a >> b >> k;
	long long  q = k;
	if (k > a) {
		q -= a;
		a = 0;
	}
	else {
		a = a - q;
		q = 0;
	}
	if (q > b) {
		q = q - b;
		b = 0;
	}
	else {
		b = b - q;
		q = 0;
	}
	cout << a << " " << b << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <vector>
#include <stack>
#include <functional>
#include <numeric>
#include <complex>
#include <queue>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <unordered_set>
#include <assert.h>
#include <cstring>
#include <sstream>
#include <string>
#include <algorithm>
#include <iostream>
 
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define X first
#define Y second
#define pb(x) push_back(x)
#define FOR(k, n) for (int k = 0; k < n; k++)
#define FORN(k, s, n) for (int k = s; k < n; k++)
#define debug(x) printf("x = %d\n", x);
#define debug2(x, y) printf("x = %d, y = %d\n", x, y);
#define debug3(x, y, z) printf("x = %d, y = %d, z = %d\n", x, y, z);
#define debug4(x, y, z, t) printf("x = %d, y = %d, z = %d, t = %d\n", x, y, z, t);
 
#pragma warning(disable : 6031)
#pragma warning(disable : 4101)
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
typedef complex<double> cd;
 
const int INF = 1e9;
const long long LINF = 1e18;
const double PI = acos(-1);
 
// Solution

int n;

int main() {
    scanf("%d", &n);

    printf("%d\n", n * n * n);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(long long (i)=0, i_bound = (long long)(n); (i)<i_bound; ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
signed main(){
    ll a;
    string s; cin>>a>>s;
    if(a>=3200) cout <<s <<endl;
    else cout << "red" <<endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
sign = 1
mountain, valley = [], []
for i in range(N-1):
  if A[i] < A[i+1]:
    valley.append(0)
    break
  elif A[i] > A[i+1]:
    mountain.append(0)
    break
for i in range(N-1):
  if A[i] > A[i+1]:
    if sign == 1:
      mountain.append(i)
      sign = -1
  elif A[i] < A[i+1]:
    if sign == -1:
      valley.append(i)
      sign = 1
for i in range(N-1, 0, -1):
  if A[i-1] < A[i]:
    mountain.append(N-1)
    break
  elif A[i-1] > A[i]:
    valley.append(N-1)
    break
M = 1000
kb = 0
lm, lv = len(mountain), len(valley)
for i in range(lv):
  flg = True
  cnt = i
  while flg:
    if cnt >= lm:
      flg = False
      break
    elif cnt < lm:
      if mountain[cnt] < valley[i]:
        cnt += 1
      else:
        break
  if flg:
    kb += (M // A[valley[i]])
    M -= (M // A[valley[i]]) * A[valley[i]]
    M += kb * A[mountain[cnt]]
    kb = 0
print(M)

Measured memory_bytes: 9120
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int K = scan.nextInt();
		int X = scan.nextInt();

		for(int i = X - K + 1; i < X + K; i++) {
			if(i < X + K -1) {
				System.out.print(i + " ");
			}else {
				System.out.println(i);
			}
		}

	}
}

Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)
#define RREP(i, n) for(int i = (n)-1; i >= 0; --i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.1415926
#define coutdb cout<<fixed<<setprecision(15)

const int dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;

// typedef int_fast64_t ll;
#define int int_fast64_t

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};
typedef pair<int, INTP> edge;

struct UnionFind {
  vector<int> par;

  UnionFind(int size) : par(size, -1){}
  void init(int n){ par.assign(n, -1); }

  int find(int x){
    if(par[x] < 0) return x;
    else return par[x] = find(par[x]);
  }
  bool same(int x, int y){
    return find(x)==find(y);
  }
  bool unite(int x, int y){
    x = find(x); y = find(y);
    if(x == y) return 0;
    if(par[x] > par[y]) swap(x, y);
    par[x] += par[y];
    par[y] = x;
    return 1;
  }
  int size(int x){
    return -par[find(x)];
  }
};

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

  int N; cin >> N;
  vector<INTP> X(N), Y(N);
  pque<edge, vector<edge>, greater<edge>> que;
  REP(i, N){
    int x, y; cin >> x >> y;
    X[i] = {x, i}; Y[i] = {y, i};
  }
  sort(ALL(X)); sort(ALL(Y));
  REP(i, N-1){
    que.push({X[i+1].first-X[i].first, {X[i].second, X[i+1].second}});
    que.push({Y[i+1].first-Y[i].first, {Y[i].second, Y[i+1].second}});
  }
  UnionFind uf(N);
  int cnt = 0, ans = 0;
  while(cnt < N-1){
    edge e = que.top(); que.pop();
    int va = e.second.first, vb = e.second.second;
    if(!uf.same(va, vb)){
      cnt++;
      ans += e.first;
      uf.unite(va, vb);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 11632
def WF(lenV,E):
	D = E
	r = range(lenV)
	for k in r:
		for i in r:
			for j in r:
				D[i][j] = min(D[i][j], D[i][k]+D[k][j])
	return D
				
IN = input().split()
H = int(IN[0])
W = int(IN[1])
R = range(10)
E = [[float("inf") for i in R] for j in R]
for i in R:
	IN = input().split()
	for j in R:
		E[i][j] = int(IN[j])
D = WF(10,E)
C = [D[i][1] for i in R]
Ans = 0
for h in range(H):
	IN = input().split()
	for w in range(W):
		wall = int(IN[w])
		Ans += C[wall] if wall>=0 else 0
print(Ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main ()
{
  int n,k;
  cin>>n>>k;
  vector<int> a;
  int temp;
  for(int i=0;i<n;i++) 
  {
      cin>>temp;
      a.push_back(temp);
  }
  sort(a.begin(),a.end());
  int i;
  for(i=0;i<n;i++)
  {
      if(a[i]>=k) break;
  }
  cout<<a.size()-i<<endl;
  return 0;
}

Measured memory_bytes: 892
#include<stdio.h>
#include<stack>
#include<queue>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
using namespace std;
int main()
{
	int a,b;
	char k;
	scanf("%d %c %d",&a,&k,&b);
	if(k=='+')
	printf("%d\n",a+b);
	else 
	printf("%d\n",a-b);	
	return 0;
}

Measured memory_bytes: 128
// ARC098B.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 2e5 + 200;

int n, ai[MAX_N], bits[20][MAX_N];
long long ans;

int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]);
    for (int i = 1; i <= n; i++)
        for (int j = 0; j < 20; j++)
            bits[j][i] = bits[j][i - 1] + ((ai[i] >> j) & 1);
    for (int i = 1; i <= n; i++)
    {
        int l = 1, r = i, res;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            bool flag = true;
            for (int j = 0; j < 20; j++)
                flag &= bits[j][i] - bits[j][mid - 1] <= 1;
            if (flag)
                r = mid - 1, res = mid;
            else
                l = mid + 1;
        }
        ans += i - res + 1;
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 16640
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;

const int MAXL(3000);
int flag[MAXL + 50][MAXL + 50];
int dp[MAXL + 50][MAXL + 50];
string s1, s2;

void LCS() {
    memset(dp, 0, sizeof(dp));
    memset(flag, 0, sizeof(flag));
    int m = s1.size(), n = s2.size();
    for (int i = 1; i <= m; ++i) {
        for (int j = 1; j <= n; ++j) {
            if (s1[i - 1] == s2[j - 1]) {
                dp[i][j] = dp[i - 1][j - 1] + 1;
                flag[i][j] = 0;
            }
            else if (dp[i - 1][j] >= dp[i][j - 1]) {
                dp[i][j] = dp[i - 1][j];
                flag[i][j] = 1;
            }
            else {
                dp[i][j] = dp[i][j - 1];
                flag[i][j] = -1;
            }
        }
    }
}

void printlcs(int i, int j ) {
    if (i == 0 || j == 0) return;
    if (flag[i][j] == 0) {
        printlcs(i - 1, j - 1);
        cout << s1[i - 1];
    }
    else if (flag[i][j] == 1) {
        printlcs(i - 1, j);
    }
    else printlcs(i, j - 1);
}

int main() {
    cin >> s1 >> s2;
    LCS();
    printlcs(s1.size(), s2.size());
}

Measured memory_bytes: 73088
N = int(input())
A = [int(input()) for i in range(N)]
turn_off_button = 0
count = 0
while True:
  count += 1
  light = A[turn_off_button]
  if light == 2:
    print(count)
    break
  elif count >= N:
    print(-1)
    break
  turn_off_button = light - 1

Measured memory_bytes: 7084
n,k,q=map(int,input().split())
s=[]
for _ in range(q):
    s.append(int(input()))
t=[k-q]*n
for i in range(q):
    t[s[i]-1]+=1
for i in range(n):
    if t[i]>0:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 80960
n = int(input())
h = list(map(int,input().split()))

#連続して0以上の部分を見つける。
#それらの中で一番少ないやつに合わせて全体を引く。
#0のやつが出てくる。それに合わせてまた同じことを繰り返せばできる？
#単調増加している部分とそうでない部分で操作が変わる？0になる部分が端っこじゃない

#隣のやつとの差を足していくだけでええわ。隣のやつとはつながってるから、
ans = h[0]
for i in range(1,n):
  if h[i]-h[i-1] >= 0:
    ans += h[i]-h[i-1]
print(ans)
  

Measured memory_bytes: 38384
#include "bits/stdc++.h"

#pragma warning(disable:4996)
using namespace std;
using ld = long double;
ld eps=1e-9;
#define Seg_Max_N (1<<18) 

using Value = pair<bool, long long int>;
const Value ini = make_pair(false,0);
struct segtree {
	int N;
	vector<Value>dat;

	segtree() {}
	segtree(int n) :dat(2 * Seg_Max_N) {
		N = 1;
		while (N < n) N *= 2;
		for (int i = 0; i < 2 * N - 1; i++) {
			dat[i] = ini;
		}
	}
	Value connect(const Value&l, const Value&r) {
		if (l.first) {
			if (r.first) {
				return make_pair(false,r.second-l.second);
			}
			else {
				return make_pair(true,l.second+r.second);
			}
		}
		else {
			if (r.first) {
				return make_pair(true,r.second-l.second);
			}
			else {
				return make_pair(false,l.second+r.second);
			}
		}
	}
	// update k th element
	void update(int k, Value a) {
		k += N - 1;
		dat[k] = a;

		while (k > 0) {
			k = (k - 1) / 2;
			const Value al(dat[k * 2 + 1]);
			const Value ar(dat[k * 2 + 2]);
			dat[k] = connect(al, ar);
		}
	}
	// min [a, b)
	Value  query(int a, int b) { return query(a, b, 0, 0, N); }
	Value  query(int a, int b, int k, int l, int r) {
		if (r <= a or b <= l) return ini;
		if (a <= l and r <= b) return dat[k];
		const int m = (l + r) / 2;
		const Value al(query(a, b, k * 2 + 1, l, m));
		const Value ar(query(a, b, k * 2 + 2, m, r));
		return connect(al, ar);
	}
};
int main() {
	int K,N,Q;cin>>K>>N>>Q;
	segtree seg(N);
	for (int i = 0; i < N; ++i) {
		int a;cin>>a;
		if(a)seg.update(i,make_pair(false,a));
		else seg.update(i,make_pair(true,0));
	}
	for (int i = 0; i < Q; ++i) {
		int a,b;cin>>a>>b;
		a--;b--;
		Value va=seg.query(a,a+1);
		Value vb=seg.query(b,b+1);
		seg.update(a,vb);
		seg.update(b,va);

		auto ans=seg.query(0,N);
		long long int num=0;
		if (ans.first) {
			num=(ans.second+(1ll<<30)*K)%K;
			num=-num;
			num--;
		}
		else {
			num=(-ans.second+(1ll<<30)*K)%K;
			num++;
		}
		cout<<num<<endl;
	}
	return 0;
}


Measured memory_bytes: 11032
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n); i >= 0; i--)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
const long long MOD = 1000000007;
typedef long long ll;

int main(){
	int N;
	cin >> N;
	ll ans = 0;
	rep(i, N){
		int A;
		cin >> A;
		ans += (A - 1);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

//#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector<vector<int>> mat;
//typedef unsigned int uint;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int N, K;
	pair<int, int> D;
	int mina = INF;
	int a;

	cin >> N >> K;
	K--;
	rep(i, 0, N)
	{
		cin >> a;
		if (chmin(mina, a))
		{
			D.first = i;
			D.second = N - i - 1;
		}
	}


	cout << (D.first+D.second+K-1)/K << endl;

	return 0;
}

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

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

#define roop(i, n) for(int i = 0;i < n;i++)

int main(void){

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

    bool ok = false;

    for(int i = a;i <= b;i++){
        if(i % k == 0) ok = true;
    }

    cout << (ok? "OK" : "NG") << endl;

    return 0;
}

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

#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'
#define all(x) x.begin(), x.end()
#define arr array

template<typename T> void umin(T& a,T b){a = min(a,b);}
template<typename T> void umax(T& a,T b){a = max(a,b);}

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
using vvll = vector< vector<ll> >;
using vll = vector<ll> ;
using pll = pair<ll, ll> ;

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e15;

ll fast(ll x,ll y){
    ll res=1;
    while(y){
        if(y&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        y >>= 1;
    }
    return res;
}

ll inv(ll n){
    return fast(n,mod-2);
}

void pre(){


    
}

void solve(){

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

int32_t main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input00.txt","r",stdin);
    // #endif
    IOS;
    pre();
    ll T = 1;
    //cin>>T;
    while(T--){
        solve();   
    }
    return 0;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
void Main(){
    const ll mod=1e9+7;
    int n,ans=0;cin>>n;
    ll dp[100][4][4][4];//ATGC
    For(j,0,4){
        For(k,0,4){
            For(l,0,4){
                dp[2][j][k][l]=1;
            }
        }
    }
    dp[2][0][2][3]--;
    dp[2][0][3][2]--;
    dp[2][2][0][3]--;
    For(i,3,n){
        For(j,0,4){
            For(k,0,4){
                dp[i][j][k][0]=(dp[i-1][0][j][k]+dp[i-1][1][j][k]+dp[i-1][2][j][k]+dp[i-1][3][j][k])%mod;
                dp[i][j][k][1]=(dp[i-1][0][j][k]+dp[i-1][1][j][k]+dp[i-1][2][j][k]+dp[i-1][3][j][k])%mod;
                if(j==0&&k==3){//ACG
                    dp[i][j][k][2]=0;
                }
                else{
                    dp[i][j][k][2]=(dp[i-1][0][j][k]+dp[i-1][1][j][k]+dp[i-1][2][j][k]+dp[i-1][3][j][k])%mod;
                }
                if((j==0&&k==2)||(j==2&&k==0)){//AGC,GAC
                    dp[i][j][k][3]=0;
                }
                else if(j==2){
                    dp[i][2][k][3]=(dp[i-1][1][2][k]+dp[i-1][2][2][k]+dp[i-1][3][2][k])%mod;
                }
                else if(k==2){
                    dp[i][j][2][3]=(dp[i-1][1][j][2]+dp[i-1][2][j][2]+dp[i-1][3][j][2])%mod;
                }
                else{
                    dp[i][j][k][3]=(dp[i-1][0][j][k]+dp[i-1][1][j][k]+dp[i-1][2][j][k]+dp[i-1][3][j][k])%mod;
                }
            }
        }       
    }
    For(i,0,4){
        For(j,0,4){
            For(k,0,4){
                ans+=dp[n-1][i][j][k];
                ans%=mod;
            }
        }
    }
    cout<<ans%mod<<endl;
}
int main(){
    Main();
    return 0;
}

Measured memory_bytes: 384
n,k=map(int, input().split())
def cmb(n, r, p):
  if (r < 0) or (n < r):
    return 0
  r = min(r, n - r)
  return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 2000  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p) 階乗のmod
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
 
for i in range(2, N + 1):
  fact.append((fact[-1] * i) % p)
  inv.append((-inv[p % i] * (p // i)) % p)
  factinv.append((factinv[-1] * inv[-1]) % p)

for i in range(k):
    ans=(cmb(k-1,i,p)*cmb(n-k+1,i+1,p))%p
    print(ans)

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

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            String st = br.readLine();
            String[] s = st.split(" ",0);
            int a = Integer.parseInt(s[0]);
            int  b = Integer.parseInt(s[2]);
             String plus = "+";
             String sub = "-";
            if(s[1].equals(plus)){
                int c = a+b;
                System.out.println(c);
            }else if(s[1].equals(sub)){
                int c = a-b;
                System.out.println(c);
            }
        }catch(Exception ex){
            System.exit(0);
        }
    }
}

Measured memory_bytes: 8148
X,N=map(int, input().split())
p=list(map(int, input().split()))

ans1=100
ans=0
if N==0:
    print(X)
else:
    for i in range(102):
        if i in p:
            continue
        elif abs(X-i)<ans1:
            ans =i
            ans1 = abs(X-i)
    print(ans)

Measured memory_bytes: 9076
/*
    ThunderClap and Flash.
    Raunaq Singh
*/
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define ThunderClap ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
#define debugg(something)   cout<<#something<<" - "<<something<<"\n";
#define vi vector
#define umap unordered_map
#define uset unordered_set
#define mset multiset
#define LB lower_bound
#define UB upper_bound
#define mp make_pair
#define pb push_back
#define in insert
#define s second
#define f first
#define pQueue priority_queue
#define maxElement *max_element
#define minElement *min_element
#define MAX 100000LL
#define mod 1000000007LL
#define inf 1000000000000000000LL
#define mI2 500000004LL
inline ll add(ll a, ll b){ return ((a%mod)+(b%mod))%mod;}
inline ll mul(ll a, ll b){ return ((a%mod)*(b%mod))%mod;}
inline ll sub(ll a, ll b){ return ((a%mod)-(b%mod)+mod)%mod;}

void Flash(){
    ll n,a,b;
    cin>>n>>a>>b;
    ll ans=(a*(n/(a+b)));
    n%=(a+b);
    ans+=(min(a,n));
    cout<<ans<<"\n";
}

int main(int argc, char const *argv[]){
    ThunderClap;
    ll t=1;
    //cin>>t;
    for(ll i=1;i<=t;i++){
        //cout<<"Case #"<<i<<": ";
        Flash();
    }
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>

typedef long long int lli;
int main(void) {
    lli n, res = 0;
    scanf("%llu",&n);

    for(lli i=1; i*i<n; i++) {
        lli a = n/(i+1)+1, b= n/i;
        if(a>b) break;
        lli k = b-1;
        if(n/k == n%k)
            res+=k;
    }

    printf("%llu\n", res);
}

Measured memory_bytes: 128
if __name__=="__main__":
    a, b = list(map(int, input().split(" ")))
    if(a==1):
        a = 14
    if(b==1):
        b = 14
    if(a > b):
        print("Alice")
    elif(a == b):
        print("Draw")
    else:
        print("Bob")

Measured memory_bytes: 3060