akhauriyash/Code-Regression huggingface dataset:
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	int H, W;
	char[][] A;
	char[][] p;

	boolean check(char[][] p) {
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				if (A[i][j] != p[i][j]) {
					return false;
				}
			}
		}
		return true;
	}

	boolean dfs(int h, int w) {
		if (h == H - 1 && w == W - 1) {
			if (check(p)) {
				return true;
			} else {
				return false;
			}
		}

		// 右
		if (w != W - 1) {
			w++;
			p[h][w] = '#';

			boolean b = dfs(h, w);
			if (b) {
				return true;
			}

			p[h][w] = '.';
			w--;
		}

		// 下
		if (h != H - 1) {
			h++;
			p[h][w] = '#';

			boolean b = dfs(h, w);
			if (b) {
				return true;
			}

			p[h][w] = '.';
			h--;
		}

		return false;

	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		H = sc.nextInt();
		W = sc.nextInt();
		A = new char[H][W];
		for (int i = 0; i < H; i++) {
			String s = sc.next();
			A[i] = s.toCharArray();
		}
		sc.close();

		p = new char[H][W];
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				p[i][j] = '.';
			}
		}
		int w = 0, h = 0;
		p[h][w] = '#';

		if (dfs(h, w)) {
			out.println("Possible");
		} else {
			out.println("Impossible");
		}

	}

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


Measured memory_bytes: 25044
// Written by newbiechd
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <vector>

const int BUFFER_SIZE = 1 << 25 | 1;
struct InputOutputStream {
  char ibuf[BUFFER_SIZE], obuf[BUFFER_SIZE], *s, *oh;
  InputOutputStream() : s(ibuf), oh(obuf) {
    ibuf[fread(ibuf, 1, BUFFER_SIZE, stdin)] = '\0';
  }
  ~InputOutputStream() { fwrite(obuf, 1, oh - obuf, stdout); }
  template <typename T>
  inline InputOutputStream &operator>>(T &x) {
    while (!isdigit(*s)) ++s;
    for (x = 0; isdigit(*s); ++s)
      x = x * 10 + (*s ^ '0');
    return *this;
  }
}IO;

template <typename lhs, typename rhs>
inline lhs min(const lhs &x, const rhs &y) { return x < y ? x : y; }
template <typename lhs, typename rhs>
inline lhs max(const lhs &x, const rhs &y) { return x > y ? x : y; }

const int maxN = 50003, maxM = 100003;
int u[maxM], v[maxM], cnt[maxN], tar[maxN];
std::bitset<maxN> a[maxN];
char ans[maxM];

int main() {
  int n, m, T;
  IO >> n >> m >> T;
  if (T == 1) {
    for (int i = 1; i <= n; ++i)
      a[i].set(i);
    for (int i = 1; i <= m; ++i)
      IO >> u[i] >> v[i], a[u[i]] = a[v[i]] = a[u[i]] | a[v[i]];
    for (int i = 1; i <= n; ++i)
      if (int(a[i].count()) == n) {
        static std::bitset<maxN> b;
        b.set(i);
        for (int j = m; j; --j)
          if (b[u[j]])
            b.set(v[j]), ans[j] = '^';
          else
            b[u[j]] = b[u[j]] | b[v[j]], ans[j] = 'v';
        printf("%s\n", ans + 1);
        return 0;
      }
    printf("-1\n");
  }
  else {
    if (n < 3) {
      printf("-1\n");
      return 0;
    }
    for (int i = 1; i <= m; ++i)
      IO >> u[i] >> v[i];
    for (int i = 1; i <= n; ++i)
      ++cnt[i], tar[i] = i;
    for (int i = m; i; --i) {
      if (cnt[tar[u[i]]] > 1)
        ans[i] = 'v', ++cnt[tar[v[i]]], --cnt[tar[u[i]]], tar[u[i]] = tar[v[i]];
      else
        ans[i] = '^', ++cnt[tar[u[i]]], --cnt[tar[v[i]]], tar[v[i]] = tar[u[i]];
    }
    printf("%s\n", ans + 1);
  }
  return 0;
}


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



void solve(long long N, long long M, std::vector<long long> H, std::vector<long long> A, std::vector<long long> B){
    vector< vector<int> > graph(N+1, vector<int>(1));
    for(int i = 0; i < M; i++) {
        graph[B[i]].push_back(A[i]);
        graph[A[i]].push_back(B[i]);
    }

    int res = 0;
    for(int i = 1; i < graph.size(); i++) {
        bool flag = true;
        if(graph[i].size() == 1) {
            res++;
            continue;
        }
        for(int j = 1; j < graph[i].size(); j++) {
            if(H[i-1] <= H[graph[i][j]-1]) {
                flag = false;
                break;
            }
        }
        if(flag) res++;
    }


    cout << res << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> H(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&H[i]);
    }
    std::vector<long long> A(M);
    std::vector<long long> B(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&A[i]);
        scanf("%lld",&B[i]);
    }
    solve(N, M, std::move(H), std::move(A), std::move(B));
    return 0;
}


Measured memory_bytes: 11772
#include <bits/stdc++.h>
//#include "Local_Debug.h"
using namespace std;
#define Endl endl
typedef long long ll;
const int MAXN = (int)2e5 + 5;
ll m, d;
bool check(ll m, ll d)
{
	string s = to_string(d);
	if (s[0] >= '2'&&s[1] >= '2')
	{
		ll tmp = (s[0] - '0')*(s[1] - '0');
		if (tmp == m)
			return true;
		else
			return false;
	}
	return false;
}
int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	while (cin >> m >> d)
	{
		ll ans = 0;
		for (ll i = 1; i <= m; ++i)
			for (ll j = 1; j <= d; ++j)
				if (check(i, j))
					ans++;
		cout << ans << endl;
	}
}
/*
15 40

12 31

1 1
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
const int inf=1e9+7;
const ll INF=1LL<<61;
const ll mod=1e9+7;

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

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int i,j;
	string s,t;
	cin>>s>>t;
	for(i=0;i<s.size();i++){
		if(s[i]!=t[i]){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;

}

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

using namespace std;

int main(void) {
	string s; cin >> s;
	if (s == "Sunny") {
		cout << "Cloudy" << endl;
	}
	else if (s == "Cloudy")
	{
		cout << "Rainy" << endl;
	}
	else if (s == "Rainy") {
		cout << "Sunny" << endl;
	}

	return 0;
}

Measured memory_bytes: 764
#include<iostream>
#define mod 1000000007
using namespace std;
int n, m, i, j, ii, sol, x, nr;
int d[18][(1 << 16) + 2], v[18], fact[(1 << 16) + 2], inv[(1 << 16) + 2];
long long x2, y2;
void invmod(long long a, long long b, long long &x, long long &y){
    if(b == 0){
        x = 1;
        y = 0;
    }
    else{
        long long x2, y2;
        invmod(b, a % b, x2, y2);
        x = y2;
        y = x2 - a / b * y2;
    }
}
int ar(int n, int k){
    return fact[n] * 1LL * inv[n - k] % mod;
}
int main(){
    cin>> n >> m;
    for(i = 1; i <= m; i++){
        cin>> v[i];
    }
    fact[0] = 1;
    for(i = 1; i < (1 << n); i++){
        fact[i] = fact[i - 1] * 1LL * i % mod;
    }
    invmod(fact[(1 << n) - 1], mod, x2, y2);
    x2 %= mod;
    if(x2 < 0){
        x2 += mod;
    }
    inv[(1 << n) - 1] = x2;
    for(i = (1 << n) - 2; i >= 0; i--){
        inv[i] = inv[i + 1] * 1LL * (i + 1) % mod;
    }
    d[m + 1][0] = 1;
    for(i = m; i >= 1; i--){
        for(ii = 0; ii < (1 << n); ii++){
            d[i][ii] = d[i + 1][ii];
            for(j = 0; j < n; j++){
                if( ( (ii >> j) & 1) == 1){
                    x = (1 << n) - ii + (1 << j) - v[i];
                    if(x >= (1 << j) - 1){
                        d[i][ii] = (d[i][ii] + d[i + 1][ii - (1 << j)] * 1LL * ar(x, (1 << j) - 1) % mod * (1 << j)) % mod;
                    }
                }
            }
        }
        int abc = 0;
    }
    sol = fact[(1 << n) - 1];
    for(ii = 1; ii < (1 << n); ii++){
        nr = 0;
        for(j = 0; j < n; j++){
            if( ( (ii >> j) & 1) == 1){
                nr++;
            }
        }
        if(nr % 2 == 1){
            sol -= d[1][ii] * 1LL * fact[(1 << n) - 1 - ii] % mod;
            if(sol < 0){
                sol += mod;
            }
        }
        else{
            sol += d[1][ii] * 1LL * fact[(1 << n) - 1 - ii] % mod;
            if(sol >= mod){
                sol -= mod;
            }
        }
    }
    sol = sol * 1LL * (1 << n) % mod;
    cout<< sol;
    return 0;
}


Measured memory_bytes: 4864
n=int(input())
da=list(map(int,input().split()))
su=0
for i in da:
    su+=i
co=0
ans=0
for i in range(n):
    co+=da[i]
    if co>su/2:
        ans=min(co*2-su,su-(co-da[i])*2)
        break
print(ans)

Measured memory_bytes: 3064
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#include<string>
#define MOD 998244353
#define INF 0x3f3f3f3f
#define eps 1e-4
#define N 210000
#define NUM 2000000
#define CHILD 29
#define DINF 99999999999.9
const double PI=acos(-1.0);
using namespace std;
typedef long long LL;
int main()
{
	int i,j,t,n;
	LL a,b;
	scanf("%d",&n);
	scanf("%lld",&a);
	for(i=1;i<n;i++)
	{
		scanf("%lld",&b);
		a=a/__gcd(a,b)*b;
	}
	printf("%lld\n",a);
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String... args) throws Exception {
		try (Scanner scn = new Scanner(System.in)){
			System.out.println(to26Str(scn.nextLong()));
		}
		/*
		for(int i=17576; i<=(17576) + 26*26 + 26*2; i++) {
			System.out.println(i + ": " + to26Str(i));
		}
		*/
	}
	// zを0、aを1に割り当てる
	static final char[] chars = "zabcdefghijklmnopqrstuvwxy".toCharArray();
	static final int radix = chars.length;

	public static String to26Str(long num) {
		StringBuilder sb = new StringBuilder();
		do {
			sb.append(chars[(int)(num % radix)]);
			num = (num-1) / radix;	// 0(z)のとき桁上りしない
		} while(0 < num);

		return sb.reverse().toString();
	}

}


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

typedef long long ll;

int main () {
    int n;
    vector<int> v;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int k;
        cin >> k;
        v.push_back(k);
    }
    cout << *max_element(v.begin(), v.end()) - *min_element(v.begin(), v.end()) << endl;
}


Measured memory_bytes: 256
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 998244353
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2] != 1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    return [w[0],w[1]]
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return ( m + x%m ) % m
    
def nCk(n,k):
    res = 1
    a=n-k
    b=k
    for i in range(1,a+b+1):
        res = res*i%mod
    for i in range(1,a+1):
        res = res*mod_inv(i,mod)%mod
    for i in range(1,b+1):                                 
        res = res*mod_inv(i,mod)%mod
    return res

def main():
    n,m,k = inpm()
    if k == 0:
        print((m*pow(m-1,n-1,mod))%mod)
        return
    if m == 1:
        if n-1 > k:
            print(0)
            return
        print(1)
        return

    ans = 0
    a = (m*pow(m-1,n-1,mod))%mod
    b = 1
    x = mod_inv(m-1,mod)
    for i in range(k+1):
        ans += (a*b)%mod
        ans %= mod
        a = a*x%mod
        b = b*(n-1-i)%mod
        b = b*mod_inv(i+1,mod)%mod
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 10860
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


n, k = inpl()
a = inpl()
dp = [(0, 0)] * n
changed=set(range(n))
for j in range(k):
    for i in changed:
        l = max(0, i - a[i])
        r = min(n - 1, i + a[i])
        dp[i] = (l, r)
    imos = [0] * n
    for i in range(n):
        l, r = dp[i]
        imos[l] += 1
        if r < n - 1:
            imos[r + 1] -= 1
    tmp = 0
    for i in range(n):
        tmp += imos[i]
        a[i] = tmp
    if j>50:
        break
print(*a)


Measured memory_bytes: 184608
#include<bits/stdc++.h>
using namespace std;
#define INF 1e9
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
const int MOD = 1000000007;

void solve() {
  ll x, y;
  cin >> x >> y;
  ll temp = x;
  ll ans = 1;
  for(;;) {
    temp *= 2;
    if (temp > y) break;
    ans++;
  }
  cout << ans << endl;
}

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

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
using namespace std;
int n,m,k;
signed main()
{
	scanf("%d%d%d",&n,&m,&k);
	puts((((n<=k)&&(k<=m))?("Yes"):("No")));
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
class P{
    static void Main(){
        long n = long.Parse(Console.ReadLine());
        List<long> p = new List<long>();
        p.Add(7);
        p.Add(5);
        p.Add(3);
        int ist = 0;
        int ien = 2;
        for (int i = 0;i < 8;i++){
            for (int j = ist;j <= ien;j++){
                p.Add(p[j] * 10 + 7);
                p.Add(p[j] * 10 + 5);
                p.Add(p[j] * 10 + 3);
            }
            int r = ien - ist + 1;
            ist = ien + 1;
            ien += r * 3 + 1;
        }
        int ans = 0;
        p.Sort();
        foreach (var i in p){
            if (i > n) break;
            //Console.WriteLine(i);
            ans += Judge(i) ? 1 : 0;
        }
        Console.WriteLine(ans);
    }
    static bool Judge(long n){ //nが七五三数か判定
        int c7 = 0;
        int c5 = 0;
        int c3 = 0;
        while (n > 0){
            long m = n % 10;
            if (m == 7)
                c7++;
            else if (m == 5)
                c5++;
            else if (m == 3)
                c3++;
            else
                return false;
            n /= 10;
        }
        if (c7 == 0 || c5 == 0 || c3 == 0)
            return false;
        return true;
    }
}

Measured memory_bytes: 14176
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }


using namespace std;

int main(){

    char s;
    cin >> s;
    s++;
    cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define SORT(x) sort((x).begin(),(x).end())
int main(void){
    
    int A, B;
    cin >>A >>B;
    
    if(((A+B)>=(A-B))&&((A+B)>=(A*B))){
        cout <<(A+B);
    }else if(((A-B)>=(A+B))&&((A-B)>=(A*B))){
        cout <<(A-B);
    }else{
        cout <<(A*B);
    }
    
    cout <<endl;
    
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;
using ll=long long;

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

int main(){
  int a,b,c;
  cin>>a>>b>>c;
  a==b ? cout<<c<<endl : a==c ? cout<<b<<endl : cout<<a<<endl;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	n := nextInt()
	m := map[string]int{}

	before := nextStr()
	m[before]++
	for i := 0; i < n-1; i++ {
		now := nextStr()
		_, ok := m[now]
		if ok == true {
			fmt.Println("No")
			return
		}
		m[now]++

		if now[0] != before[len(before)-1] {
			fmt.Println("No")
			return
		}
		before = now

	}

	fmt.Println("Yes")
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


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


int main(){
    int N,M;
    cin >> N >> M;
    
    vector<vector<int>>vec(M);
    
    for(int i=0 ;i<M ;i++){
        int k; cin >> k;
        vec[i].resize(k);
        for(int j=0;j<k;j++){
            cin >> vec[i][j];
            vec[i][j]--;
        }
    }
    
    vector<int>p(M);
    for(int i=0;i<M;i++) cin >> p[i];
    
    int ans = 0;
    
    for(int i=0 ;i < (1<<N) ;i++){
        bool ok = true;
        for(int j=0;j<M;j++){
            int c=0;
            for(int id :vec[j]){
                if((i>>id) & 1){
                    c++;
                }
            }
            c %= 2;
            if(c != p[j]){
                ok = false;
            }
        }
        if(ok){
            ans++;
        }
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 3644
#include<iostream>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int MOD = 1000000007;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long 
signed main() 
{
    int n;
    cin>>n;
    int x=(n)/1000;
    if(n%1000)cout<<((x+1)*1000-n);
    else cout<<0;

    return 0; 
} 

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long LL;
LL mod = 1e9 + 7;
LL A[405], B[405];
LL dp[405][405];
LL p[405][405];
LL sum[405][405];
int main()
{
    for(int i = 1; i < 405; i++)
    {
        p[i][0] = 1;
        for(int j = 1; j <= 400; j++)
            p[i][j] = p[i][j-1]*i%mod;
    }
    for(int i = 1; i <= 400; i++)
        for(int j = 0; j <= 400; j++)
            sum[i][j] = (sum[i][j] + sum[i-1][j] + p[i][j])%mod;
    int n, c;
    while(~scanf("%d%d", &n, &c))
    {
        for(int i = 1; i <= n; i++)
            scanf("%lld", &A[i]);
        for(int i = 1; i <= n; i++)
            scanf("%lld", &B[i]);
        memset(dp, 0, sizeof(dp));
        dp[0][0] = 1;
        for(int i = 1; i <= n; i++)
        {
            for(int j = 0; j <= c; j++)
            {
                for(int k = 0; k <= j; k++)
                {
                    LL tmp = (sum[B[i]][k] - sum[A[i]-1][k] + mod)%mod;
                    dp[i][j] = (dp[i][j] + dp[i-1][j-k]*tmp)%mod;
                }
            }
        }
        printf("%lld\n", dp[n][c]);
    }
    return 0;
}


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

#define int long long
#define fi first
#define se second
#define ponto pair<int,int>

string n;

int32_t main()
{

	cin >> n;
	bool s = false;
	for(int i=0; i<n.size(); i++)
		if(n[i] == '7')
			s = true;
			
	puts(s ? "Yes" : "No");

}

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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int n,w;cin>>n>>w;
    vl we(n),va(n);
    rep(i,n)cin>>we[i]>>va[i];
    //wが10^9までなので愚直にDPできない
    //そこでdp[i][j] を価値iを達成する最小の重さとする
    vvl dp(100010,vl(110,INF));
    dp[0][0] = 0;
    rep(i,100001){
        rep(j,n){
            chmin(dp[i][j+1],dp[i][j]);
            if(i-va[j]>=0)chmin(dp[i][j+1],dp[i-va[j]][j]+we[j]);
        }
    }
    ll res = 0;
    rep(i,100001)if(dp[i][n] <= w) chmax(res,i*1LL);
    out(res);
}


Measured memory_bytes: 90240
#include <bits/stdc++.h>
using namespace std;
struct fastio { fastio () { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } } _io;
template<class T, class U> bool chmax(T& a, const U &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class U> bool chmin(T& a, const U &b) { if (a > b) { a = b; return 1; } return 0; }

inline long long solve (long long n) {
    long long res = 0;
    while (n > 0) {
        res++;
        const int d = __builtin_popcount(n);
        n %= d;
    }
    return res;
}

int main() {
    long long n, p = 0;
    cin >> n;
    vector<long long> x(n);
    for (long long i = 0; i < n; i++) {
        char c;
        cin >> c;
        x[i] = (c - '0');
        if (x[i] == 1) p++;
    }
    reverse(x.begin(), x.end());

    long long two[3];
    vector<long long> a[3], b[3];
    for (long long i = 0; i < 3; i++) {
        two[i] = 1;
        a[i].assign(n + 1, 0);
        b[i].assign(n + 1, 0);
    }
    if (p > 1) two[0] %= (p - 1);
    two[2] %= (p + 1);

    b[0][0] = two[0];
    b[2][0] = two[2];

    for (long long i = 0; i < n; i++) {
        for (long long j = -1; j <= 1; j += 2) {
            long long mod = p + j;
            if (mod > 0) {
                a[j + 1][i + 1] = (a[j + 1][i] + two[j + 1] * x[i]) % mod;
                two[j + 1] = (two[j + 1] << 1) % mod;
                b[j + 1][i + 1] = two[j + 1];
            }
        }
    }

    vector<long long> ans;

    for (long long i = 0; i < n; i++) {
        long long mod = p;
        if (x[i]) {
            mod--;
            if (mod <= 0) {
                ans.push_back(0);
                continue;
            }
            long long val = a[0][n] - b[0][i];
            if (val < 0) {
                long long res = (abs(val) + mod - 1) / mod;
                val += res * mod;
            }
			val %= mod;
            ans.push_back(solve(val) + 1);
        } else {
            mod++;
            long long val = a[2][n] + b[2][i];
            if (val < 0) {
                long long res = (abs(val) + mod - 1) / mod;
                val += res * mod;
            }
			val %= mod;
            ans.push_back(solve(val) + 1);
        }
    }

    reverse(ans.begin(), ans.end());
    for (long long e : ans) cout << e << '\n';
    return 0;
}

Measured memory_bytes: 16252
/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    prayer
*/

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

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

	string s;
  cin>>s;
  bool h=true;
  rep(i,s.size())if(i%2==0&&s[i]=='L'||i%2&&s[i]=='R')h=false;
  if(h)yes;
  else no;
}


Measured memory_bytes: 256
c = [list(map(int,input().split())) for i in range(3)]

ans = True
if not(c[0][0]-c[0][1] == c[1][0]-c[1][1] and c[1][0]-c[1][1] == c[2][0]-c[2][1] and c[2][0]-c[2][1] == c[0][0]-c[0][1]):
  ans = False

if not(c[0][1]-c[0][2] == c[1][1]-c[1][2] and c[1][1]-c[1][2] == c[2][1]-c[2][2] and c[2][1]-c[2][2] == c[0][1]-c[0][2]):
  ans = False
  
if not(c[0][0]-c[0][2] == c[1][0]-c[1][2] and c[1][0]-c[1][2] == c[2][0]-c[2][2] and c[2][0]-c[2][2] == c[0][0]-c[0][2]):
  ans = False
  
if not(c[0][0]-c[1][0] == c[0][1]-c[1][1] and c[0][1]-c[1][1] == c[0][2]-c[1][2] and c[0][2]-c[1][2] == c[0][0]-c[1][0]):
  ans = False

if not(c[0][0]-c[2][0] == c[0][1]-c[2][1] and c[0][1]-c[2][1] == c[0][2]-c[2][2] and c[0][2]-c[2][2] == c[0][0]-c[2][0]):
  ans = False

if not(c[2][0]-c[1][0] == c[2][1]-c[1][1] and c[2][1]-c[1][1] == c[2][2]-c[1][2] and c[2][2]-c[1][2] == c[2][0]-c[1][0]):
  ans = False
print("Yes" if ans else "No")

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

const int N = 1e7 + 5;
const int mod = 998244353;
int fra[N], inv[N];
int n, a, b, ans;

template <class T>
inline T Min(T x, T y) {return x < y ? x : y;}

inline void add(int &x, int y)
{
	x += y;
	x >= mod ? x -= mod : 0;
}

inline void dec(int &x, int y)
{
	x -= y;
	x < 0 ? x += mod : 0;
}

inline void add_prod(int &x, int u, int v)
{
	x = (1ll * u * v + x) % mod;
}

inline int quick_pow(int x, int k)
{
	int res = 1;
	while (k)
	{
		if (k & 1)
			res = 1ll * res * x % mod;
		x = 1ll * x * x % mod;
		k >>= 1;
	}
	return res;
}

inline int C(int n, int m)
{
	if (n < m)
		return 0;
	return 1ll * fra[n] * inv[n - m] % mod * inv[m] % mod;
}

inline int ask(int k)
{
	int res = C(k + b - 1, b - 1);
	dec(res, C(k + b - 1, k - 1));
	return res;
}

int main()
{
	scanf("%d%d%d", &n, &a, &b);
	if (a == 0 && b == 0)
		return puts("1"), 0;
	fra[0] = 1;
	for (int i = 1; i <= n; ++i)
		fra[i] = 1ll * fra[i - 1] * i % mod;
	inv[n] = quick_pow(fra[n], mod - 2);
	for (int i = n; i >= 1; --i)
		inv[i - 1] = 1ll * inv[i] * i % mod;

	for (int k = 0, km = Min(n - b, Min(a, b - 1)); k <= km; ++k)
	{
		int tmp = k ? ask(k) : 1;
		if (k == a)
		{
			int x = n - b - k, 
				y = a - k + 1;
			if (x >= 0)
				add_prod(ans, tmp, C(x + y - 1, y - 1));
		}
		else
		{
			int x = n - b - k - 1,
				y = a - k + 1;
			if (x >= 0)
				add_prod(ans, tmp, C(x + y - 1, y - 1));
		}
	}
	printf("%d\n", ans);
	return 0;
}

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

int main(void)
{
	char s[200100], t[200100];
	int i, r = 0;

	scanf("%s%s", s, t);

	for (i = 0; s[i] != '\0'; i++)
		;

	for (int j = 0; j < i; j++)
	{
		if (s[j] != t[j])
		{
			r++;
		}
	}

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

Measured memory_bytes: 2504
#include <iostream>
#include <algorithm>
#include <atcoder/all>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#define PI 3.14159265359
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pai;
typedef pair<ll, ll> pal;
const int MOD = 1e9+7;
const ll LLINF = 1e18;


int main(){
	int n, q;
	cin >> n >> q;
	fenwick_tree<ll> fw(n);
	for (int i = 0; i < n; i++){
		int a;
		cin >> a;
		fw.add(i, a);
	}

	for (int i = 0; i < q; i++){
		int ver;
		cin >> ver;
		if (ver == 0){
			int p, x;
			cin >> p >> x;
			fw.add(p, x);
		}else{
			int l, r;
			cin >> l >> r;
			cout << fw.sum(l, r) << endl;
		}
	}
	return 0;
}



Measured memory_bytes: 8216
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define mk make_pair
#define pb push_back
#define ff first
#define ss second
#define ar array
#define del 1e-8

double pi=3.141592653589793238;
const int M = 1e9+7;
const int Nmax=5005;
const int MM = 998244353;
const int N=100001;

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int T=1;
	//cin>>T;
	while(T--){
      ll x,k,d;
      cin>>x>>k>>d;
      x=abs(x);
      ll ans=1e18;
      ll f=x-(x/d)*d;
      ll a=x/d;
      //cout<<a;
      if(k<=a)ans=(x-k*d);
      else {
        if((k-a)&1){
            ans=d-f;
        }
        else{
            ans=f;
        }
      }
      cout<<ans<<"\n";
	}
	return 0;
}


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

#define rep(i,a,b) for(i=(a);i<=(b);++i)
#define rev(i,a,b) for(i=(a);i>=(b);--i)
#define max2(a,b)  ((a)>(b)?(a):(b))
#define min2(a,b)  ((a)<(b)?(a):(b))
#define all(x) x.begin(),x.end()
#define sz(x) (long long)x.size()
#define fi first
#define se second
#define pb emplace_back // push_back
#define mp make_pair
#define endl '\n'

#ifdef Wild4Stone
template<typename T>
void __p(T a) { cout << a << " "; }
template<typename T, typename F>
void __p(pair<T, F> a) { cout << "{ "; __p(a.fi); __p(a.se); cout << "}"; }
template<typename T>
void __f(const char* s, T t) { cout << s << " : "; __p(t); }
template<typename T>
void __t(const char* s, const T &x) { cout << s << " : { "; for (auto it : x) __p(it); cout << "} ";}
template<typename T, typename ... F>
void __f(const char* s, T t, F ... f) {
	int i = 0; for (;; ++i) if (s[i] == ',') break;
	cout.write(s, i) << " : "; __p(t); cout << " | "; __f(s + i + 1, f...);
}
#define trace(...) { cout<<"LINE: "<<__LINE__<<" || "; __f(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
#define autra(...) { cout<<"LINE: "<<__LINE__<<" || "; __t(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
#else
#define trace(...) {}
#define autra(...) {}
#endif

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

const ll mod = 1000000007;  //998244353;
const ll inf = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
const double PI = acos(-1);

ll i, j, k;
void solve(void);
inline bool equal(double a, double b) { return fabs(a - b) < eps; }
// inline ll gcd(ll a, ll b) { a=abs(a); b=abs(b); while(a>0 && b>0) (a>b?a%=b:b%=a); return (a==0?b:a); }
// inline ll power(ll x, ll n, ll m = LLONG_MAX)
//        {  ll res=1; x = (x%m + m)%m;
//             while(n) { if(n&1) res=(res*x)%m;  x=(x*x)%m;  n >>= 1; }  return res;
//        }

int main()
{
	// ios_base::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	int t = 1;
	// cin>>t;
	while (t--)  solve();
	return 0;
}

//***************** Code Starts Here *******************//

void solve()
{
	int n, x, y; cin >> n >> x >> y;

	vector<int> v[n + 1];
	rep(i, 1, n - 1) v[i].pb(i + 1), v[i + 1].pb(i);
	v[x].pb(y); v[y].pb(x);

	ll ans[n] = {0};
	rep(i, 1, n)
	{
		bool vis[n + 1] = {0};
		int dist[n + 1] = {0};
		rep(j, 1, n) dist[j] = mod;

		queue<int> q;
		q.push(i);
		dist[i] = 0;

		while (!q.empty())
		{
			int p = q.front();

			trace(p);
			vis[p] = 1;
			q.pop();

			for (auto it : v[p])
				if (!vis[it])
				{
					q.push(it);
					vis[it] = 1;
					dist[it] = min2(dist[it], dist[p] + 1);
				}
		}

		rep(j, 1, n) ++ans[dist[j]];
	}

	rep(i, 1, n - 1) cout << ans[i]/2 << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
const ll INF=1e9+7;
const ll N = 20001;
ll n,a[N],w=0;
ll used[30003];
ll gojo(ll x,ll y){
	if(y>x){
		ll w=x;
		x=y;
		y=w;
	}
	ll w=1;
	while(w!=0){
		w=x%y;
		x=y;
		y=w;
	}
	return x;
}


int main(){
	cin>>n;
	FOR(i,0,30003)used[i]=false;
	a[0]=2;
	w=2;
	used[2]=true;
	ll i=1,k=3;
	while(n-i!=1){
		if(k%3==0||k%2==0){
			used[k]=true;
			a[i]=k;
			i++;
			w+=k;
		}
		k++;
	}
	FOR(j,4,30001){
		if(used[j]==true||gojo(w,j)==1)continue;
		bool ok=true;
		FOR(l,0,i){
			if(gojo(w+j-a[l],a[l])==1){
				ok=false;
				break;
			}
		}
		if(ok){
			cout<<a[0];
			FOR(bb,1,i){
				cout<<" "<<a[bb];
			}
			cout<<" "<<j<<endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 768
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector> 
#include <algorithm>
#include <typeinfo>
#include <cmath>
using namespace std;

int main(){
    string div[4] = {"dream", "dreamer", "erase", "eraser"};
    string S;
    std::cin >> S;
    
    reverse(S.begin(), S.end());
    for (int i = 0; i < 4; ++i) reverse(div[i].begin(), div[i].end());
    
    bool can = true;
    for (int i = 0; i < S.size();)
    {
        bool can2 = false;
        for (int j = 0; j < 4; ++j)
        {
            string d = div[j];
            if (S.substr(i, d.size()) == d)
            {
                can2 = true;
                i += d.size();
            }
        }
        if(!can2){
            can = false;
            break;
        }
    }
    if(can) std::cout << "YES" << "\n";
    else std::cout << "NO" << "\n";
}

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

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

void solve(long long X, long long Y)
{
    // a + b = X (a>0, b>0)
    //2a + 4b = Y (a>0, b>0)
    //2(X-b) + 4b = Y
    //2X + 2b = Y
    for (ll b = 0; b <= X; b++)
    {
        if (2 * X + 2 * b == Y)
        {
            cout << YES << endl;
            return;
        }
    }
    cout << NO << endl;
}

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


Measured memory_bytes: 3728
import java.util.*;
public class Main {
    static int[][] masu = new int[10][10];
    static void doIt(int x,int y,int size){
        switch(size){
        case 1:
            small(x,y);
            break;
        case 2:
            mid(x,y);
            break;
        case 3:
            big(x,y);
            break;
        }
    }
    static void small(int x,int y){
        int sx[]={1,0,-1,0},sy[]={0,1,0,-1};
        draw(x,y);
        for(int i=0;i<4;i++){
            int nx=sx[i]+x;
            int ny=sy[i]+y;
            draw(nx,ny);
        }
    }
    static void mid(int x,int y){
        for(int s=-1;s<2;s++){
            for(int i=-1;i<2;i++){
                draw(x+i,y+s);
            }
        }
    }
    static void big(int x,int y){
        mid(x,y);
        draw(x,y-2);draw(x,y+2);draw(x+2,y);draw(x-2,y);
    }
    static void draw(int x,int y){
        if(x<0||y<0||x>9||y>9)return;
        masu[y][x]+=1;
    }
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        for(int s=0;s<10;s++)for(int i=0;i<10;i++)masu[s][i]=0;
        while(in.hasNext()){
            String[] input = in.next().split(",");
            int x=Integer.parseInt(input[0]),y=Integer.parseInt(input[1]),size=Integer.parseInt(input[2]);
            doIt(x,y,size);
        }
        int big=0, cnt=0;
        for(int s=0;s<10;s++)for(int i=0;i<10;i++){
            big=Math.max(big, masu[s][i]);
            if(masu[s][i]==0)cnt++; 
        }
        System.out.println(cnt);
        System.out.println(big);
    }
}

Measured memory_bytes: 17164
#include <iostream>
using namespace std;
const int MAX_N = 110;
int j, n, k, x, cnt, a[MAX_N];
bool flag = 0;
void bubbleSort(int A[MAX_N], int N) {
	flag = 1;
	while( flag) {
		flag = 0;
		for (j =N-1;j>0;--j) {
			if( A[j] < A[j-1]) {
				x= A[j];A[j]= A[j-1];A[j-1]=x;
				cnt++;
				flag = 1;
			}
		}
	}
	for (k = 0; k < N-1; ++k) {
		cout << A[k] << " ";
	}
	cout<<A[N-1]<<endl;
	cout<<cnt<<endl;
}
int main() {
	cnt=0;
	cin>>n;
	for (j = 0; j < n; ++j) {
		cin >> a[j];
	}
	bubbleSort(a, n);
	return 0;
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
const int E=100000;
int a[E],col[E];
int main(){
	int n;
	while(true){
	cin>>n;
	if(n==0)	return 0;
	int now=0;
	for(int i=0;i<E;i++){
		col[i]=-1;	a[i]=0;
	}
	for(int i=1;i<=n;i++){
		int p;	cin>>p;
		if(i==1)	col[now]=p;
		if(i%2==0){
			if(col[now]==p)	a[now]++;
			else{
				if(now==0){
					a[now]++;
					col[now]=p;
				}
				else{
					a[now-1]+=a[now]+1;
					a[now]=0;	col[now]=-1;
					now--;
				}
			}
		}
		else{
			if(col[now]==p)	a[now]++;
			else{
				now++;
				a[now]=1;
				col[now]=p;
			}
		}
	}
	int ans=0;
	for(int i=0;i<n;i++){
		if(col[i]==0)	ans+=a[i];
	}
	cout<<ans<<endl;
	}
	return 0;
}
		

Measured memory_bytes: 1940
#include<iostream>
using namespace std;
int N_MAX = 100;
int main()
{
  int h,w,n,i,j,k=0,t=0;
  int res[N_MAX];
  cin >> h >> w >> n;
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      if(t==0){
        cin >> t;
        k++;
      }
      res[j]=k;
      t--;
    }
    if(i%2==0){
      for(j=0;j<w;j++)
        cout << res[j] << " ";
    }else{
      for(j=w-1;j>=0;j--)
        cout << res[j] << " ";
    }
    cout << endl;
  }
  return 0;
}

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

typedef long long ll;
const int N = 200005;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	char c;
	cin>>c;
	if(isupper(c)){
		cout<<'A';
	}else{
		cout<<'a';
	}
	
	return 0;
}


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

int main(){
	int N;
	cin >> N;
	int ans = 0;
	map<int, int> mp;
	rep(i, N){
		int a;
		cin >> a;
		if(mp.find(a) == mp.end()){
			mp[a] = 1;
		}else{
			mp[a]++;
		}
	}
	for(auto& x: mp){
		int key = x.first;
		int val = x.second;
		if(key == val) continue;
		if(key < val){
			ans += val - key;
		}else{
			ans += val;
		}
	}
	cout << ans << endl;
	return 0;
}


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

using namespace std;
const int maxn = 1e5 + 100;
const int mod = 1e9 + 7;
int n, s[maxn];
char str[maxn];

bool fun(int a, int b) {
    s[0] = a, s[1] = b;
    for (int i = 1; i < n; i++) {
        if (s[i]) {
            if (str[i] == 'o') {
                s[i + 1] = s[i - 1];
            } else {
                s[i + 1] = s[i - 1] ^ 1;
            }
        } else {
            if (str[i] == 'o') {
                s[i + 1] = s[i - 1] ^ 1;
            } else {
                s[i + 1] = s[i - 1];
            }
        }
    }
    if ((s[1] == s[n - 1] && ((str[0] == 'o' && s[0] == 1) || (str[0] == 'x' && s[0] == 0)) ||
         (s[1] != s[n - 1] && ((str[0] == 'o' && s[0] == 0) || (str[0] == 'x' && s[0] == 1)))) &&
        ((s[0] == s[n - 2] && ((str[n - 1] == 'o' && s[n - 1] == 1) || (str[n - 1] == 'x' && s[n - 1] == 0))) ||
         (s[0] != s[n - 2] && ((str[n - 1] == 'o' && s[n - 1] == 0) || (str[n - 1] == 'x' && s[n - 1] == 1))))) {
        for (int i = 0; i < n; i++) {
            if (s[i]) cout << "S";
            else cout << "W";
        }
        cout << endl;
        return 1;
    }
    return 0;
}

int main() {
    cin >> n;
    cin >> str;
    if (fun(0, 0));
    else if (fun(0, 1));
    else if (fun(1, 0));
    else if (fun(1, 1));
    else cout << -1 << endl;
    return 0;
}

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

const double PI = 3.14159265358979323846;
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//typedef pair<ll, ll> P;
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

std::istream &operator>>(std::istream &in, set<int> &o) {
    ll a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

//const ll mod = 1e10;
typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

#include <iostream>
#include <vector>

using namespace std;

struct mint {
    static const int mod = 1000000007;

    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}

    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 {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }

    mint operator*(const mint a) const {
        mint res(*this);
        return res *= 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 {
        mint res(*this);
        return res /= a;
    }

    friend std::istream &operator>>(std::istream &in, mint &o) {
        ll a;
        in >> a;
        o = a;
        return in;
    }

    friend std::ostream &operator<<(std::ostream &out, const mint &o) {
        out << o.x;
        return out;
    }

};

int main() {

    string s;
    cin >> s;

    int n = s.size();
    vector<vector<mint>> dp(n + 1, vector<mint>(2, 0));
    dp[0][0] = 1;

    rep(i, n) {
        if (s[i] == '0') {
            dp[i + 1][0] = dp[i][0];
            dp[i + 1][1] = dp[i][1];
        } else {
            dp[i + 1][1] = dp[i][0] + dp[i][1];
        }
        if (s[i] == '0') {
            dp[i + 1][1] += dp[i][1] * 2;
        } else {
            dp[i + 1][0] += dp[i][0] * 2;
            dp[i + 1][1] += dp[i][1] * 2;
        }
    }

    cout << dp[n][0] + dp[n][1] << endl;

}


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

namespace ABC
{
    class ProgramD3
    {
        // 解説の写経
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var list = Console.ReadLine().Split(" ").Select(x => long.Parse(x)).ToList();

            var money = 1000L;

            for (var i = 0; i < n - 1; i++)
            {
                if (list[i] < list[i + 1])
                {
                    var kabu = money / list[i];
                    money += kabu * (list[i + 1] - list[i]);
                }
            }

            Console.WriteLine(money);
        }
    }
}


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

using namespace std;

long long f(long long b, long long n) {
    if (b <= 1) return -1;
    if (n < b) return n;
    else return f(b, n / b) + n % b;
}
int A[100005];
int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", A + i);
    int res = 0;

    for (int i = 1; i <= n; ++i) if (i == A[A[i]]) res++;

    printf("%d\n", res / 2);
    return 0;
}



Measured memory_bytes: 640
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    n = int(input())
    b = list(map(int, input().split()))
    ans = [b[0]]
    for i in range(len(b)-1):
        ans.append(min(b[i],b[i+1]))
    ans.append(b[-1])
    print(sum(ans))



if __name__=="__main__":
    main()


Measured memory_bytes: 9376
//Why 860?
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define sz(v) ((int)v.size())
#define fill(x, v) memset(x, v, sizeof(x))
#define trace(x) cout << #x << " = " << x << endl
#define FER(i,x,y) for(int (i)=(x);(i)<(y); (i) ++)
#define IFR(i,x,y) for(int (i)=(x);(i)>=(y); (i) --)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);
#define N 100002
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;

int n;
int dp[N], c[N];

int main(){
	fastio;
	int k; cin >> n >> k;
	fill(dp, -1);
	int low = k + 2;
	FER(i, 0, n){
		cin >> c[i];
		low = min(low, c[i]);
	}
	FER(i, 0, low) dp[i] = 0;
	FER(i, low, k + 1){
		FER(j, 0, n){
			if(i - c[j] < 0) continue;
			if(dp[i - c[j]] == 0){
				dp[i] = 1; break;
			}
		}
		if(dp[i] == -1) dp[i] = 0;
	}
	cout << (dp[k] == 1? "First": "Second") << endl;
	return 0;
}

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

#pragma GCC optimize("O3")

using namespace std;

#define all(x) (x).begin(), (x).end()

typedef long long ll;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    
	ll ans = (n / (a + b)) * a;
	ans += min((n % (a + b)), a);
	
	cout << ans;
    
    return 0;
}


Measured memory_bytes: 3652
#include<stdio.h>
#include<iostream>
using namespace std;

int main(){

	
	
	int N,M;
	while(1){
		cin>>N>>M;if(N==0&&M==0)break;
		int s[20001]={};
		int r[20001]={};
		int m[20001]={};
		bool F[20001]={};
		F[1]=true;
		int c=0;
		int x,y,z;
		for(int i=0;i<M;i++)
		{cin>>x>>y>>z;
		m[i]=x;
		s[i]=y;r[i]=z;}
		for(int i=0;i<M;i++)
			for(int j=M-1;j>i;j--)
				if(m[j]<m[j-1]){
					int t=m[j];m[j]=m[j-1];m[j-1]=t;
					t=s[j];s[j]=s[j-1];s[j-1]=t;
					t=r[j];r[j]=r[j-1];r[j-1]=t;

				}
		for(int i=0;i<M;i++){
	
		
			{if(F[s[i]]==true&&r[i]!=1)F[r[i]]=true;}}
		for(int i=0;i<=N;i++)
			if(F[i]==true)c++;
		cout<<c<<endl;
	}
	return 0;
}
	

Measured memory_bytes: 1420