akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N,A;
  cin >> N;
  int fx = 0;
  A = N;
  while(A>0){
    fx += A % 10;
    A /= 10;
  }
  if(N % fx == 0){
    cout << "Yes" << endl;
  }else
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <algorithm>

typedef long long ll;

using namespace std;

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

}


Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		if(A >= 13) {
			System.out.println(B);
		} else if(6 <= A && A <= 12) {
			System.out.println(B / 2);
		} else {
			System.out.println(0);
		}
		
	}
}


Measured memory_bytes: 21844
#include<iostream>
#include<cstring>
#include<ctime>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<cstdlib>
#include<cstdio>
#include<map>
#include<bitset>
#include<set>
#include<stack>
#include<vector>
#include<queue>
using namespace std;
#define MAXN 200010
#define MAXM 1010
#define ll long long
#define eps 1e-8
#define MOD 1000000007
#define INF 1000000000
struct vec{
	int to;
	int fro;
};
vec mp[MAXN];
int tai[MAXN],cnt;
int fa[MAXN];
int v[MAXN];
int n;
bool vis[MAXN];
bool ic[MAXN];
int t[MAXN],tot;
int has[MAXN];
int T;
int v2[MAXN];
int sv[MAXN];
inline void be(int x,int y){
	mp[++cnt].to=y;
	mp[cnt].fro=tai[x];
	tai[x]=cnt;
}
void dfs(int x){
	int i,y;
	if(vis[x]){
		return ;
	}
	vis[x]=1;
	for(i=tai[x];i;i=mp[i].fro){
		y=mp[i].to;
		if(!ic[y]){
			dfs(y);
		}
	}
	T++;
	for(i=tai[x];i;i=mp[i].fro){
		y=mp[i].to;
		if(!ic[y]){
			has[v[y]]=T;
		}
	}
	for(;has[v[x]]==T;v[x]++){
		
	}
	v2[x]=v[x]+1;
	for(;has[v2[x]]==T;v2[x]++){
		
	}
}
int main(){
	int i,x;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&x);
		fa[i]=x;
		be(x,i);
	}
	x=1;
	while(!vis[x]){
		vis[x]=1;
		x=fa[x];
	}
	while(!ic[x]){
		ic[x]=1;
		t[++tot]=x;
		x=fa[x];
	}
	memset(vis,0,sizeof(vis));
	for(i=1;i<=n;i++){
		dfs(i);
	}
	sv[t[1]]=v[t[1]];
	for(i=2;i<=tot;i++){
		if(sv[t[i-1]]==v[t[i]]){
			sv[t[i]]=v2[t[i]];
		}else{
			sv[t[i]]=v[t[i]];
		}
	}
	if(sv[t[tot]]!=v[t[1]]){
		printf("POSSIBLE\n");
		return 0;
	}
	sv[t[1]]=v2[t[1]];
	for(i=2;i<=tot;i++){
		if(sv[t[i-1]]==v[t[i]]){
			sv[t[i]]=v2[t[i]];
		}else{
			sv[t[i]]=v[t[i]];
		}
	}
	if(sv[t[tot]]==v[t[1]]){
		printf("POSSIBLE\n");
		return 0;
	}
	printf("IMPOSSIBLE\n");
	return 0;
}

/*

*/


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

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cout << fixed << setprecision(6);
  int n, m; cin >> n >> m;
  int even = n * (n - 1) / 2;
  int odd = m * (m - 1) / 2;
  cout << even + odd << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int ab[3][3+1];
    int min = 101;
    for(int i = 0;i<3;i++){
        scanf("%d %d %d",&ab[i][0],&ab[i][1],&ab[i][2]);
        //一番左の列にある数値のうち、最小値を代入
        if(ab[i][0] < min){
            min = ab[i][0];
        }
        // printf("min %d\n",min);
        // printf("ab[%d][0] %d\n",i,ab[i][0]);
        // printf("ab[%d][1] %d\n",i,ab[i][1]);
        // printf("ab[%d][2] %d\n",i,ab[i][2]);
    }
    int a[3];
    int b[3];
    int flag = 0;
    for(int i = 0;i<=min;i++){
        memset(&a,0,sizeof(a));
        memset(&b,0,sizeof(b));
        a[0] = i;
        b[0] = ab[0][0] - i;
        b[1] = ab[0][1] - i;
        b[2] = ab[0][2] - i;
        a[1] = ab[1][0] - b[0];
        a[2] = ab[2][0] - b[0];
        for(int j = 0;j<3;j++){
            // printf("a %d\n",a[j]);
            // printf("b %d\n",b[j]);
            if(b[j] < 0){
                flag++;
                break;
            }
        }
        if(flag != 0){
            flag = 0;
            continue;
        }
        for(int j = 0;j<3;j++){
            if(flag != 0){
                break;
            }
            for(int k = 0;k<3;k++){
                if(ab[j][k] != a[j] + b[k]){
                    flag++;
                    break;
                }
            }
        }
        if(flag == 0){
            printf("Yes\n");
            return 0;
        }
        flag = 0;
    }

    printf("No\n");
    return 0;

    // int min = 101;
    // int tmp = 0;
    // for(int i = 0;i<9;i++){
    //     if(min > ab[i]){
    //         min = ab[i];
    //         tmp = i;
    //     }
    // }
    // int a[3];
    // int b[3];

    // switch(i){

    // }

    //確認用
    // for(int i = 0;i<9;i++){
    //     printf("%d\n",ab[i]);
    // }
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

template<typename T>
ostream& operator << (ostream& os, vector<T>& v){
	rep(i,v.size()){ os << v[i] << (i == v.size() - 1 ? "" : " "); } return os;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& v){
	for(T& x: v){ is >> x; } return is;
}

template<typename T>
class CumulativeSum {
	vector<T> a;
	public:
	CumulativeSum(vector<T>& x) : a(x.size() + 1,0) {
		rep(i,x.size()){
			a[i + 1] = a[i] + x[i];
		}
	}
	T get(int l, int r){ // [l, r]の区間の合計を求める
		return a[r + 1] - a[l];
	}
	T operator [] (const int i) const {
		return a[i];
	}
};

template<typename T>
class CumulativeSumXor {
	vector<T> a;
	public:
	CumulativeSumXor(vector<T>& x) : a(x.size() + 1,0) {
		rep(i,x.size()){
			a[i + 1] = a[i] ^ x[i];
		}
	}
	T get(int l, int r){ // [l, r]の区間の合計を求める
		return a[r + 1] ^ a[l];
	}
	T operator [] (const int i) const {
		return a[i];
	}
};

bool C(int l, int r, CumulativeSum<int>& s, CumulativeSumXor<int>& x){
	//cout << l << ' ' << r << ' ' << s.get(l,r) << ' ' << x.get(l,r) << endl;
	return s.get(l,r) == x.get(l,r);
}

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

	vector<int> a(n);
	cin >> a;

	CumulativeSum<int> s(a);
	CumulativeSumXor<int> x(a);

	long long ans = 0;
	rep(i,n){
		//show(i)
		long long right = n, left = i;
		rep(j,30){
			long long mid = (right + left) / 2;
			//cout << left << ' ' << right << endl;
			if(C(i, mid, s, x)) left = mid;
			else right = mid;
		}

		rep(j,left + 1){

		}
		//cout << left << ' ' << i << endl;
		ans += left - i + 1;
	}
	cout << ans << endl;
}


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



int main() {

    long long A;
    long double B;
    cin >> A >> B;

    
    long long s = 0;
    s = B * 100;
    long long ans = 0;
   // ans = A * s / 100;

    long long d = 0;
    long long e = 0;
    d = A / 100;
    e = A % 100;
    ans = d * s + e * s / 100;

    ans = A * B;
    //cout << d << " "<< e << endl;
    cout << ans << endl;
    return 0;

}


Measured memory_bytes: 3728
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define tarce(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 sa(a,n) for(int i =0 ; i<n ; i++) cin>>a[i]
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define pb push_back
#define inf 2e18
#define scan() int n; cin>>n ; int a[n]; for(int i = 0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define mem(a,v) memset(a,v,sizeof(a))
#define pii pair<int,int>
#define mkp make_pair
using namespace std;
#define N 200005


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

        string s;
        cin >> s;
        int n=s.size();
        int i,j,k;
        int a=0,b=0;
        for(i=0; i<n; i++){
            if(s[i]=='0')a++;
            else b++;
        }
        int ans=2*min(a,b);
        cout << ans;
        
        

}

Measured memory_bytes: 512
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;

const int MAX_N = 5e2 + 10, MOD = 1e9 + 7;
int n, m;
string table[MAX_N];
bool map[2][MAX_N][MAX_N];

int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i++)
		cin >> table[i];

	for (int i = 0; i < m; i++)
		map[0][0][i] = map[1][n - 1][i] = true;

	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			if (table[i][j] == '#')
				map[1][i][j] = map[0][i][j] = true;

	for (int j = 0; j < m; j++)
		for (int i = 1; i + 1 < n; i++)
			if (table[i][j] == '.')
				map[j & 1][i][j] = true;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++)
			cout << (map[0][i][j]? '#': '.');

		cout << "\n";
	}
	cout << "\n";

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++)
			cout << (map[1][i][j]? '#': '.');

		cout << "\n";
	}
	return 0;
}

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

using namespace std;
long long n,d,ans,x,y,nd;
int main()
{
    cin>>n>>d;
    d*=d;
    for(int i=1;i<=n;i++)
    {
        cin>>x>>y;
        nd=x*x+y*y;
        if(nd<=d)
            ans++;
    }
    cout<<ans;
    return 0;
}


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


int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  string ans = "Balanced";
  if((a+b) > (c+d)) ans = "Left";
  else if((a+b) < (c+d)) ans = "Right";
  cout << ans << endl;
  return 0;
  
}

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

int mincost(vector<int> &dp, vector<int> &h, int k, int i){
  if(dp[i] != INT_MAX)
    	return dp[i];
    if(i>=h.size()-1){
        return dp[i] = 0;
    }
    int ans = INT_MAX;
    for(int j = 1; j <= k && (i+j) < h.size(); ++j){
        ans = min(ans, abs(h[i]-h[i+j]) + mincost(dp, h, k, i+j));
    }
    return dp[i] = ans;
}

int main(){
  int n, k;
  cin>>n>>k;
  vector<int> h(n, 0);
  vector<int> dp (n, INT_MAX);
  for(int i = 0; i < n; ++i){
  	cin>>h[i];
  }
  cout<<mincost(dp, h, k, 0);
    return 0;
}


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

map <long long int,long long int> cnt;

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

	int n;
	long long int t;
	long long int sum = 0;

	cin >> n;

	cnt[0]++;
	for(int i=0;i<n;i++)
	{
		cin >> t;
		sum += t;
		cnt[sum]++;
	}

	long long int res = 0;

	for(auto it : cnt)
	{
		res += ((it.second)*(it.second - 1)/2);
	}

	cout << res << '\n';
	
	return 0;
}

Measured memory_bytes: 16140
#include<cstdio>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<cctype>
#include<cstring>
#include<algorithm>
#include<iostream>
#define rep(i,n) for(int i = 1; i <= n; i++)
#define c(ans) cout<<ans<<endl;
using namespace std;
typedef long long ll;
typedef vector<int> v;

int main(){
	int n;
	while(cin>>n){
		int vis[4],ans=0;
		memset(vis,0,sizeof(vis));
		rep(i,n){
			char c;
			cin>>c;
			if (c=='P'&&vis[0]==0){
				ans++;
				vis[0]=1;
			}	if (c=='W'&&vis[1]==0){
				ans++;
				vis[1]=1;
			}	if (c=='G'&&vis[2]==0){
				ans++;
				vis[2]=1;
			}	if (c=='Y'&&vis[3]==0){
				ans++;
				vis[3]=1;
			}



		}
		if (ans==3) cout<<"Three"<<endl;
		else cout<<"Four"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.next();
        boolean flag1 = false;
        boolean flag2 = false;
        for (int i = 0; i < s.length(); i++){
            if (!flag1){
                if (s.charAt(i) == 'C'){
                    flag1 = true;
                }
            } else if (!flag2){
                if (s.charAt(i) == 'F'){
                    flag2 = true;
                }
            }
        }
        if (flag1 && flag2){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

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

#define dbg if(0)
using namespace std;
#define ll long long

int main(){
    int n;
    string ans;
    cin >> n;
    do{
        if (abs(n%2)==1)ans+='1';
        else ans+='0';
        if (n%2<0)n--;
        dbg cout <<n/(-2)<<" "<<n%(-2)<<endl;;
        n=n/(-2);
    }while(abs(n)>0);
    reverse(ans.begin(),ans.end());
    cout <<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include<algorithm>
#include<sstream>
#include<iomanip>


using namespace std;

typedef long long ll;


int main() {
	int n;
	cin >> n;
	vector<int> cnt(3);
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (a % 4 == 0) {
			cnt[2]++;
		}
		else if (a%2 == 0) {
			cnt[1]++;
		}
		else {
			cnt[0]++;
		}
	}
	bool isExist = false;
	if (cnt[1] == 0) {
		if (cnt[0] <=cnt[2] + 1) {
			isExist = true;
		}
	}
	else {
		if (cnt[0] <=cnt[2]) {
			isExist = true;
		}
	}

	cout << (isExist? "Yes":"No") << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define vi vector<int>
#define sort_v(a) sort(a.begin(), a.end())

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

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    cout << max(a, max(b, c)) - min(a, min(b, c)) << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;
#define rep(i, a) for(int i=0; i < a;i++)
#define sz(s) (int) s.size()
#define toInt(s) (int)(s - '0')
#define endl '\n'
#define ll long long 


int main() {

    int n;
    cin >> n;
    rep(i, n) {
        cout << "ACL";
    }
    cout <<endl;


    return 0;
}

Measured memory_bytes: 3048
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strings"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var n int
	con.Scan(&n)
	x := n / 2
	y := 1
	if n%2 == 0 {
		y = -1
	}
	b := make([]string, n)
	for i := 1; i <= n; i++ {
		con.Scan(&b[x])
		x += i * y
		y = -y
	}
	con.Println(strings.Join(b, " "))
	return nil
}

// 4 2 1 3
// 5 3 1 2 4


Measured memory_bytes: 14848
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

int main()
{
	ios;
	 double a,b,c;
	 cin>>a>>b>>c;
	 if(a/c <=b) cout<<"Yes\n";
	 else cout<<"No\n";
	return 0;
}

Measured memory_bytes: 3712
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define ll long long
int main(){
	priority_queue<ll> que;
	ll N,M,A;
	cin >> N >> M;
	ll i;
	for(i=0;i<N;i++){
		cin >> A;
		que.push(A);
	}
	ll tmp;
	for(i=0;i<M;i++){
		tmp=que.top();
		que.pop();
		que.push(tmp/2);
	}
	ll sum=0;
	for(i=0;i<N;i++){
		sum+=que.top();
		que.pop();
	}
	cout << sum;
	return 0;
}


Measured memory_bytes: 1400
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <map>
#include <queue>
#include <cmath>
#include <iomanip>
#include <set>
#include <functional>
#include <list>

#define MOD (1000000000 + 7)

using namespace std;

typedef long long ll;
typedef pair<ll, ll> tup;
const int MAX = 3000000;

long long fac[MAX], finv[MAX], inv[MAX];

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

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

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

map<ll,ll> prime;//素因数分解でそれぞれの素数がいくつ出てきたかを保存するmap

//O(√n)
//整列済み(mapはkeyで自動で整列される)
void prime_factorize(ll n){
    if(n<=1) return;
    ll l=sqrt(n);
   for(ll i=2;i<=(ll)(l);i++) { //
        if(n%i==0){
            prime_factorize(i);prime_factorize(ll(n/i));return;
        }
    }
    //mapでは存在しないkeyの場合も自動で構築される
    prime[n]++;return;
} 

vector<ll> divisor;
void list_divisor(ll n) {
    divisor.clear();
    for(int i = 1; i*i <= n; i++) {
        if(n % i == 0) {
            divisor.push_back(i);
            if(i*i != n) divisor.push_back(n/i);
        }
    }
    sort(divisor.begin(), divisor.end());
}

int main() {
    ll N;
    cin >> N;

    vector<ll> D(N, 0);
    map<ll, ll> m;
    ll maxv = 0;
    for(ll i = 0; i < N; i++) {
        cin >> D[i];
        m[D[i]]++;
        maxv = max(maxv, D[i]);
    }

    if(D[0] != 0 || m[0] >= 2) {
        cout << 0 << endl;
        return 0;
    }

    ll ret = 1;
    for(ll i = 1; i <= maxv; i++) {
        ret = (ret % 998244353) *  modpow(m[i-1], m[i], 998244353);
    }

    cout << ret%998244353 << endl;
}


Measured memory_bytes: 10148
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>

using namespace std;

string S;

int main() {

	cin >> S;

	int i;

	int ans = 0;
	for (i = 0; i < S.length()-1; i++) {
		if (S[i] != S[i + 1]) { ans++; }
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 512
#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define mt make_tuple
#define INF 2000000000
#define INFL 1000000000000000000LL
#define EPS (1e-8)
#define MOD 1000000007
#define PI 3.141592653589793
#define RMAX 4294967295
#define equals(a,b)(fabs((a)-(b))<EPS)

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef complex<double> comp;
typedef vector<complex<double>> vcomp;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef string::const_iterator State;
class ParseError {};
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;



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

	int N;
	cin >> N;
	int ans = 0;
	rep(i, N) {
		int l, r;
		cin >> l >> r;
		ans += r - l + 1;
	}

	cout << ans << endl;

	return 0;
}

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

int main() {
  int n; cin >> n;
  double m=0;
  rep(i, n) {
    double a; cin >> a;
    m += 1/a;
  }

  cout << setprecision(20) << 1/m << endl;
}



Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int main(){
	int A,B; cin>>A>>B;
	cout<<A*B<<endl;

	return 0;
}

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

int main(void){
	int n, min = 1000000000, max = -1000000000;
	long int total = 0;
	int *num;

	cin >> n;
	
	num = new int[n];

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

	for (int i = 0; i < n; i++){
		if (min > num[i]) min = num[i];
		if (max < num[i]) max = num[i];

		total += num[i];
	}
	
	cout << min << " " << max << " " << total << "\n";

	delete[] num;
	return 0;
}

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

typedef long long ll;

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

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define ANS(n) cout << (n) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

int main()
{
	int n;
	cin >> n;
	int mx = 0;
	int ans = 0;
	FOR(i,0,n){
		int h;
		cin >> h;
		if(mx <= h)ans++;
		mx = max(mx, h);
	}
	ANS(ans);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using ll = long long;
const ll INF_LL = 1000000000000;
#define fir first
#define sec second

std::string ten_to_n(int ten,int base){
    if(ten == 0)return "0";
    std::string s;
    while(ten){
        int amari = ten % base;
        char c = '0' + amari;
        s.push_back(c);
        ten /= base;
    }
    std::reverse(s.begin(),s.end());
    return s;
}

int main()
{
    int n,k;
    std::cin >> n >> k;
    std::cout << ten_to_n(n,k).size() << std::endl;

}


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

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

  string board[50];

  rep(i, h) cin >> board[i];

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

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

      int num = 0;
      rep(d, 8) {
        const int ni = i + dy[d];
        const int nj = j + dx[d];

        if (ni < 0 || h <= ni) continue;
        if (nj < 0 || w <= nj) continue;
        if (board[ni][nj] == '#') num++;
      }

      board[i][j] = char(num + '0');
    }
  }

  rep(i, h) cout << board[i] << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

int main()
{ int N,a,b,c,d,x,y,s,t;
  cin>>N>>a>>b>>c>>d;
  s=N/a;
  t=N/c;
  if(N%a==0){
    x=s*b;
  }else{x=s*b+b;
  }
  if(N%c==0){
    y=t*d;
  }else{
  y=t*d+d;}
  if(x>y){
    cout<<y<<endl;
  }else{
  cout<<x<<endl;}

    return 0;
}



Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);i++)
#define erep(i,a,b) for(int i=a;i<=(int)(b);i++)
#define per(i,a,b) for(int i=(b)-1;i>(a);i--)
#define eper(i,a,b) for(int i=((int)(a));i>=b;i--)
#define pb push_back
#define mp make_pair
#define INF (1<<30)-1
#define MOD 1000000007
using namespace std;
typedef long long ll;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

int n;
ll a[100005];
ll ans, sum;
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> n;
    erep(i, 1, n) cin >> a[i];
    a[0] = 0, a[n+1] =0;
    erep(i, 1, n) sum += abs(a[i]-a[i-1]);
    sum += abs(a[n]-0);
    erep(i, 1, n) {
        ll t = sum;
        if ((a[i+1] <= a[i-1] && a[i-1] <= a[i]) || (a[i] <= a[i-1] && a[i-1] <= a[i+1])) 
            cout << t - 2*(abs(a[i]-a[i-1])) << endl;
        else if ((a[i] <= a[i+1] && a[i+1] <= a[i-1]) || (a[i-1] <= a[i+1] && a[i+1] <= a[i])) 
            cout << t - 2*(abs(a[i]-a[i+1])) << endl;
        else if ((a[i - 1] <= a[i] && a[i] <= a[i + 1]) ||
                 (a[i + 1] <= a[i] && a[i] <= a[i - 1]))
          cout << t << endl;
    }
    return 0;
}


Measured memory_bytes: 2048
#include<iostream>
#include<stdio.h>

using namespace std;

int amida[31][31] = { 0 };

int main(){

    int W, n;

    cin >> W;
    for (int vertical = 1; vertical <= W; vertical++){
        amida[vertical][0] = vertical;
    }

    cin >> n;
    for (int horizonal = 1; horizonal <= n; horizonal++){
        int a, b;
        scanf("%d,%d", &a, &b);

        for (int i = 1; i <= W; i++){
            if (i == a){
                amida[i][horizonal] = amida[b][horizonal - 1];
            }
            else if (i==b)
            {
                amida[i][horizonal] = amida[a][horizonal - 1];
            }
            else
            {
                amida[i][horizonal] = amida[i][horizonal - 1];
            }
        }
    }

    for (int i = 1; i <= W;i++){
        cout << amida[i][n] << endl;
    }

    return 0;
}

Measured memory_bytes: 1244
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K;
  cin >> N >> K;
  double ans = 0;
  
  for(int i =1;i<=N;i++){
    for(int j=0;j<20;j++){
      
      if(K <= i * int(pow(2,j))){
        ans += 1.0 / double(N * pow(2,j));
        //cout << setprecision(10) << ans << endl;
        break;
      }
    }
  }
  cout << setprecision(10) << ans << endl;
}


Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(dead_code)]
use std::cmp;
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::{self, stdin, BufRead};
use std::str::FromStr;

fn read_one<T>() -> T
where
    T: FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let stdin = stdin();
    let mut handle = stdin.lock();
    let mut buf = String::new();
    handle.read_line(&mut buf).unwrap();

    buf.trim().parse::<T>().unwrap()
}

macro_rules! read_tuple {
    ( $( $t:ty ), * ) => {
        {
            let stdin = stdin();
            let mut handle = stdin.lock();
            let mut buf = String::new();
            handle.read_line(&mut buf).unwrap();
            let mut v = buf.trim().split_whitespace()
                .collect::<VecDeque<&str>>();
            (
                $({
                    v.pop_front().unwrap().parse::<$t>().unwrap()
                },)*
            )
        }
    }
}

fn read_vec<T>() -> Vec<T>
where
    T: FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let stdin = stdin();
    let mut handle = stdin.lock();
    let mut buf = String::new();
    handle.read_line(&mut buf).unwrap();

    buf.trim()
        .split_whitespace()
        .map(|s| s.parse::<T>().unwrap())
        .collect::<Vec<T>>()
}

fn main() -> io::Result<()> {
    let mut n = read_one::<i32>();
    let mut sum: i64 = 0;
    for i in (1..n + 1) {
        if i % 3 != 0 && i % 5 != 0 {
            sum += i as i64;
        }
    }
    println!("{}", sum);
    return Ok(());
}


Measured memory_bytes: 2188
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)n; i++)
#define REPvec(itr, mp) for(auto itr = mp.begin();itr != mp.end(); itr ++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007//1e9+7
using namespace std;
typedef long long ll;
typedef vector<int >    vecint;
typedef vector<string > vecstr;
int main()
{
  string s;
  cin >> s;
  char c = s[0];
  if(s[1] == c&&s[2] == c){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
  ll n,k,c=2100;
  cin>>n>>k;
  for(ll i=n;i<k;i++){
    if(i<n+2019){
      for(ll j=i+1;j<=k;j++){
        if(j<i+2019){
          c=min(c,i*j%2019);
        }else break;
      }
    }else break;
  }
  cout<<c;
}

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

using namespace std;

#define DUMP(x) std::cout << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    int h, w;
    cin >> h >> w;
    vstr s(h);
    rep(i, h) cin >> s[i];

    int dist[55][55];
    arrayFill(dist, -1);
    dist[0][0] = 0;

    qpint q;
    q.emplace(0, 0);

    vint dx{1, 0, -1, 0};
    vint dy{0, 1, 0, -1};

    while (!q.empty())
    {
        auto pos = q.front();
        q.pop();

        rep(i, 4)
        {
            int nx = pos.second + dx[i];
            int ny = pos.first + dy[i];

            if (nx >= 0 && ny >= 0 && nx < w && ny < h && dist[ny][nx] == -1 && s[ny][nx] == '.')
            {
                dist[ny][nx] = dist[pos.first][pos.second] + 1;

                q.emplace(ny, nx);
            }
        }
    }

    if (dist[h - 1][w - 1] == -1)
    {
        M1;
        return;
    }

    int cnt = 0;
    rep(i, h) rep(j, w)
    {
        if (s[i][j] == '.')
        {
            ++cnt;
        }
    }
    cout << cnt - dist[h - 1][w - 1] - 1 << 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: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{

    static class Program
    {
        static void Main()
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            //

            var cin = GetStrArray();
            var ans = YESNO(cin[0].Last() == cin[1].First() && cin[1].Last() == cin[2].First());

            Console.WriteLine(ans);

            //
            Console.Out.Flush();
            Console.ReadKey();
        }

        static void Solve()
        {

        }



        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public char[] GetCharArray() { return Console.ReadLine().Split(' ').Select(char.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
        static string yesno(this bool b) { return b ? "yes" : "no"; }
        static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        static string YESNO(this bool b) { return b ? "YES" : "NO"; }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c, out V d)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<V>(ar[3]);
        }
    }
}

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

const int mn=1e5+7,mod=1e9+7;
int vis[mn],f[mn],n,m,a;

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;++i) {scanf("%d",&a);a++;vis[a]=1;}
	f[1]=1;
	for(int i=2;i<=n+1;++i) {
		if(!vis[i-1]) f[i]+=f[i-1];
		f[i]%=mod;
		if(!vis[i-2]) f[i]+=f[i-2];
		f[i]%=mod;
	}
	printf("%d",f[n+1]);
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
//#define scanf scanf_s

int main()
{
	int n,d;
	while (cin >> d)
	{
		int s = 0;
		for (int i = 1; i < 600/d; i++)
		{
			s += d*i*d*i*d;
		}
		cout << s << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
def f(n):
    if n % 2 == 0:
        return n/2
    else:
        return 3*n+1


s = int(input())
cnt = 0
a = [s]
while True:

    temp = f(a[cnt])

    if temp in a:
        print(len(a)+1)
        exit()
    a.append(temp)
    cnt += 1


Measured memory_bytes: 9176
#include <iostream>
using namespace std;
char mp[10][10];
int main()
{
	ios::sync_with_stdio(false);
	int h, w, k, sum = 0, ans = 0;
	int rowb[10] = { 0 }, colb[10] = { 0 };
	cin >> h >> w >> k;
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			cin >> mp[i][j];
			if (mp[i][j] == '#')
			{
				rowb[i]++;
				colb[j]++;
				sum++;
			}
		}
	}
	for (int i = 0; i < (1 << h); i++)
	{
		int suma = sum;
		bool rvis[10] = { 0 };
		for (int j = 0; j < h; j++)
		{
			if (i & (1 << j))
			{
				rvis[j] = true;
				suma -= rowb[j];
			}
		}
		for (int j = 0; j < (1 << w); j++)
		{
			int sumb = suma;
			bool cvis[10] = { 0 };
			for (int k = 0; k < w; k++)
			{
				if (j & (1 << k))
				{
					cvis[k] = true;
					sumb -= colb[k];
				}
			}
			for (int k = 0; k < h; k++)
			{
				if(rvis[k])
				for (int l = 0; l < w; l++)
				{
					if (cvis[l] && mp[k][l] == '#')
						sumb++;
				}
			}
			if (sumb == k)
				ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3644
#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); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

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 long long INF = 1LL << 60;

int main(){
  vector<int> a(3);
  rep(i, 3) cin >> a[i];
  sort(all(a));

  bool ok = false;
  if(a[0] == a[1] && a[1] != a[2]) ok = true;
  if(a[1] == a[2] && a[1] != a[0]) ok = true;

  cout << (ok ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long 
#define ld long double
#define pb push_back
#define vl vector
#define ff first
#define ss second
using namespace std;
int main()
{
    ll a,b,i,j,n,t;
    cin>>a>>b;
    if(a<b) cout<<0;
    else cout<<10;
}

Measured memory_bytes: 3616
// CODE FESTIVAL 2017 qual A
// A - Snuke's favorite YAKINIKU

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;


string S;

int main() {

    cin >> S;

    cout << (S.find("YAKI") == 0 ? "Yes" : "No") << endl;

    return 0;

}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		for (int i = 0; i < n; i++)
			in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	}

	private static int solve(int n, int k) {
		int r = (n - 1) / (k - 1);
		if ((n - 1) % (k - 1) == 0)
			return r;
		else
			return r + 1;
	}
}

Measured memory_bytes: 47104
N = int(input())
a = [int(i) for i in input().split()]

s = 1
s = 399
ct = [0 for i in range(8)]
wild = 0

for i in a:
    idx = 0
    if i >= 3200:
        wild += 1
    else:
        for j in range(400, 3201, 400):
            if i < j:
                ct[idx] = 1
                break
            idx += 1

Min = max(1, sum(ct))
Max = wild + sum(ct)

print(Min, Max)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main() {
	int a,b;
	string s;
	cin>>a>>b>>s;
	int i;
	if(s[a]!='-') {
		cout<<"No"<<endl;
		return 0;
	}
	for(i=0; i<a+b; i++) {
		if(i!=a) {
			if(s[i]<'0'||s[i]>'9') {
				cout<<"No"<<endl;
				return 0;
			}
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}



Measured memory_bytes: 256
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def _cmb(N, mod):
    N1 = N + 1
    fact = [1] * N1
    inv = [1] * N1

    for i in range(2, N1):
        fact[i] = fact[i-1] * i % mod

    inv[N] = pow(fact[N], mod-2, mod)
    for i in range(N-1, 1, -1):
        inv[i] = inv[i+1]*(i+1) % mod

    def cmb(a, b):
        return fact[a] * inv[b] * inv[a-b] % mod
    return cmb

def resolve():
    K = int(input())
    s = input()
    ls = len(s) - 1
    mod = 10**9+7

    cmb = _cmb(ls+K, mod)

    ans = 0
    p25 = 1
    p26 = pow(26, K, mod)
    p26inv = pow(26,  mod-2, mod)
    for i in range(K+1):
        ans += cmb(ls+i, ls) * p25 * p26
        ans %= mod
        p25 = p25 * 25 % mod
        p26 = p26 * p26inv % mod
    print(ans)

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 106904
#include<stdio.h>
#include<string.h>

const int L = 14;
const int M = 1046527;

char H[M][L]; /* Hash Table */

int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){ return key % M; }
int h2(int key){ return 1 + (key % (M-1)); }

int find(char str[]){
    long long key,i = 0;
    key = getKey(str);
    while(1)
    {
        int h = ( h1(key) + i*h2(key) ) % M;
        if(strcmp( H[h],str) == 0 ) return 1;
        else if(strlen(H[h]) == 0) return 0;
        i++; 
    }
    return 0;
}

void insert(char str[]){

    long long i = 0,key;
    key = getKey(str);
    while(1)
    {
        int h = ( h1(key) + i*h2(key) ) % M;
        if(strcmp(H[h],str) == 0 ) return ;
        else if(strlen(H[h]) == 0 )
        {
            strcpy(H[h],str);
            return ;
        }
        i++;
    }
    return ;
}

int main(){
    int i, n;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
        scanf("%d", &n);

    for ( i = 0; i < n; i++ ){
        scanf(" %s %s", com, str);

    if ( com[0] == 'i' ){
        insert(str);
    } else {
        if (find(str)){
        printf("yes\n");
        } else {
        printf("no\n");
        }
    }
    }

    return 0;
}


Measured memory_bytes: 16944
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

	vector<int> A(N), B(N);
	for(int i = 0; i < N; i++) {
		cin >> A[i] >> B[i];
	}

	sort(A.begin(), A.end());
	sort(B.begin(), B.end(), [](int &a, int &b) {
		return b > a;
	});

	if(N % 2 == 1) {
		const int minMedian = A[(N - 1) / 2];
		const int maxMedian = B[(N - 1) / 2];
		const int result = maxMedian - minMedian + 1;
		cout << result << endl;
	} else {
		const int minMedian2x = A[N / 2 - 1] + A[N / 2];
		const int maxMedian2x = B[N / 2 - 1] + B[N / 2];
		const int result = maxMedian2x - minMedian2x + 1;
		cout << result << endl;
	}

	return 0;
}


Measured memory_bytes: 4784
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vi;
typedef long double td;
typedef vector<td> vd;
typedef pair<ll,ll> ii;
typedef vector<ii> vii; typedef vector<bool> vb;
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define forr(i, a, b) for(ll i = ll(a); i < (ll)(b); i++)
#define forn(i, n) forr(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define DBG(x) cerr << #x << " = " << (x) << endl
#define show(v,n) cerr << #v << " = "; forn(i,n) cerr << v[i] << " "; cerr << endl;
#define esta(x,c) ((c).find(x) != (c).end())
#define RAYA cerr << "===============================" << endl
int MAXN = 500005;

struct item
{
	int w, v;
};

ll knapsack_weight(vector <item> &v, int n, int w)
{
	int MAXV = 100005, INF=2000000000;
	vector <ll> dp(MAXV+1,INF), aux(MAXV+1,INF);
	vector <bool> visto(MAXV,false);
	visto[0]=true; dp[0]=0;
	forn(i,n)
	{
		forn(j,MAXV)
		{
			aux[j]=dp[j];
			if(j-v[i].v < 0) continue;
			if(visto[j-v[i].v]==true)
			{
				aux[j]=min(aux[j],dp[j-v[i].v]+v[i].w);
				visto[j]=true;
			}
		}
		forn(j,MAXV) dp[j]=aux[j];
	}
	ll ans = 0;
	forn(i,MAXV+1) if(dp[i] <= w && visto[i]==true) ans=i;
	return ans;
}
 
int main()
{ 	
	FIN;
	#ifdef input
		freopen("test1.txt", "r", stdin);
	#endif

	int n, w;
	cin >> n >> w;
	vector <item> v(n);
	forn(i,n) cin >> v[i].w >> v[i].v;
	cout << knapsack_weight(v,n,w) << endl;
    return 0;
}

Measured memory_bytes: 4760
#include <bits/stdc++.h>
#include <complex>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,C,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
const long double EPS = 1e-9;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main() {
    cin>>N;
    cout<<(((N/10 == 9) || (N%10 == 9)) ? "Yes" : "No")<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
 
using namespace std;
 
int main()
{
    char s[11];
    char t[12];
    int n;
 
    cin >> s;
    cin >> t;
 
    n = strlen(s);
    int j = 0;
 
    for(int i = 0; i <= n; i++){
        if(s[i] != t[i]){
            j += 1;
        }
    }
    if(j>1){
        cout << "No";
    }else
    {
        cout <<"Yes";
    }
    
}

Measured memory_bytes: 3032
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>

using namespace std;
typedef long long ll;

ll num[4] = {};

int main() {
	cin >> num[1] >> num[2] >> num[3];
	stable_sort(num, num + 4);
	if ((num[2] - num[1]) % 2 == 0) {
		cout << (num[2] - num[1]) / 2 + num[3] - num[2] << endl;
	}
	else {
		cout << 1 + (num[2] - num[1] - 1) / 2 + num[3] + 1 - num[2] << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define all(cont) cont.begin(), cont.end()
#define foreach(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define fore(i,a,b) for(int i=a,almo5t=b;i<almo5t;++i)
#define SZ(x) ((int)x.size())
#define EPS 1e-9
#define PI acos(-1)
#define MOD 1000000007
#define FIN std::ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
 
const int MAXN = 1e7;
 
typedef long long int ll;
 
using namespace std;
 
ll x,k,d;
 
ll ts()
{
    if(round(x/d)>k){
        return x-k*d;
    }else{
        k -= x/d;
        if(!(k%2)){
            return x%d;
        }else{
            return abs((x%d)-d);
        }
    }
}
 
int main(){
    FIN;
    //freopen("../../input.txt", "r", stdin);freopen("../../output.txt", "w", stdout);
    cin>>x>>k>>d;
    x = abs(x);
    ll ans = ts();
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3608
N,S = open(0).read().split()
N = int(N)
w = S.count('.')
ans = float('inf')
ws = [0] * (N+1)
for i in range(1,N+1):
    ws[i] = ws[i-1]
    if S[i-1] == '.':
        ws[i] += 1
for i in range(N+1):
    ans = min(ans,i-2*ws[i]+w)
print(ans)

Measured memory_bytes: 16596
def solve():
    N = int(input())

    numss = [[0]*(10) for _ in range(10)]
    for x in range(1, 10):
        for y in range(1, 10):
            num = 0
            for d in range(1, 5):
                for i in range(10**d):
                    j = x*10**(d+1) + i*10 + y
                    if 1 <= j <= N:
                        num += 1
                    else:
                        break
            j = x*10 + y
            if 1 <= j <= N:
                num += 1
            if x == y:
                j = x
                if 1 <= j <= N:
                    num += 1
            numss[x][y] = num

    ans = 0
    for A in range(1, N+1):
        ss = str(A)
        ans += numss[int(ss[-1])][int(ss[0])]

    print(ans)


solve()


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

using ll = long long;

const int MAX_N = 1e5+5;

int N;
ll A, B;
ll health[MAX_N];
ll h[MAX_N];

bool go(ll x) {
  for (int i=0;i<N;i++) {
    h[i] = max(0ll, health[i] - (x * B));
  }

  ll tot = 0;
  for (int i=0;i<N;i++) {
    tot += (h[i] / A);
    if (h[i] % A) {
      tot++;
    }
  }
  return tot <= x;
}

int main() {
  scanf("%d",&N);
  scanf("%lld %lld",&A,&B);
  A -= B;
  for (int i=0;i<N;i++) {
    scanf("%lld",&health[i]);
  }

  ll lo = 0;
  ll hi = (2e9);
  ll ans = (2e9);
  while (lo <= hi) {
    ll mid = (lo+hi)/2ll;
    if (go(mid)) {
      ans = mid;
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  printf("%lld\n",ans);
}

Measured memory_bytes: 1792