akhauriyash/Code-Regression huggingface dataset:
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

string s;

void input(){
    cin >> s;
    return;
}

void solve(){
    vector<int> v(26, 0);
    REP(i, s.length()){
        v[s[i] - 'a']++;
    }
    string ans = "yes";
    REP(i, 26){
        if(v[i] >= 2){
            ans = "no";
        }
    }
    cout << ans << endl;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[][] array=new int[m][2];
		for(int i=0;i<m;i++) {
			array[i][0]=sc.nextInt();
			array[i][1]=sc.nextInt();
			if(n!=1 && array[i][0]==1 && array[i][1]==0) {
				System.out.println("-1");
				sc.close();
				return;
			}
		}
		sc.close();
		int init=(int)Math.pow(10, n-1), fin=(int)Math.pow(10, n),flag=0;
		if(n==1) init=0;
		for(int i=init;i<fin;i++) {
			flag=0;
			for(int j=0;j<m;j++) {
				if(digit(n,array[j][0],i)!=array[j][1]) flag=1;
			}
			if(flag==0) {
				System.out.println(i);
				return;
			}
		}
		System.out.println("-1");
	}

	static int digit(int n, int keta,int num) {
		for(int i=1;i<=n-keta;i++) num/=10;
		return num%10;
	}
}

Measured memory_bytes: 23252
S=input()
T=input()
al=[chr(ord('a')+i) for i in range(26)]
sameS=[]
sameT=[]

for k in al:
    indexes=[i for i, x in enumerate(S) if x==k]
    sameS.append(indexes)

for k in al:
    indexes=[i for i, x in enumerate(T) if x==k]
    sameT.append(indexes)

if all([x in sameS for x in sameT]) and all([x in sameT for x in sameS]):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 19648
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass #sortされていない

def main():
    import sys,bisect
    input = sys.stdin.readline

    n,k = map(int,input().split())
    a = list(map(int,input().split()))

    kouho = divisor(sum(a))
    kouho.sort(reverse = True)

    for e in kouho:
        tank = [s%e for s in a]
        tank.sort()

        p = 0
        q = n-1

        s = tank[0]
        t = e-tank[-1]
        while p != q-1:
            if s > t:
                q -= 1
                t += e-tank[q]
            else:
                p += 1
                s += tank[p]


        if s <= k:

            print(e)
            exit()

if __name__ == '__main__':
    main()
            

        

Measured memory_bytes: 41708
function Main(input) {
  input=input.split("\n");
  if(input[input.length-1]===''){
    input.pop();
  }
  const N=input[0].split(' ')[0]-0;
  const M=input[0].split(' ')[1]-0;
  const S=input[1];
  var cur=S.length-1;
  var ret=[];
  while(cur>0){
    if(cur<=M){
      ret.unshift(cur);
      break;
    }
    for(var i=0;i<M;i++){
      if(S[cur-M+i]==='0'){
        ret.unshift(M-i);
        cur=cur-M+i;
        break;
      }
      if(i===M-1){
        console.log(-1);
        return;
      }
    }
  }
  console.log(ret.join(' '));
}




//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int  main() {
  string S;
  cin >> S;
  vector<char> vec(0);
  bool exist = true;
  int i=0;
  
  while(i<S.size()){
    if(S.at(i) == 'd'){
     if(S.size()-i < 5){
       exist = false;
       break;
     }
     if(S.at(i+1) == 'r' && S.at(i+2) == 'e' && S.at(i+3) == 'a' && S.at(i+4) == 'm'){
        vec.push_back('D');
        i += 5;
        continue;
      }
      else{
        exist = false;
        break;
      }
    }
    else if(S.at(i) == 'e'){
     if(S.size()-i < 2){
       exist = false;
       break;
     }
     if(S.at(i+1) == 'r' && i+1 == S.size()-1){
        vec.push_back('R');
        i += 2;  
        continue;
     }
     if(S.at(i+1) == 'r' && S.at(i+2) != 'a'){
        vec.push_back('R');
        i += 2;  
        continue;
     }
     if(S.size()-i >= 6){
       if(S.at(i+1) == 'r' && S.at(i+2) == 'a' && S.at(i+3) == 's' && S.at(i+4) == 'e' && S.at(i+5) == 'r'){
        vec.push_back('X');
        i += 6;
        continue;
       }
     }
     if(S.size()-i >= 5){
       if(S.at(i+1) == 'r' && S.at(i+2) == 'a' && S.at(i+3) == 's' && S.at(i+4) == 'e'){
         vec.push_back('E');
           i += 5;
           continue;
       }
     }
    }
     exist = false;
     break;
  }
  
  
  if(exist){
   for(int i=0; i<vec.size()-1; i++){
     if(vec.at(i) == 'R' && vec.at(i+1) == 'R'){
       exist = false;
       break;
     }
   }
  }
  
  if(exist){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
    
}
   

Measured memory_bytes: 512
a=0
b=0
c=0
d=0
i = 0
N = int(input()) #1行目のNを取得する
s = [input() for i in range(N)] #複数行の数値の入力を取得
print(f"AC x {s.count('AC')}")
print(f"WA x {s.count('WA')}")
print(f"TLE x {s.count('TLE')}")
print(f"RE x {s.count('RE')}")

Measured memory_bytes: 16300
import bisect
from collections import deque
n, m = map(int, input().split())
A = deque(sorted(map(int, input().split())))
BC = []
for j in range(m):
    b, c = map(int, input().split())
    BC.append((b, c))
BC = sorted(BC, key=lambda x: x[1], reverse=True)
for b, c in BC:
    change = 0
    for i in range(b):
        if A[i] < c:
            change += 1
    if not change:
        break
    for _ in range(change):
        A.popleft()
        A.append(c)
print(sum(A))

Measured memory_bytes: 23252
//https://atcoder.jp/contests/abc086/tasks/abc086_b

#include<bits/stdc++.h>

using namespace std;

int main(){
	int a;
	int b;
	int n;
	cin >> a >> b;
	if(1<=b && 9>=b){
		n=10*a+b;
	}
	if(10<=b && 99>=b){
		n=100*a+b;
	}
	if(b==100){
		n=1000*a+b;
 	}
	for(int i=1; i<=n/2; i++){
		if(i*i==n){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}







Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;

class Program
{
    static void Main(string[] args)
    {
        var s = ReadLine();
        var t = ReadLine();
        var b = LCSLength(s, t);
        Print(b, s, s.Length-1, t.Length-1);
        WriteLine();
    }
    private static string[,] LCSLength(string str1, string str2)
    {
        var m = str1.Length;
        var n = str2.Length;
        var b = new string[m, n];
        var c = new int[m + 1, n + 1];
        for (var i = 0; i < m; i++) c[i + 1, 0] = 0;
        for (var i = 0; i <= n; i++) c[0, i] = 0;
        for (var i = 1; i <= m; i++)
            for (var j = 1; j <= n; j++)
                if (str1[i - 1] == str2[j - 1])
                {
                    c[i, j] = c[i - 1, j - 1] + 1;
                    b[i - 1, j - 1] = "n";
                }
                else if (c[i - 1, j] >= c[i, j - 1])
                {
                    c[i, j] = c[i - 1, j];
                    b[i - 1, j - 1] = "u";
                }
                else
                {
                    c[i, j] = c[i, j - 1];
                    b[i - 1, j - 1] = "y";
                }
        return b;

    }
    private static void Print(string[,] b, string str, int i, int j)
    {
        if (i == -1 || j == -1) return;
        if (b[i, j] == "n")
        {
            Print(b, str, i - 1, j - 1);
            Write(str[i]);
        }
        else if (b[i, j] == "u") Print(b, str, i - 1, j);
        else Print(b, str, i, j - 1);
    }
    private const string ALFA = "abcdefghijklmnopqrstuvwxyz";
    private const int MOD = 1000000007;
}


Measured memory_bytes: 118616
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
 
int main() {
  ll n,w;
  cin >> n >> w;
  vl weight,value;
  rep(i,n){
    ll x,y;
    cin >> x >> y;
    weight.push_back(x);
    value.push_back(y);
  }
  vector<vector<ll> > dp(110,vector<ll> (100010,0));
  for(ll i=1; i<=n; i++){
    rep(j,w+1){
      if(j >= weight[i-1]){
        dp[i][j] = max((dp[i-1][j-weight[i-1]]+value[i-1]), dp[i-1][j]);
      } else {
        dp[i][j] = dp[i-1][j];
      }
    }
  }
  cout << dp[n][w];
  
 return 0;
}

Measured memory_bytes: 87424
#include<stdio.h>
int main(){
  int n,m,s[100],r[100],i,j,t;
  while(1){
    if(n==0&&m==0)break;
    scanf("%d%d",&n,&m);
    for(j=0;j<m;j++)scanf("%d",&s[j]);
    for(i=0;i<n-1;i++){
      for(j=0;j<m;j++){
        scanf("%d",&t);
        if(t)s[j]++;
      }
    }
    t=0;
    for(i=n;i>=0;i--){
      for(j=0;j<m;j++){
        if(s[j]==i){
          r[t]=j+1;
          t++;
        }
      }
    }
    if(!(n==0&&m==0)){
    printf("%d",r[0]);
    for(j=1;j<m;j++)printf(" %d",r[j]);
    printf("\n");
    }
  }
  return 0;
}

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


int main(){


  int city = 0,road = 0;
  cin >> city >> road;

  vector<int> array1(128,0);
  vector<int> array2(128,0);

  for(int i = 0; i < road * 2;i++ ){
    cin >> array1[i];
  }

  for(int i = 0; i < road * 2;i++){
    array2[array1[i]]++;
  }


  for(int i = 1; i < city + 1;i++){

    //if(array2[i] == 0){
      //return 0;
    //}else{
      cout << array2[i] << endl;

    //}


}



  return 0;

}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int m[1001][1001] = {0};

int main(){
	
	ios::sync_with_stdio(false);

	int H, W, A, B;
	cin >> H >> W >> A >> B;



	for(int i = 0; i < W; i++)
		m[0][i] = B;
	for(int i = 0; i < H; i++)
		m[i][0] = A;

	for(int i = 1; i <= H; i++){
		if(i <= H - B){
			for(int j = 1; j <= A; j++){
				m[i][j] = 1;
			}
		}else{
			for(int j = A+1; j <= W; j++){
				m[i][j] = 1;
			}
		}
	}

	for(int i = 1; i <= H; i++){
		for(int j = 1; j <= W; j++)
			cout << m[i][j];
		cout << '\n';
	}

	return 0;
}

Measured memory_bytes: 5120
import sys

#f = open("input.txt", 'r')
f = sys.stdin
n = ''
d = set()
f.readline()

for line in f:
    cmdarr = line.split()
    if cmdarr[0] == "insert":
        d.add(cmdarr[1])
    else:
        if cmdarr[1] in d:
            print("yes")
        else:
            print("no")



Measured memory_bytes: 31376
#include <bits/stdc++.h>
using namespace std;
int main(){
    while(true){
        int w,h;
        cin >>w>>h;
        if(w!=0||h!=0){
            for (int i = 0; i < w; i++){
                for (int j = 0; j < h; j++){
                    cout<<'#';
                }
                cout<<endl;
            }
            cout<<endl;
        }else{
            break;
        }
    }
}


Measured memory_bytes: 3072
#include <stdio.h>
#include <bits/stdc++.h>
     
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
     
using namespace std;
 
const int N = 15;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 239;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;

int g[N][N];
int dp[1 << N][N];
int cost[N];

int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(20);
    //ll TL = 0.95 * CLOCKS_PER_SEC;
    //clock_t time = clock();
    int n, m;
    cin >> n >> m;
    rep(i, 0, m)
    {
        int u, v, c;
        cin >> u >> v >> c;
        u--; v--;
        g[u][v] = g[v][u] = c;
    }
    rep(mask, 0, (1 << n))
        rep(u, 0, n)
            dp[mask][u] = inf;
    dp[1][0] = 0;
    rep(mask, 0, (1 << n))
        rep(u, 0, n)
        {
            if (dp[mask][u] == inf)
                continue;
            rep(v, 0, n)
            {
                cost[v] = 0;
                rep(w, 0, n)
                    if (w != u && ((mask >> w) & 1))
                        cost[v] += g[v][w];
            }
            rep(v, 0, n)
                if (g[u][v] > 0 && !((mask >> v) & 1))
                    dp[mask | (1 << v)][v] = min(dp[mask | (1 << v)][v], dp[mask][u] + cost[v]);
            int inv = ((1 << n) - 1) ^ mask;
            for (int sm = inv; sm > 0; sm = (sm - 1) & inv)
            {
                int sum = 0;
                rep(v, 0, n)
                    if (((sm >> v) & 1))
                        sum += cost[v];
                dp[mask | sm][u] = min(dp[mask | sm][u], dp[mask][u] + sum);
            }
        }
    cout << dp[(1 << n) - 1][n - 1] << "\n";
    return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000



int main(){
	
	long long X,K,D;
	cin>>X>>K>>D;
	
	X = abs(X);
	
	if(X/D<K){
		K -= X/D;
		X -= X/D * D;
	}
	else{
		X -= K*D;
		K = 0LL;
	}
	
	for(int i=0;i<K%2;i++){
		if(X>0)X-=D;
		else X+=D;
	}
	
	cout<<abs(X)<<endl;
	
	
	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
using namespace std;
int main(){
    char S[3];
    int ans=0,s=0,r=0;

    for(int i=0;i<3;i++){
        cin>>S[i];
    }
    
   for(int i=0;i<3;i++){
       if(S[i]=='S')    s++;
       else r++;
   }

   if(s==0) ans=3;
   else if(s==3)    ans=0;
   else if(s==2)    ans=1;
   else if(S[1]=='S')   ans=1;
   else ans=2;

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	long long int count=0;
	for(int i=1;i<n;i++)
	{
		if(n%i==0)
			count+=(n/i-1);
		else
			count+=(n/i);
	}
	cout<<count<<endl;
	return 0;
}

Measured memory_bytes: 3584
#include<iostream>
#define ll long long 
using namespace std;

int main(void)
{
    ll a,b,c,d;

    cin >> a >> b >> c >> d;

    ll ans = a*c;

    if(ans < a*d)
        ans = a*d;
    if(ans<b*c )
        ans = b*c;
    if(ans<b*d)
        ans = b*d;
    
    cout << ans << endl;
    return 0; 
}

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

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111;
using namespace std;
typedef long long lint;

int H, W;
vector<int> dx{ -1,1,0,0 };
vector<int> dy{ 0,0,-1,1 };
struct coor { int x, y; coor(int inx, int iny) :x(inx),y(iny){} };

inline bool solve(vector<string> &map, vector<coor> &blk) {

	bool flag = false;

	vector<coor> tmp;
	for (const auto &elem : blk) {

			for (int k = 0; k < 4; k++) {

				int x = elem.x + dx[k];
				int y = elem.y + dy[k];

				if (0 <= x && x < H && 0 <= y && y < W && map[x][y] == '.') {
					flag = true;
					map[x][y] = '#';
					tmp.emplace_back(coor(x, y));
				}
			}
	}

	blk = tmp;
	return flag;
}

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	cin >> H >> W;

	vector<string> map(H);
	for (int i = 0; i < H; i++) cin >> map[i];

	vector<coor> blk;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (map[i][j] == '#') blk.emplace_back(coor(i, j));
		}
	}

	int cnt = 0;
	while (solve(map, blk)) cnt++;

	cout << cnt;

	return 0;
}


Measured memory_bytes: 14700
S = input()
s_unique = list(set(S))

bool_var = True
if len(s_unique) == 2:
  for w in s_unique:
    cnt = 0
    for s in S: 
      if w==s:
        cnt+=1
    if cnt != 2:
      bool_var = False
      break;
else:
  bool_var = False
        
if bool_var:
  print('Yes')
else:
  print('No')


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const int INF=1e9;
const ll MX = 1e18;
const ll MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
#define YN {puts("YES");}else{puts("NO");}
const ll MAX = 1000001;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {fac[0] = fac[1] = 1;finv[0] = finv[1] = 1;inv[1] = 1;for (ll 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(ll n, ll k){if (n < k) return 0;if (n < 0 || k < 0) return 0;return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;}
ll llpow(ll n,ll i){ll cnt=n;  for(ll j=0;j<i-1;j++){n*=cnt;}return n;}

int main() {
  ll n,a,b,c,d;
  cin>>n>>a>>b>>c>>d;
  string s;
  cin>>s;
  int cntl=0;
  int cntr=0;
  for(int i=a;i<c;i++){
    if(s[i-1]!='#') {
      cntr=0;
      continue;
    }
    cntr++;
    if(cntr==2){
      cout<<"No"<<endl;
      return 0;
    } 
  }
  cntr=0;
  for(int i=b;i<d;i++){
    if(s[i-1]!='#') {
      cntr=0;
      continue;
    }
    cntr++;
    if(cntr==2){
      cout<<"No"<<endl;
      return 0;
    }
  }
  if(d<c){
    for(int i=b-1;i<=d+1;i++){
      if(s[i-1]!='.') {
      cntl=0;
      continue;
      }
      cntl++;
      if(cntl==3){
        cout<<"Yes"<<endl;
        return 0;
      }
    }
    cout<<"No"<<endl;
    return 0;
  }else{
    cout<<"Yes"<<endl;
    return 0;
  }
}


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

#define ull unsigned long long
#define ul unsigned long
#define ll long long
#define size_t long long

using namespace std;

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

  int n,m;
  std::cin >> n >> m;
  int arr1[m];
  for (int i = 0; i < m; i++) {
    std::cin >> arr1[i];
  }

  if(n >= m){
    std::cout << 0 << '\n';
    return 0;
  }

  std::sort(&arr1[0], &arr1[m], [](auto& x, auto& y){return x > y;});

  int arr2[m-1];
  for (int i = 0; i < m - 1; i++) {
    arr2[i] = arr1[i] - arr1[i+1];
  }

  std::sort(&arr2[0], &arr2[m-1], [](auto& x, auto& y){return x > y;});
  std::cout << accumulate(&arr2[n-1], &arr2[m-1], 0) << "\n";

  return 0;
}


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

int main() {
    int a[3];
    for(int i = 0;i < 3;i++) cin >> a[i];
    for(int i = 0;i < 3;i++) {
        if(a[i] + a[(i+1)%3] == a[(i+2)%3]) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

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

typedef pair<int,int> P;

int main(){
  int n,m;
  cin >> n >> m;
  vector<P> ab;
  for(int i = 0;i < m;i++){
    int a,b;
    cin >> a >> b;
    ab.push_back({a,b});
  }
  sort(ab.begin(),ab.end());
  int right = n,result = 1;
  for(int i = 0;i < m;i++){
    if(right <= ab.at(i).first){
      result++;
      right = ab.at(i).second;
    }
    if(right >= ab.at(i).second){
      right = ab.at(i).second;
    }
  }
  cout << result << endl;
}

Measured memory_bytes: 1400
import sys
sys.setrecursionlimit(10**7)
N, K = map(int, input().split())

e = [[] for i in range(N)]
for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    e[a].append(b)
    e[b].append(a)

col = [-1 for i in range(N)]
col[0] = 0
MOD = 10 ** 9 + 7


def dfs(i, ans, depth):

    if depth == 1:
        num = K - 1
    else:
        num = K - 2
    for v in e[i]:
        if col[v] == -1:
            col[v] = 0
            ans = (ans * num) % MOD
            num -= 1
            ans = dfs(v, ans, depth+1)

    return ans


print(dfs(0, K, 1))


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

int  main()
{
	int a,b,c; cin >> a >> b >> c;
	priority_queue<int> q;
	int x = abs(a - b); 
	int y = abs(b - c);
	int z = abs(a - c);
	q.push(x); q.push(y); q.push(z);
	q.pop();
	int ans = q.top(); q.pop();
	ans += q.top();
	cout << ans << endl;
	return (0);
}


Measured memory_bytes: 256
require 'prime'

n = gets.chomp.to_i
# 2 ** 45 > 10 ** 12
arr = [1, 3, 6, 10, 15, 21, 28, 36, 45]
pd = n.prime_division

result = 0
pd.each do |(num, exp)|
  result += arr.index{|a| a > exp}
end

puts result


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

int G[101][101];

int main(void) {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int u, k, v;
        cin >> u >> k;
        for (int j = 0; j < k; j++) {
            cin >> v;
            G[u - 1][v - 1] = 1;
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cout << G[i][j];
            if (j < n -1) cout << " ";
            else cout << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
#define MAX 1000000
#define INF 1000000
#define MOD 1e9
#define pb push_back
#define pairs pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vii vector<pairs>
#define lb lower_bound
#define ub upper_bound
#define ll long long
#define endl '\n'
using namespace std;
/* ----------------------------------------------------------------------------------- */

#define FastInput ios_base::sync_with_stdio(false), cin.tie(NULL);
#define all(x) x.begin(), x.end()
#define read(x) freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)
#define rep(i, a, n) for (int i = a; i < n; i++)
#define REP(i, a, n) for (int i = a; i <= n; i++)
#define inputArray(a,n) rep(i, 0, n) cin >> a[i];
#define copyArray(a,temp,n) rep(i, 0, n) temp[i]=a[i];
#define printArray(a,n) rep(i, 0, n) cout << a[i] << " "; cout << endl;

/* ----------------------------------------------------------------------------------- */

#define Cases  cout << "Case " << ++Case << ": ";
#define __test int tt; int Case=0; cin >> tt; while(tt--)

#define dbgA2(A, n, m) {cout<<"--> "<<#A<<" = \n";rep(i, 0, n){rep(j, 0, n){cout<<A[i][j]<<" ";}cout<<"\n";}cout<<"\n";}
#define dbgA(A, n) {cout<<" --> "<<#A<<" = (";rep(i, 0, n)cout<<A[i]<<" ";cout<<")\n";}
#define dbg(args...) {string sss(#args);sss+=',';cout<<" --> ";debugger::call(all(sss), args);cout<<"\n";}

/* ----------------------------------------------------------------------------------- */

ll gcd(ll n, ll m) { return m ? gcd(m, n % m) : n; }
ll lcm(ll n, ll m) { return n / gcd(n, m) * m; }

struct debugger {
	typedef string::iterator si;
	static void call(si it, si ed) {}
	template<typename T, typename ... aT>
	static void call(si it, si ed, T a, aT... rest) {
		string b;
		for(; *it!=','; ++it)
			if(*it!=' ')
				b+=*it;
		cout << b << "=" << a << " ";
		call(++it, ed, rest...);
	}
};

/* ----------------------------------------------------------------------------------- */

void solve() {
	char a;
	cin >> a;
	if(a >= 'A' && a <= 'Z') {
		cout << "A\n";
	} else {
		cout << "a\n";
	}
}

int main() {
	solve();

	// __test {
	// 	solve();
	// }
}

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

#define N 200000
#define M 1000

int main(){
  int a[N],n,time[M],t=0,q,i,head,tail,str;
  char in[N][10];
  scanf("%d %d\n",&n,&q);
  for(i=0; i<n; i++){
    //t=0;
    //while((in[i][t++]=getc(stdin))!=' ');
    scanf("%s %d\n",in[i],&a[i]);
  }
  /*for(i=0; i<n; i++){
    printf("%s %d\n",in[i],a[i]);
    }*/
  t=0;
  for(head=0,tail=n; head!=tail; ){
    if(a[head]<=q){
      t+=a[head];
      a[head]=0;
      printf("%s %d\n",in[head],t);
      head=(head+1)%N;
    }else{
      t+=q;
      a[head]-=q;
      a[tail]=a[head];
      str=strlen(in[head]);
      for(i=0; i<str; i++){
	in[tail][i]=in[head][i];
	in[head][i]=0;
      }
      tail=(tail+1)%N;
      head=(head+1)%N;
    }
  }
  
  return 0;
}



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

int main(){
	
	int n;
	cin >> n;
	vector<int> a(n), b(n), c(n);
	rep(i,n) cin >> a[i]; sort(a.begin(), a.end());
	rep(i,n) cin >> b[i]; sort(b.begin(), b.end());
	rep(i,n) cin >> c[i]; sort(c.begin(), c.end());
	
	
	ll res = 0;
	
	vector<int> cnt(n); // b[i]に対して適用可能なcの要素数
	rep(i,n){
		auto ub_c = upper_bound(c.begin(), c.end(), b[i]);
		cnt[i] = c.end() - ub_c;
	}
	
	vector<ll> cumsum_cnt(n); // 末尾からの累積和
	cumsum_cnt[n-1] = cnt[n-1];
	for(int i = n-2; i >= 0; i--){
		cumsum_cnt[i] = cumsum_cnt[i+1] + cnt[i];
	}
	
	rep(i,n){
		auto ub_b = upper_bound(b.begin(), b.end(), a[i]);
		res += cumsum_cnt[ub_b - b.begin()];
	}
	
	cout << res << endl;

	return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

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

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

//----------------------------------------------------------------

int main()
{
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll cwari = b / c - (a - 1) / c;
    ll dwari = b / d - (a - 1) / d;
    ll cdwari = b / lcm(c, d) - (a - 1) / lcm(c, d);
    ll sum = b - a + 1 - cwari - dwari + cdwari;
    cout << sum << endl;
}

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

int n;
double dp[310][310][310];

double f(int i,int j,int k)
{
	if(dp[i][j][k]>=0)return dp[i][j][k];
	if(i==0&&j==0&&k==0)return 0.0;
	double res = n;
	if(i>0)res += f(i-1,j,k)*i;
	if(j>0)res += f(i+1,j-1,k)*j;
	if(k>0)res += f(i,j+1,k-1)*k;
	res *= 1.0/(double)(i+j+k);
	return dp[i][j][k] = res;
}

int main()
{
	cin >> n;
	int a[3] = {};
	memset(dp,-1,sizeof(dp));
	for(int i = 0;i<n;i++)
	{
		int x;
		cin >> x;
		x--;
		a[x]++;
	}
	//cout<<f(a[0],a[1],a[2]);
	printf("%.14lf\n",f(a[0],a[1],a[2]));
	return 0;
}

Measured memory_bytes: 233088
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long
#define N 100010
#define M 1010

using namespace std;


int read() {
	int s = 0, f = 0; char ch = getchar();
	while (!isdigit(ch)) f |= (ch == '-'), ch = getchar();
	while (isdigit(ch)) s = s * 10 + (ch ^ 48), ch = getchar();
	return f ? -s : s;
}

int main() {
	double a, b, c;
	cin >> a >> b >> c;
	a /= c;
	if (a <= b) puts("Yes");
	else puts("No");
}

Measured memory_bytes: 3712
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time
sys.setrecursionlimit(10**7)
inf = 10**20

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
CA = list(reversed(A))
CB = list(reversed(B))

ans = 0
for i in range(N):
    if (A[i] > B[i]):
        b = B[i]
        ans += b
        A[i] -= b 
        B[i] -= b
    else:
        a = A[i]
        ans += a
        A[i] -= a
        B[i] -= a
    if (A[i+1] > B[i]):
        b = B[i]
        ans += b
        A[i+1] -= b
        B[i] -= b
    else:
        a = A[i+1]
        ans += a
        A[i+1] -= a
        B[i] -= a
ans1 = ans
A =CA
B =CB

ans = 0
for i in range(N):
    if (A[i] > B[i]):
        b = B[i]
        ans += b
        A[i] -= b 
        B[i] -= b
    else:
        a = A[i]
        ans += a
        A[i] -= a
        B[i] -= a
    if (A[i+1] > B[i]):
        b = B[i]
        ans += b
        A[i+1] -= b
        B[i] -= b
    else:
        a = A[i+1]
        ans += a
        A[i+1] -= a
        B[i] -= a
ans2 = ans
ans = max(ans1,ans2)
print(ans)

Measured memory_bytes: 21604
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>
#include <tuple>
#include <map>
#include <unordered_map>
#include <deque>
#include <queue>
using namespace std;
typedef long long ll;

int main(int argc, char *argv[])
{
	int n, i, rcount, lcount, j;
	char prev;
	string s;
	cin >> s;
	n = s.length();
	vector<int> answer;

	rcount = 1;
	prev = 'R';
	answer.push_back(0);
	
	for (i = 1; i < n; i++) {
		if (prev == 'R' && s[i] == 'R') {
			answer.push_back(0);
			rcount++;
		} else if (prev == 'R' && s[i] == 'L') {
			answer.pop_back();
			lcount++;
			prev = 'L';
			if (i == n - 1) {
				answer.push_back(rcount / 2 + rcount % 2 +
								 lcount / 2);
				answer.push_back(rcount / 2 +
								 lcount % 2);
				break;
			}
		} else if (prev == 'L' && s[i] == 'L') {
			lcount++;
			if (i == n - 1) {
				answer.push_back(rcount / 2 + rcount % 2 +
								 lcount / 2);
				answer.push_back(rcount / 2 +
								 lcount / 2 + lcount % 2);
				for (j = 0; j < lcount - 1; j++)
					answer.push_back(0);
				break;
			}
		} else if (prev == 'L' && s[i] == 'R') {
			answer.push_back(rcount / 2 + rcount % 2 +
							 lcount / 2);
			answer.push_back(rcount / 2 +
							 lcount / 2 + lcount % 2);
			for (j = 0; j < lcount; j++)
				answer.push_back(0);
			lcount = 0;
			rcount = 1;
			prev = 'R';
		} 
	}
	
	for (j = 0; j < n; j++) 
		cout << answer[j] << " ";

	cout << endl;

	return 0;
}


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

int main(){
  int n;
  long long d, x, y;
  cin >> n >> d;
  d = d*d;
  int count = 0;
  for (int i = 0; i < n; i++){
    cin >> x >> y;
    if((x*x + y*y) <= d) count++;
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 3516
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<iomanip>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (2e9)
// cout << setprecision(10)

using namespace std;
typedef long long int ll;

string s;
int main(void){
    cin >> s;
    if(s[0]==s[1] or s[1]==s[2] or s[2]==s[3]) cout << "Bad" << endl;
    else cout << "Good" << endl;;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int N; cin >> N;
    vector<ll> A(N),B(N),C(N);
    for (int i=0;i<N;i++) cin >> A[i];
    for (int i=0;i<N;i++) cin >> B[i];
    for (int i=0;i<N;i++) cin >> C[i];
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    sort(C.begin(),C.end());
    ll res = 0;
    for (ll b : B){
        ll a = lower_bound(A.begin(),A.end(),b) - A.begin();
        ll c = N - (upper_bound(C.begin(),C.end(),b) - C.begin());
        res += a*c;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 2560
# ２つの整数 x と y について、x ÷ d と y ÷ d の余りがともに 0 となる d のうち最大のものを、x と y の最大公約数（Greatest Common Divisor）と言います。
# 例えば、35 と14 の最大公約数 gcd (35, 14) は 7 となります。これは、35 の約数{1, 5, 7, 35}、14 の約数 {1, 2, 7, 14} の公約数 {1, 7} の最大値となります。

x, y  = [ int(i) for i in input().split() ]


# 147 % 105 = 42
# 105 % 42 = 21
# 42 % 21 = 2

mod = 0
while True:
    mod = max(x, y) % min(x, y)
    x  = y
    y = mod
    if mod <= 0: break
    
print(x)



Measured memory_bytes: 5604
def main():
    from functools import lru_cache
    import sys

    sys.setrecursionlimit(10 ** 7)

    @lru_cache(maxsize=None)
    def make_number(digit, p=0):
        if digit == 0:
            memo.append(p)
            if len(memo) == k + 1:
                print(p)
                exit()
            return

        if p == 0:
            # 前の位がない
            for x in range(1, 10):
                make_number(digit - 1, x)

        else:
            r = p % 10
            # 前の位がある
            for x in range(max(0, r - 1), min(9, r + 1) + 1):
                make_number(digit - 1, p * 10 + x)

    k = int(input())

    memo = []

    for digit in range(11):
        make_number(digit)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())


Measured memory_bytes: 96472
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <functional>


using namespace std;

int main()
{
    int n,sum_a=0,sum_b=0;
    cin >>n;
    vector<int> vec(n);
    
    for(int i=0;i<n;++i){
        cin >> vec[i];
    }
    sort(vec.begin(),vec.end(),std::greater<int>());
    for(int i=0;i<n;i++){
        if(i%2==0){
            sum_a+=vec[i];
        }else{
            sum_b+=vec[i];
        }
    }
    cout<<sum_a-sum_b;
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define rep(i,n) for(long long i = n-1;i>=0;--i)
#define repp(i,n,m) for(long long i = n-1; i >= m; --i)
#define ALL(N) (N.begin(),N.end())
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
#define pq priority_queue
#define Dcout(N) cout << setprecision(20) << N << endl
constexpr int INF = 2147483647;
constexpr long long INFF = 9223372036854775807;

signed main() {
    cin.tie(0);
	ios::sync_with_stdio(false);
    long long N,Y;
    cin >> N >> Y;
    long long N1 = N;
    long long A = 0,B = 0,C = 0;
    REP(i,N+1){
        for(int j = 0; (i+j) <= N;++j){
            int k = N - (i + j);
            if(10000*i + 5000*j + 1000*k == Y){
                cout << i << ' ' << j << ' ' << k << endl;
                return 0;
            }
        }
    }
    cout << -1 << ' ' << -1 << ' ' << -1 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
     
    int main(){
      string s;
      int mp[300] = {};
      cin >> s;
      
      for(int i = 0;i < s.size();i++){
        mp[s[i]]++;
      }
      
      for(int i = 'a';i <= 'z';i++){
        if(mp[i]%2 == 1){
          cout << "No" << endl;
          return 0;
        }
      }
      
      cout << "Yes" << endl;
      return 0;
    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(cont) cont.begin(), cont.end()
#define pb push_back
#define fi first
#define se second
#define DEBUG(x) cerr << (#x) << ": " << (x) << '\n'

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;

template<class T> bool uin(T &a, T b) {return (a < b ? false : (a = b, true));}
template<class T> bool uax(T &a, T b) {return (a > b ? false : (a = b, true));}

//ifstream f(".in");
//ofstream g(".out");

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
#ifdef LOCAL_DEFINE
//  freopen(".in", "r", stdin);
#endif

  int n, w;
  cin >> n >> w;
  vector<long long> dp(w + 2);
  for (int i = 1; i <= n; ++i) {
    int weight, value;
    cin >> weight >> value;
    for (int old_w = w; old_w >= 0; --old_w) if (old_w + weight <= w) {
      uax(dp[old_w + weight], dp[old_w] + value);
    }
  }

  long long ans = 0;
  for (int i = 0; i <= w; ++i) {
    uax(ans, dp[i]);
  }

  cout << ans << '\n';

#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define pii pair<int,int>
#define prec(n) fixed<<setprecision(n)
#define MOD 1000000007
#define eps 1e-8
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &a){
    return out<<"("<<a.first<<","<<a.second<<")";}
template<class A> ostream& operator<<(ostream& out, const vector<A> &a){
	out<<"";for(auto it=a.begin();it!=a.end();it++){if(it!=a.begin())out<<" ";out<<*it;}out<<"";
	return out;}
template<class A, class B> istream& operator>>(istream& in, pair<A,B> &a){in>>a.first>>a.second;return in;}
template<class A> istream& operator>>(istream& in, vector<A> &a){for(A &i:a)in>>i;return in;}
//ifstream cinn("input.txt");ofstream coutt("output.txt");

signed main(){
    FASTER;
    int a;string s;cin>>a>>s;
    if(a>=3200){
        cout<<s;
    }else cout<<"red";
}


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

using namespace std;

const int md = int(1e9) + 7;

inline void add(int &a, int b) {
  a += b;
  if (a >= md) a -= md;
}

inline void sub(int &a, int b) {
  a -= b;
  if (a < 0) a += md;
}

inline int mul(int a, int b) {
  return (int) ((long long) a * b % md);
}

inline int power(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}

inline int inv(int a) {
  a %= md;
  if (a < 0) a += md;
  int b = md, u = 0, v = 1;
  while (a) {
    int t = b / a;
    b -= t * a; swap(a, b);
    u -= t * v; swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}

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

  int n;
  cin >> n;
  vector< vector<int> > a(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }

  vector<int> dp(1 << n);
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < (1 << n); j++) {
      if (__builtin_popcount(j) == i) {
        for (int k = 0; k < n; k++) {
          if ((j & (1 << k)) == 0 && a[i][k] == 1) {
            add(dp[j | (1 << k)], dp[j]);
          }
        }
      }
    }
  }
  cout << dp[(1 << n) - 1] << '\n';
  return 0;
}

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

int main() {
	
	int h, w; cin >> h >> w;
	vector<vector<char>> a(h + 2, vector<char>(w + 2));
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			cin >> a[i][j];
		}
	}
	vector<bool> deleteRow(h, true);
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			if (a[i][j] == '#') deleteRow[i - 1] = false;
		}
	}
	vector<bool> deleteColumn(w, true);
	for (int j = 1; j <= w; j++) {
		for (int i = 1; i <= h; i++) {
			if (a[i][j] == '#') deleteColumn[j - 1] = false;
		}
	}
	for (int i = 1; i <= h; i++) {
		if (deleteRow[i - 1]) continue;
		for (int j = 1; j <= w; j++) {
			if (deleteColumn[j - 1]) continue;
			cout << a[i][j];
		}
		cout << endl;
	}
	return 0;
}

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

#[allow(unused_macros)]
macro_rules ! for_ { ( $ init : stmt ; $ cond : expr ; $ incr : expr , $ body : block ) => { $ init ; while $ cond { $ body $ incr ; } } ; }

fn main() {
    input! {
        n: usize,
        a: [usize; n]
    }

    let cnt = count(&a);
    println!("{}", calc(n, &cnt));
}

#[allow(dead_code)]
pub const M: u64 = 1_000_000_007;

fn calc(n: usize, cnt: &std::collections::HashMap<usize, usize>) -> u64 {
    if n % 2 == 1 {
        if *cnt.get(&0).unwrap_or(&0) != 1 {
            return 0;
        }
        for_! (let mut i = 2; i < n; i += 2, {
            if *cnt.get(&i).unwrap_or(&0) != 2 {
                return 0;
            }
        });
    } else {
        for_! (let mut i = 1; i < n; i += 2, {
            if *cnt.get(&i).unwrap_or(&0) != 2 {
                return 0;
            }
        });
    }
    modpow(2, n as u64 / 2, M)
}

#[allow(dead_code)]
fn count<T: Eq + std::hash::Hash + Clone>(slice: &[T]) -> std::collections::HashMap<T, usize> {
    let mut hmap = std::collections::HashMap::new();
    for item in slice {
        *hmap.entry(item.clone()).or_insert(0) += 1;
    }
    hmap
}

#[doc = " a^n modulo m"]
#[allow(dead_code)]
pub fn modpow(mut a: u64, mut n: u64, m: u64) -> u64 {
    let mut res = 1;
    while n > 0 {
        if n & 1 == 1 {
            res = res * a % m;
        }
        a = a * a % m;
        n >>= 1;
    }
    res
}

Measured memory_bytes: 12540
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define REPS(i,s,n) for(ll (i)=(s);(i)<(n);++(i))
#define REP(i,n) reps(i,0,n)
#define REPTR(i,n) for(ll (i)=(n);(i)>=0;--(i))
#define ALL(x) (x).begin(),(x).end()
#define MAX 1005
#define KEY 10007
using namespace std;

int main() {
	int h,w,a,b;
	cin >> h >> w >> a >> b;
	for(int i=0;i<h;i++) {
		if(i<b) {
			for(int j=0;j<w;j++) {
				if(j<a) cout << "1";
				else cout << "0";
			}
		}else {
			for(int j=0;j<w;j++) {
				if(j<a) cout << "0";
				else cout << "1";
			}
		}
		cout << endl;
	}
}

Measured memory_bytes: 1280
#// AOJ Volume2 0216

#include <stdio.h>

int fee(int w)
{
    int f;
    int wt;
    
    // 第１段階
    f = 1150;
    
    // 第２段階
    w -= 10;
    if (w <= 0){
        return (f);
    }
    if (w > 10){
        wt = 10;
    }
    else {
        wt = w;
    }
    f += wt * 125;
    
    // 第3段階
    w -= 10;
    if (w <= 0){
        return (f);
    }
    if (w > 10){
        wt = 10;
    }
    else {
        wt = w;
    }
    f += wt * 140;
    
    // 第4段階
    w -= 10;
    if (w <= 0){
        return (f);
    }
    f += w * 160;

    return (f);
}


int main(void)
{
    int w;
    
    while (1){
        scanf("%d", &w);
        
        if (w == -1){
            break;
        }
        
        printf("%d\n", 4280 - fee(w));
    }
    
    return (0);
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
/*
26文字はいるんだけど、重複組み合わせをのぞく
26^Kからどっか固定してると考える
aaaaaaaa
~
zzzzzzzz

aaaaaoof
~
zzzzzoofまで
でもない

aaaaaoogはNG
aaaaoaof
aaaoaaof


*/

const int MAX =2e6+10;
const int MOD = 1000000007;

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

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

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

int main(){
  COMinit();
  ll K,oo=2e6+10, ans=0; cin>>K;
  string S; cin>>S;
  ll ssz=S.size();
  vector<ll> Z25(oo,0),Z26(oo,0);
  Z25[0]=1;
  Z26[0]=1;
  for(ll i=0; i<oo; i++) Z25[i+1]=(Z25[i]*25)%MOD;
  for(ll i=0; i<oo; i++) Z26[i+1]=(Z26[i]*26)%MOD;
  for(ll i=0; i<=K; i++) {
    ll n=COM(ssz+i-1,i);
    (n*=Z25[i])%=MOD;
    (n*=Z26[K-i])%=MOD;
    (ans+=n)%=MOD;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 82460
H, W = (int(i) for i in input().split())
ans = float("inf")
for i in range(1,H):
  a, b = (i, W)
  S = W*(H-i)
  if a%2==0 or b%2==0:
    ans = min(ans, abs(S-a*b//2))
  else:
    if a == 1 and b ==1:
      continue
    else:
      Sbig = (max(a, b)+1)*min(a, b)//2
      Ssma = (max(a, b)-1)*min(a, b)//2
      Sdiff = max(abs(S-Sbig), abs(S-Ssma), abs(Sbig-Ssma))
      ans = min(ans, Sdiff)
      
H, W = (W, H)
for i in range(1,H):
  a, b = (i, W)
  S = W*(H-i)
  if a%2==0 or b%2==0:
    ans = min(ans, abs(S-a*b//2))
  else:
    if a == 1 and b ==1:
      continue
    else:
      Sbig = (max(a, b)+1)*min(a, b)//2
      Ssma = (max(a, b)-1)*min(a, b)//2
      Sdiff = max(abs(S-Sbig), abs(S-Ssma), abs(Sbig-Ssma))
      ans = min(ans, Sdiff)
print(ans)


Measured memory_bytes: 3064