akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;

int main(void){
    int h,w,hi;
    while(true)
    {
        cin>>h>>w;
        if(h==0&&w==0)break;
        for(hi=0;hi<h;hi++)
        {
            for(int i=0;i<w;i++)
            {
                if(hi%2==0)
                {
                    if(i%2==0)
                    {
                        cout<<"#";
                    }
                    else
                    {
                        cout<<".";
                    }
                }
                else
                {
                    if(i%2==1)
                    {
                        cout<<"#";
                    }
                    else
                    {
                        cout<<".";
                    }
                }
            }
            cout<<endl;
        }
        cout<<endl;
    }
}


Measured memory_bytes: 3116
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
int main(){
    int N, L;
    std::cin >> N >> L;
    std::vector<std::string> S(N);
    for(int i =0 ; i < N; i++)
        std::cin >> S[i];
    std::sort(S.begin(),S.end());
    for(int i =0 ; i < N; i++) std::cout << S[i];
}

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

int main() {
  string S;
  cin >> S;
  bool X = false, Y = false;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == 'C') X = true;
    if (X && S.at(i) == 'F') Y = true;
  }
  if (Y) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3628
n = int(input())
x = list(map(int, input().split()))
x.sort()

l = []

for p in range(x[0], x[-1] + 1):
  ans = 0
  for i in range(n):
    ans += (x[i] - p) ** 2
  l.append(ans)
print(min(l))

Measured memory_bytes: 9128
#include<bits/stdc++.h>
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define printd(x) printf("%.12f\n", ans);
#define print(x) cout << (x) << endl;
#define Yes() cout << "Yes" << endl;
#define No() cout << "No" << endl;
#define YES() cout << "YES" << endl;
#define NO() cout << "NO" << endl;
#define printa(x, n) for(ll i = 0; i < n; i++) {cout << (x[i]) << " ";} cout << endl;
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;

int main(void) {
    string s;
    cin >> s;
    
    map<char, int> mp;
    rep (i, s.size()) {
        mp[s[i]]++;
    }

    for (char c = 'a'; c <= 'z'; c++) {
        if (!mp[c]) {
            cout << c << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
const int SIZE = 1 << 17;
const int INF = 1 << 30;
using namespace std;
int segment[2 * SIZE];
int point[SIZE + 1];
int now, times[SIZE];
int viewTime;
int value(int ID){
	return point[ID];
}
void compare(int n){
	int acces;
	if (value(segment[n * 2 + 1]) >= value(segment[n * 2 + 2]))
		acces = segment[n * 2 + 1];
	else
		acces = segment[n * 2 + 2];
	segment[n] = acces;
	if (n != 0)
		compare((n - 1) / 2);

}
void add(int n, int x){
	int acces = SIZE - 2 + n;
	point[n] += x;
	compare((acces - 1) / 2);
}
int main() {
	int N, R, L, d, t, x,last=0;
	cin >> N >> R >> L;
	for (int i = 1; i <= N; i++){
		segment[SIZE + i - 2] = i;
		add(i, 0);
	}
	for (int i = 0; i<=R; i++){
		if (i!=R)
		cin >> d >> t >> x;
		else{
			d = 1;
			t = L;
			x = 0;
		}
		if (t != last)
			times[segment[0]] += t - last;
		last = t;
		add(d, x);
	}
	int maxim =1;
	for (int i = 1; i <= N; i++){
		if (times[maxim]<times[i])
			maxim = i;
	}
	cout << maxim << endl;
	// your code goes here
	cin >> x;
	return 0;
}

Measured memory_bytes: 2744
ps, ses = [], []
while True:
    p, s = map(int, input().split(','))
    if not p:
        break
    ps.append(p)
    ses.append(s)
rank = []
for s in ses:
    if s not in rank:
        rank.append(s)
rank.sort(reverse=True)
while True:
    try:
        q = int(input())
    except:
        break
    print(rank.index(ses[ps.index(q)]) + 1)

Measured memory_bytes: 7540
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n = I()
ab = [LI() for _ in range(n)]
ab_s = sorted(ab, key=lambda x: x[1])
coll_t = 0
ans = 'Yes'
for a, b in ab_s:
    coll_t += a
    if coll_t > b:
        ans = 'No'
        break

print(ans)


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

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

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    vector<int> x(m);
    for(int i=0;i<m;i++)cin>>x[i];
    if(n>=m){
        cout<<0<<endl;
        return 0;
    }
    sort(x.begin(),x.end());
    int all=x[m-1]-x[0];
    vector<int> l(m-1);
    for(int i=1;i<m;i++){
        l[i-1]=x[i]-x[i-1];
    }
    sort(l.begin(),l.end(),greater<int>());
    for(int i=0;i<n-1;i++){
        all-=l[i];
    }
    cout<<all<<endl;
    return 0;
}


Measured memory_bytes: 1024
import sys
from collections import *
import heapq
import math
# from math import gcd
import bisect
import copy
from itertools import permutations,accumulate,combinations,product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n,c=map(int,input().split())
stc=[list(map(int,input().split())) for i in range(n)]
stc.sort()
lst=[0]*c
for i in range(n):
    s,t,ctmp=stc[i]
    for j in range(c):
        if lst[j]==0:
            lst[j]=stc[i]
            break
        else:
            if lst[j][2]==ctmp:
                lst[j]=stc[i]
                break
            elif lst[j][1]<s:
                lst[j]=stc[i]
                break
# print(lst)
ans=0
for i in range(c):
    if lst[i]!=0:
        ans+=1
print(ans)

Measured memory_bytes: 58332
import java.util.*;
import java.math.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		if(a == 7) {
			if (b == 5 && c == 5) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		} else if (a == 5) {
			if ((b == 5 && c == 7) || (b == 7 && c == 5)) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		} else {
			System.out.println("NO");
		}
        
	}

}

Measured memory_bytes: 9936
#include <bits/stdc++.h>
using namespace std;
int main() {
  int w, a, b;
  cin >> w >> a >> b;
  if(a>b){
    if(a-(b+w)>0){
      cout << a-(b+w) << endl;
    }
    else if(a-(b+w)==0){
      cout << 0 << endl;
    }
    else{
      cout << 0 << endl;
    }
  }
  else if(a==b){
    cout << 0 << endl;
  }
  else{
    if(b-(a+w)>0){
      cout << b-(a+w) << endl;
      return 0;
    }
    else if(b-(a+w)==0){
      cout << 0 << endl;
    }
    else{
      cout << 0 << endl;
    }
  }
}

Measured memory_bytes: 256
// AOJ 2925 Angel Relief
// 2019.3.25 bal4u

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

//// 入力処理
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()  // 非負整数の入力
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

int main()
{
	int H, W, r, c, a;
	long long ans;

	H = in(), W = in();
	ans = 0;
	for (r = 0; r < H; r++) for (c = 0; c < W; c++) {
		a = in();
		ans += (long long)a*(r + 1)*(H - r)*(c + 1)*(W - c);
	}
	printf("%lld\n", ans);
	return 0;
}


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

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

    int count = 0;
    for(int i=0; i<n-1; i++){
        if(s[i] == s[i+1]) count += 1;
    }

    cout << min(count + 2 * k, n-1) << endl;
    return 0;
}

Measured memory_bytes: 512
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())
    S = readline().split()

    if len(set(S)) == 3:
        print('Three')
    else:
        print('Four')

    return


if __name__ == '__main__':
    main()


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

int main(){
int N,M;
cin >> N >> M;
vector<long long> H(N);
for(int i = 0; i < N; i++){
  cin >> H.at(i);
}

vector<int>A(M);
vector<int>B(M);

for(int i = 0; i < M; i++){
  cin >> A.at(i) >> B.at(i);
  A.at(i)--;
  B.at(i)--;
}

vector<vector<int>> Cnct(N,vector<int>(0));

for(int i = 0; i < M; i++){
  Cnct.at(A.at(i)).push_back(B.at(i));
  Cnct.at(B.at(i)).push_back(A.at(i));
}

vector <long long> max(N);
for(int i = 0; i < N; i++){
  if(!Cnct.at(i).empty()){
    long long p = 0;
    for(int j = 0; j<Cnct.at(i).size(); j++){
      if(H.at(Cnct.at(i).at(j)) > p) p = H.at(Cnct.at(i).at(j));
    }
  max.at(i) = p;
  }else{
    max.at(i) = 0;
  }
}

int Ans = 0;

for(int i = 0; i < N; i++){
  if(H.at(i) > max.at(i)) Ans ++;
}

cout << Ans << endl;

}

Measured memory_bytes: 10652
#include <bits/stdc++.h>
using namespace std;
int main() {
	int k, x;
	cin>> k>>x;
	int l=max(-1000000,x-k+1);
	int r=min(1000000,x+k-1);
	for (int i=l; i<=r; i++) cout<<i<< (" \n"[i==r]); 
	return 0;
} 

Measured memory_bytes: 256
nmap = {}

for i in range(3):
    row = [int(n) for n in input().split()]
    for j in range(3):
        number = row[j]
        nmap[number] = [i, j]

N = int(input())

b = [None] * N

for i in range(N):
    b[i] = int(input())

lines = [
    [[0, 0], [0, 1], [0, 2]],
    [[1, 0], [1, 1], [1, 2]],
    [[2, 0], [2, 1], [2, 2]],

    [[0, 0], [1, 0], [2, 0]],
    [[0, 1], [1, 1], [2, 1]],
    [[0, 2], [1, 2], [2, 2]],

    [[0, 0], [1, 1], [2, 2]],
    [[2, 0], [1, 1], [0, 2]],
]

for number in b:
    if number in nmap:
        for line in lines:
            if nmap[number] in line:
                line.remove(nmap[number])

ans = "No"
for line in lines:
    if len(line) == 0:
        ans = "Yes"

print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


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

void YN(bool ans){
    if(ans)cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
    return;
}

int main(){
    ll H[2],M[2],K;
    cin>>H[0]>>M[0]>>H[1]>>M[1]>>K;
    ll sum = 0;
    sum = (H[1]-H[0]) * 60 + (M[1]-M[0]);
    cout<<sum-K;
    return 0;
}

Measured memory_bytes: 3636
<?php
  
  fscanf(STDIN,"%d %d",$N,$L);

$applepie_model=0;

for($i=1;$i<=$N;$i++){
  $applepie_model += $L+$i-1;
}

$unuse_num = 1;
$min = 1000000000;

for($j=0;$j<$N;$j++){
    $sum_n1 = 0;

  for($i=1;$i<=$N;$i++){
    if($unuse_num == $i){
      continue;
    }
    $sum_n1 += $L+$i-1;
  }
  if(abs($sum_n1-$applepie_model)<= $min){
    $min = abs($sum_n1-$applepie_model);
    $result = $sum_n1;
  };
  $unuse_num++;
}

echo $result."\n";

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

//#define int long long
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define dbg(x) cout<<#x" = "<<(x)<<ln

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > mat;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

int a, b;
string s;
bool ng;

signed main() {
	cin >> a >> b >> s;
	if (s[a]!='-') ng = true;
	rep(i,a+b+1) if (i!=a && s[i]=='-') ng = true;
	if (ng) cout << "No" << ln;
	else cout << "Yes" << ln;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  int N, L;cin>>N>>L;
  string res = "";
  string S[N];for(int i=0;i<N;i++)cin>>S[i];
  sort(S, S+N);
  for(int i=0;i<N;i++){res.append(S[i]);}
  cout<<res<<endl;
}

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

using namespace std;
const int maxn = 1e5 + 5;
int v[101], n, W, w[101], ans;
long long f[101][maxn];

long long dp(int i, int val)
{
    if (val < 0) return W + 1;
    if (i > n) {
        if (val == 0) return 0;
        else return W + 1;
    }
    long long &res = f[i][val];
    if (res != -1) return res;
    res = dp(i + 1, val);
    res = min(res, dp(i + 1, val - v[i]) + w[i]);
    return res;
}

int main()
{
    #ifdef NTMA 
        freopen("abc.inp", "r", stdin);
    #endif
    memset(f, 255, sizeof(f));
    cin >> n >> W;
    for(int i=1; i<=n; ++i) cin >> w[i] >> v[i];
    for(int i=1; i<maxn; ++i) if (dp(1, i) <= W) ans = i;
    cout << ans;
}

Measured memory_bytes: 79232
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    string s, t;
    cin >> s >> t;
    int ret = 0;
    for (int i = 0; i < 3; ++i) {
        if (s[i] == t[i])
            ret++;
    }
    cout << ret << "\n";
    return 0;
}

Measured memory_bytes: 256
public class Hello{
    public static void Main(){
        // Your code here!
        var line=int.Parse(System.Console.ReadLine());
        string[] answer={"AC", "WA", "TLE", "RE"};
        int[] numbers=new int[4];
        
        for(var i=0;i<line;i++)
        {
            var data=System.Console.ReadLine();
            
            for(var j=0;j<numbers.Length;j++)
            {
                if(data==answer[j])
                {
                    numbers[j]=numbers[j]+1;
                }
            }
           // System.Console.WriteLine(numbers[0]);
        }
        
        for(var k=0;k<answer.Length;k++)
        {
            System.Console.WriteLine(answer[k]+" "+"x"+" "+numbers[k]);
        }
    } 
}


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

signed main(void)
{
	int n, a, b;
	cin >> n >> a >> b;
	if ((a - b) % 2 == 0)
		cout << "Alice" << endl;
	else
		cout << "Borys" << endl;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
// #define ll int
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[8] ={1,0,-1,0,1,-1,1,-1};
ll dy[8] ={0,1,0,-1,1,-1,-1,1};
 
template<class T> 
inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> 
inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};
 
 
void solve(){
    ll a,b;
    cin>>a>>b;
    if(a+b>=10) cout<<"error"<<endl;
    else cout<<a+b<<endl;
} 
 
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
     
    ll Q=1;
    // cin>>Q;
    rep(_,Q){
 
        solve();
 
    }
   
 
 
    return 0;
}

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

int main() {
  vector <vector<int>> datas;
  const string SHARP = "#";
  while (true) {
    int H, W;
    cin >> H >> W;
    if (H == 0 && W == 0) {
      break;
    }
    vector<int> hw = { H, W };
    datas.push_back(hw);
  }

  for (int i = 0; i < datas.size(); i++) {
    for (int j = 0; j < datas[i][0]; j++) {
      for (int k = 0; k < datas[i][1]; k++) {
        cout << SHARP;
      }
      cout << endl;
    }
    cout << endl;
  }
}


Measured memory_bytes: 3144
a, b, c, d = (int(_) for _ in input().split())
def gcd(x, y):
   while y:
       x, y = y, x % y
   return x

def lcm(x, y):
   lcm = (x*y)//gcd(x,y)
   return lcm

div = lcm(c,d)

if a % c == 0:
    start = a //c
else:
    start = a // c + 1
stop = b // c 
diff = b - a + 1
diff -= (stop - start + 1)

if a % d == 0:
    start = a // d
else:
    start = a // d + 1
stop = b // d
diff -= (stop - start + 1)

if a % div == 0:
    start = a//div
else:
    start = a // div + 1
stop = b // div
diff += (stop - start + 1)

print(diff)



Measured memory_bytes: 3064
H, W, N = map(int, input().split())
sr, sc = map(int, input().split())
S = list(input())
T = list(input())

border_U = 0
border_D = H + 1
border_L = 0
border_R = W + 1

res = "YES"

for i in range(N-1):

    # Takahashi's turn
    if S[N-1-i] == "U":
        border_U += 1
    elif S[N-1-i] == "D":
        border_D -= 1
    elif S[N-1-i] == "L":
        border_L += 1
    elif S[N-1-i] == "R":
        border_R -= 1

    # mate in the middle
    if border_U >= border_D - 1 or border_L >= border_R - 1:
        res = "NO"

    # Aoki's turn
    if T[N - 2 - i] == "U":
        border_D += 1
    elif T[N - 2 - i] == "D":
        border_U -= 1
    elif T[N - 2 - i] == "L":
        border_R += 1
    elif T[N - 2 - i] == "R":
        border_L -= 1

    # sanitize
    border_U = max(border_U, 0)
    border_D = min(border_D, H + 1)
    border_L = max(border_L, 0)
    border_R = min(border_R, W + 1)
    # print(border_U, border_D, border_L, border_R)

# Takahashi's final turn
if S[0] == "U":
    border_U += 1
elif S[0] == "D":
    border_D -= 1
elif S[0] == "L":
    border_L += 1
elif S[0] == "R":
    border_R -= 1

if sr <= border_U:
    res = "NO"
elif sr >= border_D:
    res = "NO"
elif sc <= border_L:
    res = "NO"
elif sc >= border_R:
    res = "NO"

# print(border_U, border_D, border_L, border_R)
print(res)

Measured memory_bytes: 72964
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll ZERO = 0;
const int Inf = 1000000000;
const ll INF= 1e18;
const ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<ll,ll> P;

int main() {
    int N;
    cin >> N;
    vector<int> vec(N);
    for(int i = 0;i < N;i++) {
        cin >> vec.at(i);
    }
    bool ret = true;
    for(int i = 0;i < N;i++) {
        if(vec.at(i) % 2 == 0) {
            if(vec.at(i) % 3 != 0 && vec.at(i) % 5 != 0) {
                ret = false;
            }
        }
    }
    if(ret == true) {
        cout << "APPROVED" << endl;
    }
    else {
        cout << "DENIED" << endl;
    }
}

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

char grade(int m,int f,int r){
    int s=m+f;
    if(m==-1||f==-1)return 'F';
    else if(s>=80)return 'A';
    else if(s>=65&&s<80)return 'B';
    else if(s>=50&&s<65)return 'C';
    else if(s>=30&s<50){
        if(r>=50)return 'C';
        else return 'D';
    }
    else if(s<30)return 'F';
}

int main(){
    int m,f,r;
    while(1){
        cin>>m>>f>>r;
        if(m==-1&&f==-1&&r==-1)break;
        cout<<grade(m,f,r)<<endl;
    }
    return 0;
}


Measured memory_bytes: 3092
#include <stdio.h>
#include <math.h>

#define N 10000
#define TRUE 1
#define FALSE 0

int isprime(int);

int main(){
  int i,j,num,A[N],count=0;

  while(1){
    scanf("%d",&num);
    if(1 <= num && num <= N) break;
  }
  for(i = 0;i < num;i++){
    scanf("%d",&A[i]);
    if(A[i] < 2 || N*N < A[i]) i = i - 1;
  }
  for(i = 0;i < num;i++) if(isprime(A[i]) == TRUE) count++;
  printf("%d\n",count);

  return 0;
}

int isprime(int a){
  int i;
  if(a == 2) return TRUE;
  if(a < 2 || a%2 == 0) return FALSE;
  i = 3;
  while(i <= sqrt(a)){
    if(a%i == 0) return FALSE;
    i = i + 2;
  }
  return TRUE;
}

Measured memory_bytes: 628
# -*- coding: utf-8 -*-
s = input()
b = []

for i in range(len(s)):
    if s[i] == '0':
        b.append(False)
    else:
        b.append(True)

switch = False
c1 = 0
for i in range(len(b)):
    if b[i] != switch:
        c1 += 1
    switch = not switch

switch = True
c2 = 0
for i in range(len(b)):
    if b[i] != switch:
        c2 += 1
    switch = not switch

print(min(c1, c2))


Measured memory_bytes: 3956
use List::Util qw(max min sum);
my $N =  <STDIN>;
chomp ($N);
my @B;
foreach (split(/ /o, <STDIN>)) {
  chomp($_);
  push(@B, $_) if ($_ ne '');
}
my @A;
$A[0] = $B[0];
$A[1] = $B[0];
my $K = $N - 1;
foreach my $i (1..$K-1) {
  my $j = $i - 1;
  if ( $B[$j] >= $B[$i] ) {
    $A[$i] = min($B[$i], $A[$i]);
  }
  $A[$i+1] = $B[$i];
}
$A[$K] = $B[$K-1];
print sum(@A);

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

int main() {
  char s[101], p[101], ans[101];
  int len_s, len_p;
  int i, j, k;

  scanf("%s", s);
  scanf("%s", p);
  len_s = strlen(s);
  len_p = strlen(p);
  for (i = 0; i < len_s; i++) {
    for (j = 0; j < len_p; j++) {
      k = i + j;
      if (k >= len_s) k -= len_s;
      ans[j] = s[k];
    }
    ans[j] = '\0';
    if (strcmp(ans, p) == 0) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");

  return 0;
}



Measured memory_bytes: 2104
#include <stdio.h>

void era(int year, int month, int day);

int main(void)
{
    int year, month, day;
    while((scanf("%d %d %d", &year, &month, &day)) != EOF) {
        era(year, month, day);
    }
    return 0;
}

void era(int year, int month, int day)
{
    int count = year * 10000 + month * 100 + day;
    if (count < 18680908) {
        printf("pre-meiji\n");
    } else if (count < 19120730) {
        printf("meiji %d %d %d\n", year - 1867, month, day);
    } else if (count < 19261225) {
        printf("taisho %d %d %d\n", year- 1911, month, day);
    } else if (count < 19890108) {
        printf("showa %d %d %d\n", year - 1925, month, day); 
    } else {
        printf("heisei %d %d %d\n", year - 1988, month, day);
    }
}

Measured memory_bytes: 1036
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1 {
    class Program {
        static void Main(string[] args) {
            var X = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int N = X[0];
            int K = X[1];

            var H = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            int ans = H.Where(x => x >= K).Count();

            Console.WriteLine(ans);

        }
    }
}


Measured memory_bytes: 19296
//#inclde <bits/stdc++.h>
//using namespace std;
#include <iostream>
#include <string>
#include <set>
#include <vector>
   //std::set<int> nanka;
   //nanka.insert(irerukazu);
   //std::vecter<int> (size)
   //v[0] = a;
int main(){

    int a,b,c;

    std::cin >> a >> b >> c;
    std::set<int> ss;
    ss.insert(a);
    ss.insert(b);
    ss.insert(c);
    std::cout << ss.size() << std::endl;



    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
vector<int> count(300000,0);
vector<int>counter(300000,0);
vector<int> vis(300000,0);
void dfs(vector<int> v[],int index)
{
		queue<int> q;
		q.push(index);
		int sum;
		count[0]=counter[0];
		while(!q.empty())
		{
				int t=q.front();
				sum=count[t];
				q.pop();
				vis[t]=1;
				for(int i=0;i<v[t].size();i++)
				{
						if(!vis[v[t][i]])
						{
								vis[v[t][i]]=1;
								count[v[t][i]]=sum+counter[v[t][i]];
								q.push(v[t][i]);
						}
				}
		}
}
int main()
{
		int n,q;
		cin>>n>>q;
		vector<int> v[n];
		int a,b;
		for(int i=0;i<n-1;i++)
		{
				cin>>a>>b;
				a--,b--;
				v[a].push_back(b);
				v[b].push_back(a);
		}
		int p,val;
		for(int i=0;i<q;i++)
		{
				cin>>p;
				p--;
				cin>>val;
				counter[p]+=val;
		}
		dfs(v,0);
		for(int i=0;i<n;i++)
				cout<<count[i]<<" ";

}


Measured memory_bytes: 18292
from bisect import bisect_left

n = int(input())
S = [int(t) for t in input().split()]
q = int(input())
T = [int(t) for t in input().split()]
assert n == len(S) and q == len(T)

def isin(t, S):
    i = bisect_left(S, t)
    return i < len(S) and S[i] == t

print(sum(1 for t in T if isin(t, S)))


Measured memory_bytes: 16928
n = int(input())
s1 = input()
s2 = input()
mod = 10**9 + 7
ind = []
for i,(_s1,_s2) in enumerate(zip(s1,s2)):
    if _s1 == _s2:
        ind.append(i)
# print(ind)
cnt = 0
if len(ind) == 0:
    d = 6
    cnt = 2
    single = False
elif ind[0] == 0:
    d = 3
    single = True
    cnt = 1
else:
    d = 6
    single = False
    cnt = 2
        
while cnt < n:
    if cnt in ind: # * -> 1
        if single: 
            d *= 2
        else:#2->1
            d *= 1
        cnt += 1
        single = True
    else: # * -> 2
        if single:
            d *= 2
        else:
            d *= 3
        cnt += 2
        single = False
    d %= mod
    
print(d)

"""
"""

Measured memory_bytes: 38384
a = [[i for i in list(map(int, input().split()))] for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

bingo = [[0 for _ in range(3)] for _ in range(3)]

for i in range(3):
    for j in range(3):
        for k in range(n):
            if b[k] == a[i][j]:
                bingo[i][j] = 1

f = False
for i in range(3):
    f_tmp = True
    for j in range(3):
        if not(bingo[i][j] and f_tmp):
            f_tmp = False
    if f_tmp:
        f = True

for j in range(3):
    f_tmp = True
    for i in range(3):
        if not(bingo[i][j] and f_tmp):
            f_tmp = False
    if f_tmp:
        f = True

f_tmp = True
for i in range(3):
    if not(bingo[i][i] and f_tmp):
        f_tmp = False
if f_tmp:
    f = True

f_tmp = True
for i in range(3):
    if not(bingo[2-i][i] and f_tmp):
        f_tmp = False
if f_tmp:
    f = True

if f:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3064
import java.util.*;


 public class Main{

	public static void main(String[] args) {
	
		
		Scanner sc=new Scanner(System.in);
		
		String s=sc.nextLine();
		String x=sc.nextLine();
		int n=x.length();
	
		String r=x.substring(0,n-1);
		
		
		if(r.equals(s))
		{System.out.println("Yes");}
		else
		{System.out.println("No");}
		
		sc.close();

	}

}


Measured memory_bytes: 35624
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String a1 = scan.next();
    String a2 = scan.next();
    int n = scan.nextInt();
    int m = scan.nextInt();
    String a3 = scan.next();
    if (a1.equals(a3)){
      n -= 1;
    }
    else{
      m -= 1;
    }
    System.out.print(n+" ");
    System.out.println(m);

  }
}


Measured memory_bytes: 38504
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
#include <random>
#include <cstdint>
#include <bitset>
#include <iomanip>
#include <utility>
#include<map>
#include<functional>
#include<climits>
using namespace std;
typedef long long ll;
const int mod = 1000000007;

int main() {
	int H,W,h, w;
	cin >> H >> W >> h >> w;
	cout << H * W - h * W - H * w + h * w << endl;
	return 0;
}



Measured memory_bytes: 256
import numpy as np

# get input
eight, ten = map(lambda x: int(x), input().split(' '))

def oriPrice(a, b):
  """
  <int> a = round(0.08 * ori)
  <int> b = round(0.10 * ori)
  """
  # ori = b * 10 ~ (b+1)*10 - 1
  possibleOri = [(b+1)/0.10-i for i in range(10, 0, -1)]
  
  for i in range(len(possibleOri)):
    if np.int(np.floor(possibleOri[i]*0.08)) == a:
      return np.int(possibleOri[i])
  
  return -1

print(oriPrice(eight, ten))


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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

string s, ans;
int main() {
    cin >> s;
    for (int i = 0; i < s.length(); ++i) {
        if (i % 2 == 0)
            ans.push_back(s[i]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3736
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    char a, b;
    cin >> a >> b;

    if(a != b) {
        out("D");
    }
    else {
        out("H");
    }

    re0;
}

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

using namespace std;

#define N 400040
struct edge{
	int v, next;
}e[N];
int head[N];
int vis[N];
int n, len, depth, depid;
void add_edge(int u, int v){
	e[len].v = v;
	e[len].next = head[u];
	head[u] = len++;
}
void dfs(int now, int d){
	if(depth < d){
		depth = d;
		depid = now;
	}
	int i;
	vis[now] = 1;
	for(i = head[now]; i != -1; i =e[i].next){
		int v = e[i].v;
		if(vis[v]) continue;
		dfs(v, d + 1);
	}
	return ;
}

int main(){
	int i,u,v;
	memset(head, -1, sizeof(head));
	len = 0;
	cin>>n;
	for(i = 1; i <= n - 1; i++){
		scanf("%d%d", &u, &v);
		add_edge(u, v);
		add_edge(v, u);
	}
	depth = 0;
	dfs(1, 1);
	memset(vis, 0, sizeof(vis));
	depth = 0;
	dfs(depid, 1);
	if(depth % 3 == 2){
		printf("Second\n");
	}
	else printf("First\n");

	return 0;
}


Measured memory_bytes: 12800
if __name__ == '__main__':
    n = int(input())
    p_list = list(map(int, input().split()))

    answer = 0
    for i in range(1,len(p_list)-1):
        p1 = p_list[i-1]
        p2 = p_list[i]
        p3 = p_list[i+1]

        tmp_p_list = [p1, p2, p3]
        tmp_p_list = sorted(tmp_p_list)

        if tmp_p_list[1] == p2:
            answer += 1
    print(answer)

Measured memory_bytes: 3064
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <atcoder/dsu>

using std::cin;
using std::cout;
using std::endl;
using std::terminate;
using atcoder::dsu;

void solve() {
    int N, Q; cin >> N >> Q;
    dsu d(N);
    for (int i = 0; i < Q; ++i) {
        int t, u, v; cin >> t >> u >> v;

        if (t == 0) {
            d.merge(u, v);
        } else if (t == 1) {
            cout << (d.same(u, v) ? 1 : 0) << endl;
        } else {
            //
        }
    }
}

int main() {

#ifdef DEV
    std::ifstream in("input");
    cin.rdbuf(in.rdbuf());

    int t; cin >> t;
    for (int x = 1; x <= t; ++x) {
        solve();
    }
#else
    solve();
#endif

    return 0;
}


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

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


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

using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll n, m, x;
  cin >> n >> m >> x;
  
  vector<ll> c(n);
  vector<vector<ll>> a(n, vector<ll>(m));
  for (int i = 0; i < n; i++) {
    cin >> c.at(i);
    for (int j = 0; j < m; j++) {
      cin >> a.at(i).at(j);
    }
  }
  
  ll ans = 1e18;
  for (int bit = 0; bit < (1 << n); bit++) {
    vector<ll> v(m, 0);
    ll cost = 0;
    for (int i = 0; i < n; i++) {
      if (bit & (1 << i)) {
        cost += c.at(i);
        for (int j = 0; j < m; j++) {
          v.at(j) += a.at(i).at(j);
        }
      }
    }
    bool flag = true;
    for (int i = 0; i < m; i++) {
      if (v.at(i) < x) flag = false;
    }
    if (flag) ans = min(ans, cost);
  }
  
  if (ans == 1e18) cout << "-1\n";
  else cout << ans << '\n';
}

Measured memory_bytes: 3660
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P	  = pair<ll, ll>;
using mat = vector<vector<ll>>;
typedef string::const_iterator State;
class ParseError {};

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

constexpr ll INF = 1e16;
constexpr ll INM = 114514;
constexpr ll MOD = 1e9 + 7;
constexpr ld EPS = 1e-12;

template <typename T>
void dump(T x) { cout << x << endl; }
void dumpf(ld x, ll t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}
ll powm(ll a, ll b, ll c) {
	if (b == 0)
		return 1;
	else if (b % 2 == 0) {
		ll d = powm(a, b / 2, c);
		return (d * d) % c;
	} else
		return (a * powm(a, b - 1, c)) % c;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll dx[4] = {1, 0, -1, 0};
ll dy[4] = {0, 1, 0, -1};

int main() {
	IOS();
	ll a, b, k;
	cin >> a >> b >> k;
	if(a >= k){
		cout << a - k << " " << b << endl;
	}else {
		cout << 0 << " " << max(b - (k - a) , 0ll) << endl;
	}
	return 0;
}

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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

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

int main() {

	ll n, t;
	cin >> n >> t;
	vector<ll> a(n+1, 0);
	rep(i, n) cin >> a[i];


	ll bottom = a[0];
	ll top = a[0];
	ll cnt_b = 0;
	ll cnt_t = 0;
	ll b_tmp = 1;
	ll t_tmp = 1;
	ll between = -1;
	//ll ans = 0;
	REP(i, 1, n+1){
		if(bottom == a[i]) b_tmp++;
		else if(top == a[i]) t_tmp++;
		else if(bottom > a[i]){
			//cout << "i: " << i << "\tbetween: " << between << "\ttop: " << top << "\tbottom: " << bottom << endl;
			if(between < top - bottom){
				between = top - bottom;
				cnt_b = b_tmp;
				cnt_t = t_tmp;
			}
			else if(between == top - bottom){
				cnt_b += b_tmp;
				cnt_t += t_tmp;
			}
			bottom = a[i];
			top = a[i];
			b_tmp = 1;
			t_tmp = 1;
		}
		else if(top < a[i]){
			top = a[i];
			t_tmp = 1;
		}

	}

	cout << min(cnt_b, cnt_t) << endl;

	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
     
int main() {
  int a, b = 1, c = 0, d, s = 0;
  cin >> a;
  
  for (int i = 1; i <= a; i++) {
    d = i;
    while (d%2 == 0) {
      b++;
      d /= 2;
    }
    if (b >= c) {
      c = b;
      s = i;
    }
    b = 0;
  }
    
  cout << s << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;

class combM {
private:
    vector<ll> fac;  //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    ll mpow(ll x, ll n);
    combM();
    ll com(ll a, ll b);
};

// x^n(mod M)
ll combM::mpow(ll x, ll n) {
    ll ans = 1ll;
    while(n != 0){
        if (n&1) ans = ans*x%MOD;
        x = x*x%MOD;
        n = n >> 1;
    }
    return ans;
}

// aCb をmod計算
ll combM::com(ll a, ll b) {
    if (a == 0 && b == 0) return 1;
    if (a < b || a < 0) return 0;
    ll tmp = ifac[a-b]*ifac[b]%MOD;
    return tmp*fac[a]%MOD;
}

combM::combM() {
    fac.resize(300001);
    ifac.resize(300001);
    fac[0] = 1;
    ifac[0] = 1;
    for (ll i = 0; i < 300000; ++i) {
        fac[i+1] = fac[i]*(i+1)%MOD;
        ifac[i+1] = ifac[i]*mpow(i+1, MOD-2)%MOD;
    }
}

int main(int argc, char const *argv[]) {
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    combM C;
    ll ans = 0;
    for (int i = b; i < w; ++i) ans = (ans+(C.com(h-a-1+i, i)*C.com(w-i-1+a-1, a-1))%MOD)%MOD;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x){ if(x <= 1) return false; for(ll i = 2; sqrt(i) <= x; i++) if(x % i == 0) return false; return true; }


int main() {
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); ++i){
        cout << 'x';
    }
    cout << endl;
   
  

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#define fs first
#define se second
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef double db;

const int maxn=2e5+5;
const ll inf=0x3f3f3f3f;
const ll mod=1e9+7;

int a[maxn];

int num[maxn];

map<int,ll> mp;

int main(){
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",a+i);
		mp[a[i]]++;
	}
	ll ans=0;
	for(auto it:mp){
		ans=ans+it.se*(it.se-1)/2;
	}
	for(int i=1;i<=n;i++){
		ans-=mp[a[i]]*(mp[a[i]]-1)/2;
		printf("%lld\n",ans+(mp[a[i]]-1)*(mp[a[i]]-2)/2);
		ans+=mp[a[i]]*(mp[a[i]]-1)/2;
	}
	return 0;
}

Measured memory_bytes: 12032
#include<bits/stdc++.h>
using namespace std;
char s[500005];
int num[500005],len=0,tot,ans;

void Plus(int now,bool flag)
{
	num[now+1]+=num[now]/10;
	num[now]%=10;
	if(flag) tot+=num[now];
}

int work(int &cnt)
{
	int res=0;
	for(int i=1;i<=cnt;i++)
	{
		if(num[i]<10) break;
		res++;
		Plus(i,false);
	}
	if(num[cnt+1]) cnt++;
	return res;
}

int main()
{
	// freopen("test.in","r",stdin);
	// freopen("test.out","w",stdout);
	scanf("%s",s+1);
	int len=strlen(s+1);
	for(int i=1;i<=len;i++)
	{
		num[i]=s[len-i+1]-'0';
		num[i]*=9;
	}
	for(int i=1;i<=len;i++) Plus(i,true);
	if(num[len+1])
	{
		len++;
		tot+=num[len+1];
	}
	// for(int i=1;i<=len;i++) cout<<num[i]<<" ";cout<<endl;
	for(int i=1;i<=len;i++)
	{
		ans++;
		num[1]+=9;
		tot+=9;
		tot-=9*work(len);
		if(tot<=9*ans)
		{
			printf("%d\n",ans);
			return 0;
		}
	}
}

Measured memory_bytes: 2688
#include<cstdio>
#include<vector>

using namespace std;

int main(void)
{
	int n;

	while(scanf("%d", &n)==1)
	{
		vector<int> a(n), ans(n);
		for(int i=0;i<n;i++)
		{
			scanf("%d", &a[i]);
		}
		int s=0;
		int e=n-1;
		int p=n-1;
		while(p>=0)
		{
			ans[s++]=a[p--];
			if(p<0) break;
			ans[e--]=a[p--];
		}
		for(int i=0;i<n-1;i++) printf("%d ", ans[i]);
		printf("%d\n", ans[n-1]);
	}

	return 0;
}


Measured memory_bytes: 3712
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<sstream>
#include<iomanip>
#include<limits>
#include<deque>
#include<map>
#include<list>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>
#include<cstdio>
#include<memory>
#include<bitset>
#include <functional>
#include <queue>
#include <regex>

using namespace std;

constexpr int MOD = 1000000007;
constexpr int INF = 1050000000;

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

	map<int, int> gu, ki;

	for (int i = 0; i < n; i += 2) {
		gu[v[i]] += 1;
	}
	for (int i = 1; i < n; i += 2) {
		ki[v[i]] += 1;
	}
	int gum = 0;
	int gumn = 0;
	int gum_ = 0;
	int gum_n = 0;
	for (pair<int, int>x : gu) {
		if (gum <= x.second) {
			gum_ = gum;
			gum_n = gumn;
			gumn = x.first;
			gum = x.second;
		}
		else {
			if (gum_ <= x.second) {
				gum_ = x.second;
				gum_n = x.first;
			}
		}
	}

	int kim = 0;
	int kimn = 0;
	int kim_ = 0;
	int kim_n = 0;
	for (pair<int, int>x : ki) {
		if (kim <= x.second) {
			kim_ = kim;
			kim_n = kimn;
			kimn = x.first;
			kim = x.second;
		}
		else {
			if (kim_ <= x.second) {
				kim_ = x.second;
				kim_n = x.first;
			}
		}
	}

	if (gumn == kimn) {
		cout << min(abs(n / 2 - gum) + abs(n / 2 - kim_), abs(n / 2 - kim) + abs(n / 2 - gum_)) << endl;
	}
	else {
		cout <<n - gum - kim << endl;
	}






}

Measured memory_bytes: 5376
n=int(input())
l=sorted(list(map(int,input().split())))
for i,x in enumerate(l):
  l[i]=format(x,'63b')
memo=[0]*63
for i in range(63):
  for j in range(n):
    if l[j][i]=='1':
      memo[-i-1]+=1
now=1
ans=0
mod=10**9+7
for x in memo:
  ans+=(now*x*(n-x))%mod
  now*=2
print(ans%mod)


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

int main(){
  int N;
  string S;
  cin >> N >> S;
  int x=0;
  int ans=0;
  for(int i=0;i<N;i++){
    if(S.at(i) == 'I'){
      x ++;
    }else{
      x --;
    }
    ans = max(ans,x);
  }
  cout << ans << endl;
}

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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define endl "\n"

double mpow(double x,int n){
  using i64=int_fast64_t;
  if(n==0)return 1;
  if(n%2)return x*mpow(x,n-1);
  else {
    i64 half=mpow(x,n/2);
    return half*half;
  }
}

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

  double n,m,d;
  cin>>n>>m>>d;
  if(d==0)cout<<fixed<<setprecision(20)<<(m-1)/n<<endl;
  else cout<<fixed<<setprecision(20)<<(m-1)*(2*(n-d))/(n*n)<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
const int N=5e6+10;
const int mod=1e9+7;
int arr[N],iarr[N];
int logi(int n){int p=0;while(n/2){n=n/2;p++;}return p;}
int poww(int x,int y){int pro=1;while(y){if(y&1)pro=((pro%mod)*(x%mod)%mod);y=y>>1;x=((x%mod)*(x%mod)%mod);}return pro;}
map<int,int> mp;
int arr1[1000001],arr2[1000001];

int solve()
{
	int n;
	cin>>n;
	string s,t;
	cin>>s>>t;
	for(int i=0;i<n;i++)
	{
		cout<<s[i]<<t[i];
	}
}
int32_t main()																																	
{
	fast;
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
}


Measured memory_bytes: 2304
#include<iostream>
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<cassert>
#include<vector>
 
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define eps (1e-10)
#define equals(a,b) (fabs((a)-(b)) < eps)
#define all(n) (n).begin(),(n).end()
#define inf (1<<29)
 
using namespace std;
typedef long double ld;
 
struct P
{
  ld left,right,weight;
  P(ld left=0,ld right=0,ld weight=inf):left(left),right(right),weight(weight){}
  bool operator < (const P& a)const
  {
    if(!equals(weight,a.weight))return weight < a.weight;
    if(!equals(left,a.left))return left < a.left;
    return right < a.right;
  }
};
 
ld r,ans;
int s;
 
bool check(ld v)
{
  if(equals(v,r) || v > r)return false;
  return true;
}
 
P unit(P a,P b)
{
  P node;
  node.weight = a.weight + b.weight;
  ld middle = b.weight/(a.weight+b.weight);
  node.left = min(-b.weight/(a.weight+b.weight) + a.left,b.left + (1-middle));
  node.right = max(a.weight/(a.weight+b.weight) + b.right,a.right - middle);
  return node;
}
 
void dfs(vector<P> vec)
{
  int n = vec.size();
  if(n <= 1)
    {
      ld len = vec[0].right - vec[0].left;
      assert(equals(len,0) || len > 0);
      if(check(len))ans = max(ans,len);
      return;
    }
  
  rep(i,n)
    {
      rep(j,n)
	{
	  if(i == j)continue;
	  vector<P> nvec;
	  rep(k,n)
	    if(k == i || k == j)continue;
	    else                nvec.push_back(vec[k]);
	  P p = unit(vec[i],vec[j]);
	  nvec.push_back(p);
	  dfs(nvec);
	}
    }
}
 
 
int main()
{
  /*
  rep(i,100000)
    {
    P a,b;
      cout << "type node a\n";
      cin >> a.left >> a.right >> a.weight;
      cout << "type node b\n";
      cin >> b.left >> b.right >> b.weight;
      P c = unit(a,b);
      cout << "unit c (" << c.left << "," << c.right << "," << c.weight << ")" << endl;
    }
  */
  int T;
  while(cin >> T)
    {
      while(T--)
	{
	  cin >> r;
	  cin >> s;
	  vector<P> ps(s);
	  rep(i,s)cin >> ps[i].weight;
	  
	  ans = -inf;
	  
	  dfs(ps);
	  
	  if(equals(ans,-inf))cout << -1 << endl;
	  else                cout << setiosflags(ios::fixed) << setprecision(9) << ans << endl;
	  
	}
    }
  return 0;
}

Measured memory_bytes: 1304