akhauriyash/Code-Regression huggingface dataset:
use std::io;

#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split(' ')
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

fn main() {

    let (a, b, x) = {
        let i = read::<isize>();
        (i[0], i[1], i[2])
    };

    if a <= x && x <= a + b {
        println!("YES");
    } else {
        println!("NO");
    }
}

Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;

const ll INF = 1e18L + 5;

void min_self(ll& a, ll b){
    a = min(a,b);
}
int main(){
    int n,w;
    scanf("%d%d",&n,&w);
    vector<int> weight(n),value(n);
    for (int i = 0; i < n ; ++i) {
        scanf("%d%d",&weight[i],&value[i]);
    }

    int sum_value = 0;
    for(int x : value){
        sum_value += x;
    }
    vector<ll> dp(sum_value + 1, INF);
    dp[0] = 0;

    for (int item = 0; item < n ; ++item) {
        for (int value_already = (sum_value - value[item]); value_already >= 0; --value_already) {
           min_self(dp[value_already + value[item]], dp[value_already] + weight[item]);
         }
    }

    ll ans = 0;
    for (int i = 0; i <= sum_value ; ++i) {
        if(dp[i] <= w) {
            ans = max(ans, (ll) i);
        }
    }
    printf("%lld",ans);

    return 0;
}

Measured memory_bytes: 1024
from collections import deque
import copy

N,M,Q = map(int,input().split())

abcd = []
for _ in range(Q):
    a,b,c,d = map(int,input().split())
    abcd.append((a,b,c,d))
    
q = deque([[1]])
for _ in range(N):
    ap = deque([])
    while q:
        p = q.pop()
        num = p[-1]
        for i in range(num,M+1):
            new_list = p+[i]
            ap.append(new_list)
    q = ap
    
ans = 0
for x in q:
    ret = 0
    for a,b,c,d in abcd:
        if x[b]-x[a] == c:
            ret += d
    ans = max(ans,ret)
    
print(ans)


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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> roads(M * 2);
  for (auto i = 0; i < M * 2; i++) {
    cin >> roads.at(i);
  }
  for (auto n = 1; n < N + 1; n++) {
    int sum = 0;
    for (auto i = 0; i < M * 2; i++) {
      if (roads.at(i) == n)
        sum += 1;
    }
    cout << sum << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
//#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

long long N;

int main(int argc, char **argv) {
    std::cin >> N;

    long long tmp = 0;
    long long max;
    for (int i = 1; i <= N; i++) {
        tmp += i;
        if (N <= tmp) {
            max = i;
            break;
        }
    }

    for (int i = 1; i <= max; i++) {
        if (tmp - N != i) {
            std::cout << i << std::endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
k,n = map(int,input().split())
max_distance = 0
a = list(map(int,input().split()))
a.append(k + a[0])
ans = a[-1] - a[0]
for i in range(n):
    max_distance = max(max_distance, a[i+1] - a[i])
ans -= max_distance
print(ans)

Measured memory_bytes: 26444
#include <algorithm>
#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i <(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
const ll MOD=1000000007;
int main(){
    string s;
    cin>>s;
    string t;
    t=s.substr(0,3);
    cout << t << endl;
}

Measured memory_bytes: 3628
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int r = sc.nextInt();
        int d = sc.nextInt();
        int ans = 0;
        for(int i=l;l <= r;l++){
            if(l%d == 0){
                ans++;
            }
        }
        System.out.println(ans);
    } 
}

Measured memory_bytes: 35632
n,a = map(int,input().split())
x = list(map(int,input().split()))
dp = []
for i in range(n+1):
    dp.append([[] for j in range(i+1)])
    for k in range(i+1):
        dp[i][k] = [0 for y in range(50*k)]
for i in range(n+1):
        dp[i][0].append(0)
for i in range(1,n+1):
    for j in range(1,i+1):
        if j == 1:
                dp[i][j][x[i-1]-1] += 1
        for k in range(50*(j-1)):
                dp[i][j][k+x[i-1]] += dp[i-1][j-1][k]
                dp[i][j-1][k] += dp[i-1][j-1][k]
count = 0
for j in range(1,i+1):
        for k in range(len(dp[i][j])):
                if k + 1 == j*a:
                        count += dp[n][j][k]
print(count)

Measured memory_bytes: 21236
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;
//debug 
#ifdef _DEBUG
#define debug(var)  do{cout << #var << " :";view(var);}while(0)
#else
#define debug(...)
#endif
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }


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

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int NMAX = 200100;
mint dp[200100];
mint sum[200100];

int main(){
  int n, k;
  cin >> n >> k;
  vector<int> l(k);
  vector<int> r(k);
  REP(i,k) {
    cin >> l[i] >> r[i];
    r[i]++;
  }

  debug(l);
  debug(r);

  //
  //REP(i,11) cout << s[i] << endl;

  //和集合を求める

  //dpの初期化
  REP(i, NMAX) dp[i] = 0;
  REP(i, NMAX) sum[i] = 0;
 // REP(i,n) cout << dp[i] << endl;

  dp[1] = 1;
  sum[1] = 1;
  //dpループ

  REP2(i,2,n+1){
    REP(j,k){
      //if(i-r[j] < 0) continue;
      //mint add = sum[r[i-j]] - sum[l[i-j]];
      //cout << "l,r " << max(0,i-l[j]) << " " << i-r[j] << endl;
      int left = max(0,i-r[j]);
      int right =max(0,i-l[j]);

      //cout << i << ";"<< left << " " << right << endl;

      //cout << endl;
     // cout <<"add* "<<sum[right] - sum[left] << endl;
      dp[i] += sum[right] - sum[left];
      //sum[i] += sum[right] - sum[left];
    }
    sum[i] = sum[i-1] + dp[i];
  }

  // cout << "sum" << endl;
  //  REP(i,n) cout << sum[i] << endl;
  // cout << "dp" << endl;
  // REP(i,n) cout << dp[i] << endl;


  cout << dp[n] << endl;

  // //
  

  //
  return 0;
}

Measured memory_bytes: 6752
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int inf = 1000000000; 
const ll mod = 1e9+7;

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

Measured memory_bytes: 3636
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(int argc, char* argv[]){
    string s;
    int n = 0;
    cin >> s;
    rep(i, 3) if (s[i] == '1') n++;
    cout << n << endl;
}



Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoderBeginnerContest
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var line = Console.ReadLine().Split(' ');
            if(line[0].Last() == line[1].First() && line[1].Last() == line[2].First())
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


Measured memory_bytes: 11220
#include <stdio.h>

int main(int argc, char const *argv[]) {
  int a[101]={},b[101]={};
  int syurui=0;
  int i;

  scanf("%d %d %d",&a[0],&a[1],&a[2] );

  for(i = 0;i < 3;i++)b[a[i]]++;

  for(i=0;i<101;i++){
    if(b[i] != 0)syurui++;
  }

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


Measured memory_bytes: 128
S = input()
N = len(S)
alp = 'abcdefghijklmnopqrstuvwxyz'
if N<25:
  for a in alp:
    if a not in S:
      print(S+a)
      exit()
else:
  for i in range(N-1,-1,-1):
    nextS = ''
    for s in S[i:]:
      tmpS = S[:i] + s
      if tmpS == S:continue
      
      if nextS == '':
        if sorted([S,tmpS])[1] == tmpS:
          nextS = tmpS
      elif sorted([S,tmpS])[1] == tmpS and sorted([tmpS,nextS])[0] == tmpS:
        nextS = tmpS
     
    if nextS != '':
      print(nextS)
      exit()
  print(-1)

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

using namespace std;

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

void Main()
{
	int a, b;
	cin >> a >> b;
	cout << a / b << ' ' << a % b << ' ' << a * 1.0 / b << endl;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}



Measured memory_bytes: 3300
h,w=map(int,input().split())
s=[]
l=set()
for i in range(h):
  a=list(input())
  if set(a) != set("."):
    s.append(a)
    for j in range(w):
      if a[j]=="#":
        l|={j}
for i in s:
  p=""
  for j in sorted(list(l)):
    p+=i[j]
  print(p)


Measured memory_bytes: 3060
import sys

def main():
  a, b = map(int, sys.stdin.readline().split())
  s = str(b)
  s1 = s*a
  s = str(a)
  s2 = s * b
  print(s1) if s1 <= s2 else print(s2)
if __name__ == "__main__":
  main()


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define EPS 1e-8
#define DEB 0

const int dx[] = {0,1,0,-1}; //u,r,d,l
const int dy[] = {-1,0,1,0};

int w,h,sx,sy,home,last;
int field[16][16];
int num[16][16];

class state{
public:
  char x,y;
  int s;
  state(char _x, char _y, int _s){
    x = _x;
    y = _y;
    s = _s;
  }
  
  bool operator<(const state& a)const{
    if( x==a.x ){
      if( y==a.y ) return s<a.s;
      else         return y<a.y;
    }else{
      return x<a.x;
    }
  }
  
};


map<state,int> msi;

bool ischeck(int s){
  return (((last&s)) == last) ;
}
bool inside(int x, int y){
  return (x<0 || y<0 || x>=w || y>=h);
}


int dfs(int x, int y, int s){
  if( (1<<home)-1 == s ){ //âÎÉßêé
    return 1;
  }
  if( ischeck(s) ){ //³ïÉßé½ßÌÆðÁïµ½©Ç¤©
    return 0;
  }
  if( msi.count(state(x,y,s)) ){ //ùÉÊÁ½óÔ
    return msi[state(x,y,s)];
  }
  
  int ret = 0;
  rep(k,4){
    for(int i=1; i<20; i++){
      int tx = x + dx[k]*i;
      int ty = y + dy[k]*i;
      if( inside(tx,ty) ) break;
      if( field[ty][tx]==1 ){
	field[ty][tx] = 0;
	ret += dfs(tx,ty,s|(1<<num[ty][tx]));
	field[ty][tx] = 1;
	break;
      }
    }
  }
  msi[state(x,y,s)] = ret;
  return ret;
}

int main(){

  while(scanf("%d%d",&w,&h),w|h){
    msi.clear();
    memset(num,-1,sizeof(num));
    home = last = 0;
    rep(i,h){
      rep(j,w){
	scanf("%d",&field[i][j]);
	if( field[i][j]==2 ){
	  sx = j;
	  sy = i;
	}
	if( field[i][j]==1 ){
	  num[i][j] = home;
	  home++;
	}
      }
    }

    //last homes
    rep(k,4){
      for(int i=1; i<20; i++){
	int tx = sx + dx[k]*i;
	int ty = sy + dy[k]*i;
	if( inside(tx,ty) )break;
	if( field[ty][tx]==1 ){
	  last |= (1<<num[ty][tx]);
	}
      }
    }

    printf("%d\n",dfs(sx,sy,0));
  }
  

  return 0;
}

Measured memory_bytes: 32000
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::*;
use proconio::{input, fastout, marker::*};

#[fastout]
fn main() {
  input!{
      d:u64,
      t:u64,
      s:u64
  }
  println!("{}",if d as f64 / s as f64 <= t as f64 {"Yes"} else {"No"});
}


Measured memory_bytes: 2200
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

pair<int, int> p[200000];

int main() {
    int n = gi();
    for (int i = 0; i < n; i++) {
        int a = gi();
        int b = gi();

        p[i] = {b, a};
    }

    sort(p, p+n);

    int l = 1000000000;
    for (int i = n-1; i >= 0; i--) {
        l = MIN(l, p[i].first);

        if (p[i].second > l) {
            printf("No\n");
            return 0;
        }

        l -= p[i].second;
    }

    printf("Yes\n");

    return 0;
}


Measured memory_bytes: 1792
from itertools import product
s = input()
ans = 0
for bit in product(['', '+'], repeat=len(s)-1):
    q = ''
    for i in range(len(s)*2-1):
        if i % 2 == 0:
            q += s[i//2]
        else:
            q += bit[(i-1)//2]
    ans += eval(q)
print(ans)


Measured memory_bytes: 39280
#include<stdio.h>

int main(){
	int n,i,num=0,min;
	scanf("%d",&n);
	int m[n];
	for(i=0;i<n;i++){
		scanf("%d",&m[i]);
	}
	min=m[0];
	for(i=1;i<n;i++){
		if(min>m[i-1])min=m[i-1];
		if(min>m[i])num++;
	}
	printf("%d",num+1);
	return 0;
}

Measured memory_bytes: 896
w=input()
alphabet=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
flag=0
for i in alphabet:
	num=w.count(i)
	if num%2==1:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")

Measured memory_bytes: 3064
#include<iostream>
 
using namespace std;
 
int main()
{
	int x, y;
	cin >> x >> y;
	if (x == 1)
		x = 1;
	else if (x == 3)
		x = 1;
	else if (x == 5)
		x = 1;
	else if (x == 7)
		x = 1;
	else if (x == 8)
		x = 1;
	else if (x == 10)
		x = 1;
	else if (x == 12)
		x = 1;
	else if (x == 4)
		x = 2;
	else if (x == 6)
		x = 2;
	else if (x == 9)
		x = 2;
	else if (x == 11)
		x = 2;
	else if (x == 2)
		x = 3;
 
	if (y == 1)
		y = 1;
	else if (y== 3)
		y = 1;
	else if (y == 5)
		y = 1;
	else if (y == 7)
		y = 1;
	else if (y == 8)
		y = 1;
	else if (y == 10)
		y = 1;
	else if (y == 12)
		y = 1;
	else if (y == 4)
		y = 2;
	else if (y == 6)
		y = 2;
	else if (y == 9)
		y = 2;
	else if (y == 11)
		y = 2;
	else if (y == 2)
		y = 3;
 
	if (x == y)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
 
	return 0;
}

Measured memory_bytes: 256
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << "\n"

void solve(){
    string S;
    cin >> S;
    ll N = S.size();
    if(S[N-1] == 's'){
        cout << S << "es" << endl;
    }else{
        cout << S << "s" << endl;
    }
    

}

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

Measured memory_bytes: 3652
#include<stdio.h>
#include<stdlib.h>

struct node{
    int key;
    struct node *right, *left, *parent;
};

struct node *root, *NIL;

void insert(int k){
    struct node *y = NIL;
    struct node *x = root;
    struct node *z;

    z = (struct node *)malloc(sizeof(struct node));
    z->key=k;
    z->left=NIL;
    z->right=NIL;

    while(x != NIL){
        y=x;
        if(z->key < x->key){
            x=x->left;
        }
        else{
            x=x->right;
        }
    }

    z->parent=y;
    if(y==NIL){
        root=z;
    }else{
        if(z->key < y->key){
            y->left=z;
        }
        else{
            y->right=z;
        }
    }
}

void inorder(struct node *u){
    if(u==NIL){
        return;
    }
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}

void preorder(struct node *u){
    if(u==NIL){
        return;
    }
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
}

int main(void){
    int n, i, x;
    char com[10];
    scanf("%d", &n);

    for(int i=0; i<n; i++){
        scanf("%s", com);
        if(com[0]=='i'){
            scanf("%d", &x);
            insert(x);
        }
        else if(com[0]=='p'){
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }
    return 0;
}


Measured memory_bytes: 25136
// AOJ DPL_1_E Edit Distance (Levenshtein Distance)
// 2018.4.26 bal4u

#include <stdio.h>
#include <string.h>

#define MAX_S 1003
char s1[MAX_S], s2[MAX_S];
int M[MAX_S][MAX_S];

int string_distance(int len1, char *str1, int len2, char *str2)
{
    int  i, j, d, min;

    if (len1 == 0) return len2;
    if (len2 == 0) return len1;

    for (j = 0; j <= len1; j++) M[j][0] = j;
    for (i = 0; i <= len2; i++) M[0][i] = i;
    for (j = 1; j <= len1; j++) {
        for (i = 1; i <= len2; i++) {
            d = (str1[j-1] != str2[i-1]);
            min =     M[j-1][i  ] + 1;
            if (min > M[j  ][i-1] + 1) min = M[j  ][i-1] + 1;
            if (min > M[j-1][i-1] + d) min = M[j-1][i-1] + d;
            M[j][i] = min;
        }
    }
    return M[len1][len2];
}

int main()
{
	int w1, w2;
	char *p;

	fgets(p=s1, MAX_S, stdin);
	while (*p > ' ') p++; *p = 0; w1 = p-s1;
	fgets(p=s2, MAX_S, stdin);
	while (*p > ' ') p++; *p = 0; w2 = p-s2;
	printf("%d\n", string_distance(w1, s1, w2, s2));
	return 0;
}



Measured memory_bytes: 5764
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	int a, b, k;
	cin >> a >> b >> k;
	if(b-a+1<=2*k){
		for(int i=a; i<=b; i++){
			cout << i << endl;
		}
	}else{
		for(int i=0; i<k; i++){
			cout << a+i <<endl;
		}
		for(int i=0; i<k; i++){
			cout << b-k+1+i <<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
fn main() {
    let (mut n, mut x): (usize, usize) = (read::<usize>(), read::<usize>());
    while n != 0 || x != 0 {
        let mut ans = 0;
        for i in 1..n + 1 {
            for j in i + 1..n + 1 {
                for k in j + 1..n + 1 {
                    if i + j + k == x {
                        ans += 1;
                    }
                }
            }
        }
        println!("{}", ans);
        n = read();
        x = read();
    }
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: isize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========



Measured memory_bytes: 5028
#include <algorithm>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f, MOD = 1000000007;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*-----------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  long long N; cin >> N;
  FOR(h, 1, 3501) FOR(n, 1, 3501) {
    long long tmp1 = 4*h*n-N*n-N*h, tmp2 = N*h*n;
    if (tmp1 == 0) continue;
    if (tmp2 % tmp1 == 0) {
      if (tmp2 / tmp1 <= 0) continue;
      cout << h << ' ' << n << ' ' << tmp2 / tmp1 << '\n';
      return 0;
    }
  }
}


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

int main() {
  int N=0;
  cin >> N;

  // ここにプログラムを追記
  int Sum=0,Temp=0,i=0;
  Temp=N;
  for (int i=8; i>=0; i--) {
    Sum+=Temp/int(pow(10,i));
    Temp=Temp-(Temp/int(pow(10,i)))*int(pow(10,i));
  }
  if (N%Sum==0) {
    cout << "Yes" << endl;
  } else {
 	 cout << "No" <<endl;
  }
}


Measured memory_bytes: 256
n = int(input())
s = input()
l = len(s)
mod = 10**9 + 7

now = 1
for _ in range(n+l):
  now *= 25
  now %= mod
#print(now)
def inv(x):
  y = 1
  while x != 1:
    y *= mod // x + 1
    x -= mod % x
  return y
ans = 0
#print('#')
for i in range(n+l):
  now *= (n+l-i)
  now *= inv(i+1)
  now *= inv(25)
  now %= mod
  if i+1 >= l:
    ans += now
    ans %= mod
  #print(now)
print(ans)

Measured memory_bytes: 71132
#include <iostream>
  #include <string>
  #include <vector>
  #include <algorithm>
  #include <map>
  using namespace std;
  typedef long long ll;
  #define rep(i,n) for (int i=0;i < (int)(n);i++)

  int main(){
    int n,l;
    cin >> n >> l;
    vector<string> v(n);
    rep(i,n){
      cin >> v[i];
    }
    sort(v.begin(),v.end());
    rep(i,n){
      cout << v[i];
    }
    printf("\n");
     
    return 0;
  }
    
    

Measured memory_bytes: 256
import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    val result = solve(new Scanner(System.in))
    if (result.length > 0) println(result)
  }

  def solve(in: String): String = solve(new Scanner(in))

  def cnt(s: String): Long = {
    var cnt = 0L
    var prev = '.'
    s.foreach { c =>
      if (prev == c) {
        cnt += 1
        prev = '.'
      } else {
        prev = c
      }
    }
    cnt
  }

  def solve(sc: Scanner): String = {
    val S = sc.next
    val K = sc.nextInt

    val c1 = cnt(S)
    val c2 = cnt(S * 2) - c1
    val c3 = cnt(S * 3) - (c1 + c2)
    if (c1 == c3) {
      (((K / 2) * (c1 + c2)) + (K % 2) * c1).toString
    } else {
      (c1 + ((K - 1) * c2)).toString
    }
  }
}



Measured memory_bytes: 27212
function main(arg) {
	arg = arg.trim();
  	var s = arg.length;
  	var out = 'Yes';
 	for (var i = 0; i < s; i++) {
    	var num = arg[i];
      	var index = i + 1;
      	if (index%2 === 0 && num === 'R') {
              	return console.log('No');
        } else if (index%2 === 1 && num === 'L'){
        		return console.log('No');
        }
    }
  	console.log(out)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

using namespace std;

int main()
{
	int n;
	string s;
	cin >> n >> s;
	s.insert(0, "1");
	s += s;
	n += n;
	int l = 0;
	for (int i = 0; i < n; i++)
		if (s[i] == '1' && s[i + 1] == '1')
			l++;
	int a1 = 0, a2, a3, a4;
	if (l % 4 == 2) {
		a1 = s.find("011");
		if (a1 != -1)
			a3 = s.find("011", a1 + 1);
		if (a1 != -1 && a3 != -1 && a3 < n) {
			a2 = s.find('0', ++a1);
			a4 = s.find('0', ++a3);
			s = (s.substr(0, a2) + s.substr(a3, a4 - a3)).substr(0, a2 + a4 - a3 - 3) + s.substr(a2, a3 - a2 - 1) + s.substr(a4);
			n -= 4;
			s = s.substr(a1, a1 + n) + s.substr(a1);
		}
		else l++;
	}
	if (l % 2) {
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes\n";
	vector<int> v;
	int m = 0, k = 0, e = 0, f, g = 0, h = -1;
	for (int i = 0; i < n; i++) {
		if (s[i] != s[i + 1]) {
			if (s[i] == '1')
				v.push_back(k = ++m);
			else {
				v.push_back(k);
				if (!k) h = i - a1;
			}
			continue;
		}
		if (s[i] == '0') {
			if (e) v.push_back(e), e = 0;
			else v.push_back(e = ++m);
			continue;
		}
		if (g)
			v.push_back(f + g % 2);
		else v.push_back(f = ++m), m++;
		g++, g %= 4;
	}
	if (h >= 0) v[h] = k;
	if (l % 4) {
		vector<int> w;
		w.push_back(++m);
		w.insert(w.end(), v.begin() + (a4 - a3 - 2), v.begin() + (a4 - a1 - 4));
		w.push_back(m + 1);
		w.push_back(m);
		w.insert(w.end(), v.begin(), v.begin() + (a4 - a3 - 2));
		w.push_back(m + 1);
		w.insert(w.end(), v.begin() + (a4 - a1 - 4), v.end());
		v.clear();
		v.insert(v.end(), w.end() - a1, w.end());
		v.insert(v.end(), w.begin(), w.end() - a1);
	}
	for (auto i : v)
		cout << i << ' ';
	cout << endl;
	return 0;
}


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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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; }

const ll INF = 1e15;
const int MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n,m; cin>>n>>m;
  
  cout<<(1900*m+(n-m)*100)*round(pow(2,m))<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする

//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい

#define ALL(x) x.begin(),x.end()
typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef vector<int> vi; //vector<int>
typedef vector<vector<int>> vvi; //vector<vector<int>>
typedef vector<ll> vll; //vector<long long>
typedef vector<vector<ll>> vvll; //vector<vector<long long>>
typedef priority_queue<int, vector<int>, greater<int> > gpq; //逆順priority_queue
typedef priority_queue<int> pq;

//const int MOD=998244353;
const int MOD=1000000007; //10^9+7
const double PI=3.1415926535;

int main(){    
    int K,A,B;
    cin>>K>>A>>B;
    bool ok=false;
    for(int i=A;i<=B;i++){
        if(i%K==0)ok=true;
    }
    cout<<(ok?"OK":"NG")<<endl;
}


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

using namespace std;

int N, K;
string S;

int main() {

    while (cin >> N >> K >> S) {
        switch (S.at(K -1)) {
            case 'A':
                S.replace(K -1, 1, "a");
                break;
            case 'B':
                S.replace(K -1, 1, "b");
                break;
            case 'C':
                S.replace(K -1, 1, "c");
                break;
        }
        cout << S << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(void)
{
	int h,w,i,j,flg,x[201][201];
	char c[10],s[101][101];
	scanf("%d%d",&h,&w);
	for(i=0;i<h;i++){
		flg=0;
		for(j=0;j<w;j++){
			scanf(" %c",&c[0]);
			//s[i][j]=c[0];
			if(strcmp(c,"c")==0){
				flg=1; x[i][j]=0;
			}
			else if(flg==1) x[i][j]+=x[i][j-1]+1;
			else x[i][j]=-1;
		}
	}
	for(i=0;i<h;i++){
		printf("%d",x[i][0]);
		for(j=1;j<w;j++) printf(" %d",x[i][j]);
		printf("\n");
	}
	/*for(i=0;i<h;i++){
		printf("%s\n",s[i]);
	}*/
	return 0;
}

Measured memory_bytes: 2756
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
int main(void){
	char input[4];
	VI a;
	cin >> input;
	REP(i,4){
		a.PB((int)(input[i] - '0'));
	}
	for (int b = 0; b < 1 << 3; b++)
	{
		int ans = a[0];
		REP(i, 3)
		{
			if(b & (1<<i)){
				ans += a[i+1];
			}
			else{
				ans -= a[i+1];
			}
		}
		// debug(ans);
		if (ans == 7)
		{
			REP(i,3){
				char c = (b >> i & 1) ? '+' : '-';
				cout << a[i] << c;
			}
			cout << a[3] << "=7";
			return 0;
		}
	}
		return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
bool first=true;
int t=0,d=0,y;
cin>>s;
for(int i=0;i<s.size();i++){
 
if(s[i]=='A' && first){
	t=i;
first=false;
 
}
 
if(s[i]=='Z' && i>d){
d=i;
}
}
cout<<d-t+1;
 
 
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x,i##end=y;i<=i##end;++i)
#define _rep(i,x,y) for(int i=x,i##end=y;i>=i##end;--i)
#define ll long long
#define N 100005
inline bool up(int&x,const int y){return x<y?x=y,1:0;}
inline bool down(int&x,const int y){return x>y?x=y,1:0;}
char c[N];
int n,a[N];
int main(){
	std::ios::sync_with_stdio(0);
	std::cin.tie(0),std::cout.tie(0);
	std::cin>>(c+1);
	n=strlen(c+1);
	rep(i,1,n) a[i]=c[i]&15;
	if(!a[1]||a[n]) return std::cout<<"-1\n",0;
	rep(i,1,n-1) if(!a[i]&&a[n-i])
		return std::cout<<"-1\n",0;
	int lst=1;
	rep(i,2,n){
		std::cout<<lst<<' '<<i<<'\n';
		if(a[i-1]) lst=i;
	}
	return 0;
}

Measured memory_bytes: 4104
#include<bits/stdc++.h>
    using namespace std;
    #define se second
    #define fi first
    #define ll long long
    #define ld long double
    #define pll pair<ll ,ll >
    #define ppll pair<ll, pll>
    #define pii pair<int, int> 
    #define mod 1000000007
    #define pb push_back
    ll power(ll a,ll b){
        ll res=1;
        while(b>0){
            if(b%2!=0) res=(res*a);
            a=(a*a);
            b/=2;
        }
        return res;
    }
    ll ncr(ll n,ll k){
        if(k==0||k==n) return 1ll;
        if(k>n-k) k=n-k;
        ll pro=1;
        for(ll i=0;i<k;i++){
            pro=(pro*(n-i))%mod;
            pro/=(i+1);
        }
        return (pro%mod);
    }
    int main(void){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        ll n;
        cin>>n;
        ll minn=1e15;
        for(ll i=1;i*i<=n;i++){
            if(n%i==0){
                ll a=n/i;
                ll b=i;
                minn=min(minn,abs(a-1)+abs(b-1));
            }
        }
        cout<<minn;
        return 0;
    }


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

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

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

   char rgb[3]={'R', 'G', 'B'};

   ll cnt=0;
   int numi2[4000];
   rep(i0, 3) rep(i1, 3) rep(i2, 3) if(i0!=i1 && i1!=i2 && i0!=i2){
      int c0=rgb[i0], c1=rgb[i1], c2=rgb[i2];
      for(int i=n-1, sm=0; i>=0; i--){
         numi2[i]=sm;
         if(s[i]==c2) sm++;
      }

      rep(i, s.size()) if(s[i]==c0) for(int j=i+1; j<s.size(); j++) if(s[j]==c1){
         int discnt=0, dk=j+(j-i);
         if(dk<s.size() && s[dk]==c2) discnt=1;
         cnt+=numi2[j]-discnt;
      }
   }

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


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define int long long
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<< ": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const int N = 200005;


 int ans1,ans2;



int32_t main()
{


    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS

    
    int l,r;
    cin >> l >> r;

    int ans = 0;
    
    for(int i = l; i <= r; i++)
    {
      string str = to_string(i);
      string str2 = str;
      reverse(str.begin(),str.end());
      if(str == str2)ans++;
    }

    cout << ans;





    return 0;   
}


Measured memory_bytes: 3672
#include<cstdio>
#include<iostream>
#define NIL -1
using namespace std;

int main(){
    int n,x=0;
    int ans =0;
    while(1){
        scanf("%d %d",&n,&x);
        if(n == 0 && x == 0) break;
        for(int i=1; i<=n-2;i++ ){
            for(int j =i+1;j<=n-1;j++){
                for(int k=j+1;k<=n;k++){
                    if(x == i+j+k) ans+=1;
                 
                }
            }
        }
        printf("%d\n",ans);
        ans =0;
    }
    
    return 0;
}



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

typedef long long int ll;
typedef vector<int> vi;     typedef vector<ll> vl;
typedef vector<vi> vvi;     typedef vector<vl> vvl;
typedef pair<int, int>  pii;  typedef pair<ll, ll> pll;
typedef vector<pii> vii;    typedef vector<pll> vll;
typedef map<int,int> mii;
typedef vector<char> vc;
typedef vector<bool> vb;
#define endl '\n'
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define trav(a,x) for(auto &a:x)
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size()
#define MOD 1000000007
#define F first
#define S second
#define pb push_back
#define pf push_front
#define rb pop_back
#define rf pop_front
#define in insert
#define mp make_pair
#define fill(a,x) memset(a,x,sizeof a);
#define min3(a, b, c) min(min(a, b), c)
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max3(a, b, c) max(max(a, b), c)
#define max4(a, b, c, d) max(max(a, b), max(c, d))
const ll INFL = 1e18;
const int INFI = 1e9;
#ifdef EVIL
	#include "../../trace.h"
#else
	#define trace(args...)
#endif

ll div_floor(const ll &a,const ll &b) { return a / b - (((a ^ b) < 0) and a % b);}
ll div_ceil(const ll &a,const ll &b) { return a / b + (((a ^ b) >= 0) and a % b);}
ll modpow(ll a, ll b, ll m = MOD){a %= m; ll res = 1; 
	while (b) {if (b & 1)res = (res * a) % m; a = (a * a) % m; b >>= 1;} return res;}
ll bpow(ll a, ll b){ll res = 1; while (b) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll modinv(ll a, ll m = MOD) {return modpow(a, m - 2, m);}
// void graph(vvi &adj, int m) {int x, y; forn(i, m){cin>>x>>y; adj[--x].pb(--y); adj[y].pb(x);}}



void solve(){
	ll a;
	long double b;
	cin>>a>>b;
	long double c= a*b;
	ll d =c;
	cout<<d;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifdef EVIL
		freopen("inp.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
		freopen("err.txt", "w", stderr);
	#endif
	int t=1;
	// cin>>t;
	rep(q,0,t-1){
		solve();
	}
}


Measured memory_bytes: 3744
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string a, b, c;
cin>>a>>b>>c;
char cp;
cp=a[0];
a=a.substr(1, a.size());
while(true){
if(cp=='a'){
if(a.size()==0){cout<<"A"<<endl;return 0;}
cp=a[0];
a = a.substr(1, a.size());
}
if(cp=='b'){
if(b.size()==0){cout<<"B"<<endl;return 0;}
cp=b[0];
b = b.substr(1, b.size());
}
if(cp == 'c'){
if(c.size()==0){cout<<"C"<<endl;return 0;}
cp=c[0];
c = c.substr(1, c.size());
}}
return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
 
int main(void)
{
  int n;
  scanf("%d",&n);
  for(int i=1;i<=9;i++)
    for(int j=1;j<=9;j++)
      if(n==i*j){
        printf("Yes");
        return 0;
      }
  printf("No");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<(int)n; i++)
#define REPR(i, n) for(int i=(int)n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=(int)m; i<(int)n; i++)
#define FORR(i, m, n) for(int i=(int)m-1; i>=(int)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
typedef long long ll;
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
//struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;

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

void solve(long long K, long long X){
	bool can = false;
	if (500*K >= X) can = true;
	if (can) cout << YES << "\n";
	else cout << NO << "\n";
}

int main(){
    long long K;
    scanf("%lld",&K);
    long long X;
    scanf("%lld",&X);
    solve(K, X);
    return 0;
}


Measured memory_bytes: 256
function pint(s) { return parseInt(s); }
function pfloat(s) { return parseFloat(s); }
Array.prototype.sortNumAsc  = function () { return this.sort((a, b) => (a - b)); }
Array.prototype.sortNumDesc = function () { return this.sort((a, b) => (b - a)); }
Array.prototype.sortStrAsc  = function () { return this.sort();                  }
Array.prototype.sortStrDesc = function () { return this.sort().reverse();        }
Array.prototype.without = function (itm) { return this.filter((elem) => elem !== itm); }
var input = '';
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', chunk => input += chunk);
process.stdin.on('end', () => {
  var lines = input.split('\n').map(l => l.trim());
  if (lines[lines.length-1] === '')
    lines = lines.slice(0, -1);
  main(lines);
});
function main(lines) {
  var arr = lines[0].split(' ').map(x => x.trim());
  var a = arr[0];
  var b = arr[1];
  var c = arr[2];
  console.log((a[a.length-1] === b[0] && b[b.length-1] === c[0]) ? "YES" : "NO");
}

Measured memory_bytes: 7500
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string.h>
#include <cassert>
#include <string.h>
#include <tuple>

using namespace std;
#define  rep(i,n) for(int i=0;i<n;i++)
#define  rrep(i,n) for(int i=n-1;i>=0;i--)///n-1番目からn回
#define  REP(i,a,b) for(int i=a;i<=b;i++) ///a番目からb回
#define  RREP(i,a,b) for(int i=a;i<b;i--)
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pair_t;
#define MOD 1000000007

//int arr[N]
////sort(arr,arr +N)

//vector <int> hoge
////sort(hoge.begin(),hoge.end());
///*min_element(hoge.begin(),hoge.end();　最小値　　　最大値はmax_element();
///(10-(n%10))%10  10-(1桁目)取得 12->8 20->0

#define Ru(n)  ( ((n)+9)/10*10  ) //切りあげ
#define Rd(n)  ( ((n)-10)/10*10 +10 )	切り捨て


int gcd(int a,int b);
size_t length(const std::string& str) {
	return str.length();
}
bool comp(const pair_t &a, const pair_t &b) {
	return a.first < b.first;
}

int main() {
	int N,a;
	cin>>N;
	typedef tuple<int,int> data;
	vector<data> A;
	REP(i,1,N){
		cin>>a;
		A.emplace_back(a,i);
	}
		sort(A.begin(),A.end());
	rep(i,N){
		cout<< (get<1>(A[i]))<<" ";
	}

	return 0;

}


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


Measured memory_bytes: 1780
#include <iostream>
#include <string>//
#include <vector>//
#include <map>
#include <cstdlib>
#include <numeric>
#include <algorithm>//ソート等に使用
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <thread>///////////////////
#include <queue>//幅優先等のキュー
#include <stack>
#include <bitset>

#define rep(i,m,n) for(int i=(m);i<=(n);i++)
#define mer(i,m,n) for(int i=(m);i>=(n);--i)

#define MOD 1000000007
//#define MOD 998244353
//#define MAX 

using namespace std;

using ll = long long int;
using ld = long double;
using std::swap;

vector<int> v;
vector<long long int> vll;
//vector<vector<int>> vec(50, vector<int>(4, 0));
vector<vector<int>> vv;
vector<char> vc;
vector<string> vs;




int main() {
	int x;
	cin >> x;
	if (x == 0) cout << 1 << '\n';
	else cout << 0 << '\n';
	return 0;
}

Measured memory_bytes: 3632
#UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
       return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N, M = map(int, input().split())
uf = UnionFind(N)
now_max = 0

while True:
    try:
        listA = list(map(int,input().split()))
        uf.union(listA[0] - 1, listA[1] - 1)
    except:
        break
for i in range(N):
    now_max = max(uf.size(i),now_max)
print(now_max)

Measured memory_bytes: 84180
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換
#define dump(x)  cerr << #x << " = " << (x) << endl;

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

 
long long int gcd(long long int a, long long int b) {
	if (a < b)swap(a, b);
 	while (b) {
 		a %= b;
 		swap(a, b);
 	}
 	return a;
 }

//ここから書き始める
int main(int argc, char const *argv[])
{
	int N,X;

	cin >> N >> X;

	int x[N];

	REP(i, N)
	{
		cin >> x[i];
	}

	REP(i, N)	
	{
		x[i] = abs(x[i] - X);
	}

	int ans;
	ans = x[0];

	REP(i, N)
	{
		if(i==0) continue;
		ans = gcd(ans, x[i]);
	}

	cout << ans << endl;


}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>//sort,reverse
#include<utility>//pair
#include<queue>//queue,priority_queue
#include<deque>//double_ended queue
using namespace std;
typedef pair<int,int> P;//Pでpair<-,->を表す。
typedef long long LL; 

int main()
{ 
    LL n;
    cin>>n;
    if(n%2!=0){
        cout<<0<<endl;
    }
    else{
        LL ans=0;
        n=n/2;
        while(n>=5){
            n=n/5;
            ans=ans+n;
        }
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
#define repr(i ,n) for(int i=n;i>(int)(n);--i)
#define rep1(i ,n) for(int i=1;i<=(int)(n);++i)
#define ALL(a) a.begin(), a.end()
#define RSORT(a) sort(ALL(a),greater<>())
#define SORT(a) sort(ALL(a))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define PRINT(x) cout << (x) << endl;
#define ENDL cout << endl;
using namespace std;
typedef long long int i64;
typedef unsigned long long u64;
template<class T> using V = vector<T>;
using VI = V<int>;
const int INF = 2e9;
const i64 MOD = 1e9 + 7;

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;}
struct Init_On{
    Init_On(){
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(16);
    }
};

signed main(){
    int n; cin >> n;
    int call = n % 10;
    if( call == 3) { cout << "bon" << endl; }
    else if (call == 0 || call ==1 || call == 6 || call == 8) { cout << "pon" << endl; }
    else cout << "hon" << endl;
}

Measured memory_bytes: 3620