akhauriyash/Code-Regression huggingface dataset:
// inputに入力データ全体が入る
function Main(input) {
		input = input.split(" ");
	
	//文字列から10進数に変換するときはparseIntを使います
	    var X = parseInt(input[0], 10);
         var A = parseInt(input[1], 10);
  
  if (X < A){console.log('0');}
        else{console.log('10')}
  
 
  
  	   }    //    1    
     
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  
  

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

int main()
{
  ll n;
  cin >> n;
  //cout << n << endl;

  int A[n][3];
  int f[n+1][3];
  f[n][0]=f[n][1]=f[n][2]=0;
  for(int i=0; i<n; i++){
    cin >> A[i][0] >> A[i][1] >> A[i][2];
    f[i][0]=f[i][1]=f[i][2]=0;
    //cout << f[i][0] << f[i][1] << f[i][2] << endl;
  }
  //f[n-1]

  for(int i=n-1; i>=0; i--){
    //f[i]= max(A[i][0]+max(f[i+1][1], f[i+1][2]), max(A[i][1]+max(f[i+1][0], f[i+1][2]),A[i][2]+max(f[i+1][1], f[i+1][0])));
    f[i][0]= A[i][0]+ max(f[i+1][1], f[i+1][2]);
    f[i][1]= A[i][1]+ max(f[i+1][0], f[i+1][2]);
    f[i][2]= A[i][2]+ max(f[i+1][0], f[i+1][1]);
  }

  cout <<  max(f[0][0], max(f[0][1], f[0][2])) << endl;
  return 0;
}


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

int main()
{
  int n, w;
  cin >> n >> w;
  vector<int> wt(n), v(n);
  vector<long long int> dp(vector<long long int>(w + 1));
  for (int i = 0; i < n; ++i)
    cin >> wt[i] >> v[i];
  dp[wt[0]] = v[0];
  for (int i = 1; i < n; ++i) {
    for (int ww = w; ww >= wt[i]; --ww) {
      dp[ww] = max(dp[ww], v[i] + dp[ww-wt[i]]);
    }
  }
  long long int res = 0;

  for (int i = 0; i <= w; ++i)
    res = max(res, dp[i]);

  cout << res <<'\n';


  return 0;
}


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

Measured memory_bytes: 3592
import java.util.*;

public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        sc.close();

        for(long i = 1; i <= 3500; i++){
            for(long j = 1; j <= 3500; j++){
                long m = 4*i*j-N*(i+j);
                if(m <= 0)
                    continue;
                else {
                    if(N*i*j%m == 0 && N*i*j/m <= 3500 ){
                        System.out.println(i+" "+j+" "+N*i*j/m);
                        return;
                    }
                }
            }
        }
    }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#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(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define SORT(v, n) sort(v, v+n)
#define VREV(v) reverse(v.begin(),v.end())
#define REV(v,n) reverse(v,v+n)
#define vi vector<int>
#define pf push_front
#define pb push_back

template<class T, size_t N> size_t countof(const T (&array)[N]) { return N; }
template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<"\n";}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}

void mprint(auto *matrix,auto N){
	REP(i,N) cout<<matrix<<(i!=N-1?' ':'\n');
	return;
}

const double EPS =1e-9;
const int INF =2e+9;
const ll INFL =9e+18;
const long MOD =1e+9+7;
#define PI 3.14159265258979

#define P pair<int,int>
#define Pll pair<ll,ll>
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

inline int in(){int x; cin>>x; return x;}

struct UnionFind{
	vector<int> par; //データiが属する親の番号
	vector<int> sizes; //根ノードiの木に含まれるデータの数

	// 最初は全てのデータiがグループiに存在するものとして初期化
	UnionFind(int n):par(n),sizes(n, 1){
		REP(i,n) par[i] = i;
	}

	// 根を張り替えながら再帰的に根ノードを探す
	int find(int x){
		if(x==par[x]) return x;
		return par[x]=find(par[x]);
	}

	// 2つのデータx, yが属する木をマージする
	void unite(int x, int y) {
		// データの根ノードを得る
		x = find(x);
		y = find(y);

		// 既に同じ木に属しているならマージしない
		if (x == y) return;

		// xの木がyの木より大きくなるようにする
		if (sizes[x] < sizes[y]) swap(x, y);

		// xがyの親になるように連結する
		par[y] = x;
		sizes[x] += sizes[y];
		sizes[y] = 0;  // sizes[y]は無意味な値となるため
	}

	// 2つのデータx, yが属する木が同じならtrueを返す
	bool same(int x, int y) {
		return find(x) == find(y);
	}

	// データxが含まれる木の大きさを返す
	int size(int x) {
		return sizes[find(x)];
	}
};
int gcd(int n,int m){
	if(m>n) return gcd(m,n);
	if(m==0) return n;
	else return gcd(m,n%m); 
}

int main(void){
	int k,result=0;
	string S;
	cin>>S;

	REP(i,15){
		if(S[i]=='\0'){
			k=i;
			break;
		}
		else if(S[i]=='o') result++;
	}

	if(result+(15-k)>=8) print("YES");
	else print("NO");
	return 0;
}


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

const int N = 100001;
int a[N], f[N][32];
int n, m, L, cnt = 2;

int main() {
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	scanf("%d",&L);
	for (int i=1;i<=n;i++) {
		while (a[cnt] - a[i] <= L&& cnt <= n) cnt ++;
		f[i][0] = cnt - 1;
	}
	for (int i=1;i<=30;i++) {
		for (int j=1;j<=n;j++)
			f[j][i] = f[f[j][i-1]][i-1];
	}
	scanf("%d",&m);
	for (int i=1;i<=m;i++) {
		int x, y;
		scanf("%d%d",&x,&y);
		if (x > y) swap(x, y);
		int ans = 0;
		for (int j=30;j>=0;j--) {
			if (f[x][j] >= y) continue;
			ans += 1 << j, x = f[x][j];
		}
		printf("%d\n",ans+1);
	}
	return 0;
}

Measured memory_bytes: 13696
import Foundation

let line = readLine()!.components(separatedBy: " ")
let a = Int(line[0])!
let b = Int(line[1])!
let c = Int(line[2])!
let d = Int(line[3])!
var m: Int = a * c
m = max(m, a * d)
m = max(m, b * c)
m = max(m, b * d)
print(m)

Measured memory_bytes: 14192
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=5e18;
typedef pair<int,int> P;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int h,w,cnt,ans=0,dist[25][25]={},dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
  cin >> h >> w;
  string s[25]={};
  for(int i=0; i<h; i++) {
    cin >> s[i];
  }
  for(int i=0; i<h; i++) {
    for(int j=0; j<w; j++) {
      if(s[i][j]=='.') {
        for(int i=0; i<h; i++) {
          for(int j=0; j<w; j++) {
            dist[i][j]=inf;
          }
        }
        queue<P> q;
        q.push(P(i,j));
        dist[i][j]=0;
        cnt=0;
        while(q.size()) {
          P p=q.front();
          q.pop();
          for(int i=0; i<4; i++) {
            int nx=p.second+dx[i],ny=p.first+dy[i];
            if(0<=nx&&nx<w&&0<=ny&&ny<h&&s[ny][nx]=='.'&&dist[ny][nx]==inf) {
              q.push(P(ny,nx));
              dist[ny][nx]=dist[p.first][p.second]+1;
              cnt=max(cnt,dist[ny][nx]);
            }
          }
        }
        ans=max(ans,cnt);
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using ll = long long int;

const int mod = 1e9+7;

int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int n; cin >> n;
	map<int, int> m;
	vector<int> a(n), b(n);
	for (auto &i : a) {
		cin >> i;
		++m[i];
	}
	for (auto &i : b) {
		cin >> i;
		++m[i];
	}
	for (auto [x, y] : m)
		if (y > n) return cout << "No\n", 0;
	reverse(begin(b), end(b));
	int l = 0, r = -1, intersect = -1;
	for (int i = 0; i < n; ++i) {
		if (a[i] != b[i]) continue;
		intersect = a[i];
		if (r == -1) l = i;
		r = i;
	}
	set<int> active;
	for (int i = 0; i < n; ++i) {
		if (a[i] == intersect || b[i] == intersect) continue;
		active.insert(i);
	}
	for (int i = l; i <= r; ++i) {
		auto u = *active.begin();
		swap(b[i], b[u]);
		active.erase(u);
	}
	cout << "Yes\n";
	for (auto x : b)
		cout << x << ' ';
}

Measured memory_bytes: 23464
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; i++ )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
const ll mod2=1e9+9 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;

int main(){
   int n;
   cin>>n;
   string s;
   cin>>s;
   int m=1<<n;
   vector<ll> v[n+1],w[n+1];
   ll a=123;
   ll b=101;
   rep(i,m){
       int cnt=0;
       ll pos1=1;
       ll pos2=1;
       ll hash1=0;
       ll hash2=0;
       rep(j,n){
           if(i&(1<<j)){
               cnt++;
               hash1+=pos1*(s[j]-'a');
               hash1%=mod;
               pos1=pos1*a%mod;
           }
           if(i&(1<<j)){
               hash2+=pos2*(s[j]-'a');
               hash2%=mod2;
               pos2=pos2*b%mod2;
           }
       }
       for(int j=n-1;j>=0;j--){
           if((i&(1<<j))==0){
               hash1+=pos1*(s[j]-'a');
               hash1%=mod;
               pos1=pos1*a%mod;
           }
       }
       for(int j=n-1;j>=0;j--){
           if((i&(1<<j))==0){
               hash2+=pos2*(s[j]-'a');
               hash2%=mod2;
               pos2=pos2*b%mod2;
           }
       }
       v[cnt].push_back(hash1*hash2);
   }
   rep(i,m){
       int cnt=0;
       ll pos1=1;
       ll pos2=1;
       ll hash1=0;
       ll hash2=0;
       for(int j=n-1;j>=0;j--){
           if(i&(1<<j)){
               cnt++;
               hash1+=pos1*(s[n+j]-'a');
               hash1%=mod;
               pos1=pos1*a%mod;
           }
       }
       for(int j=n-1;j>=0;j--){
           if(i&(1<<j)){
               hash2+=pos2*(s[n+j]-'a');
               hash2%=mod2;
               pos2=pos2*b%mod2;
           }
       }
       rep(j,n){
           if((i&(1<<j))==0){
               hash1+=pos1*(s[n+j]-'a');
               hash1%=mod;
               pos1=pos1*a%mod;
           }
       }
       rep(j,n){
           if((i&(1<<j))==0){
               hash2+=pos2*(s[n+j]-'a');
               hash2%=mod2;
               pos2=pos2*b%mod2;
           }
       }
       
       w[cnt].push_back(hash1*hash2);
   }
   rep(i,n+1)sort(v[i].begin(),v[i].end());
   rep(i,n+1)sort(w[i].begin(),w[i].end());
   ll ans=0;
   rep(i,n+1){
       for(auto x:v[i]){
           ll u=upper_bound(w[i].begin(),w[i].end(),x)-w[i].begin();
           ll d=lower_bound(w[i].begin(),w[i].end(),x)-w[i].begin();
           ans+=u-d;
       }
   }
   cout<<ans<<endl;

   return 0;
}


Measured memory_bytes: 6108
#include <stdio.h>
int main(){
        int n,u,k,v;
        int i,j;
        int M[100][100];

        scanf("%d",&n);
        for(i=0; i<n; i++) {
                for(j=0; j<n; j++) {
                        M[i][j]=0;
                }
        }
        for(i=0; i<n; i++) {
                scanf("%d%d",&u,&k);
                u--;
                for(j=0; j<k; j++) {
                        scanf("%d",&v);
                        v--;
                        M[u][v]=1;
                }
        }
        for(i=0; i<n; i++) {
                for( j=0; j<n; j++) {
                        printf("%d",M[i][j]);
                        if(j==n-1)
                                printf("\n");
                        else
                                printf(" ");
                }

        }
        return 0;
}



Measured memory_bytes: 2112
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define sz(x) (int)(x).size()
#define int long long
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;

signed main() {
  const int MOD = 1e9+7;
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  int n, k; cin >> n >> k;
  vi v(n); for(int& i: v) cin >> i;
  vector<vi> dp(n+1, vi(k+1));
  dp[0][0] = 1;
  vi p(k+2, 1); p[0] = 0;
  vi nxt(k+2);
  rep(i,1,n+1){
    nxt.assign(k+2,0);
    rep(j,0,k+1){
      dp[i][j] = (p[j+1] - p[j-min(j, v[i-1])]) % MOD;
      nxt[j+1] = (nxt[j] + dp[i][j]) % MOD;
    }
    swap(p,nxt);
  }
  cout << (dp[n][k] + MOD) % MOD;
  return 0;
}


Measured memory_bytes: 83856
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1000000007;

int N, K, a[110], dp[110][100100];

signed main()
{
    cin >> N >> K;
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }
    dp[0][0] = 1;
    for(int i = 0; i < N; i++){
        for(int j = 0; j <= K; j++){
            int k;
            if(j - a[i] - 1 < 0){
                k = 0;
            }
            else {
                k = dp[i][j - a[i] - 1];
            }
            dp[i + 1][j] = (dp[i][j] - k + mod) % mod;
            dp[i + 1][j] %= mod;
            if(j > 0){
                dp[i + 1][j] = (dp[i + 1][j] + dp[i + 1][j - 1]) % mod;
            }
            dp[i + 1][j] %= mod;
        }
    }
    cout << dp[N][K] << endl;


    return 0;
}


Measured memory_bytes: 79360
#include<stdio.h>
#define SIZE 100000
#define prinf printf

void update(int *x){
  if(*x==SIZE-1)
    *x=0;
  else
    (*x)++;
}

int main(){
  int queue[SIZE],n,q,time[SIZE],sum=0,head,tail;
  char name[SIZE][10];
  int i,j,k;

  scanf("%d %d",&n,&q);//input
  for(i=0;i<n;i++)
    scanf("%s %d",name[i],&time[i]);

  for(i=0;i<n;i++)//init
    queue[i]=i;
  head=0;tail=n;

  while(head!=tail){
    if(time[queue[head]]<=q){//?????????????????????q??\?????????
      sum+=time[queue[head]];
      prinf("%s %d\n",name[queue[head]],sum);
      update(&head);
    }else{
      sum+=q;
      time[queue[head]]-=q;
      queue[tail]=queue[head];
      update(&head);
      update(&tail);
    }
  }

  return 0;
}

Measured memory_bytes: 3680
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <map>
#include <cstdio>
#include <cmath>
#include <unordered_map>
#include <iomanip>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  vector<int> a(N,0);
  for (int i = 0; i < N; i++){
    cin >> a[i];
  }
  int i = 0, j = 1, count = 0;
  while (i < N){
    if (a[i] == j){
      i++;
      j++;
    }
    else {
      i++;
      count++;
    }
  }
  if (j == 1){
    count = -1;
  }
  cout << count << endl;
}

Measured memory_bytes: 1024
import java.util.*;
public class Main{
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
		String s = sc.next();

		if(s.equals("ABC")){
			System.out.println("ARC");
		}else{
			System.out.println("ABC");
		}

		sc.close();
    
  }
}

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

int main(){
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if(A+B > C+D) cout << "Left" << endl;
    else if(A+B < C+D) cout << "Right" << endl;
    else cout << "Balanced" << endl;
    return 0;
}

Measured memory_bytes: 3624
clst = [10,50,100,500]
def sgn(t):
    for I in range(0,4):
        if clst[I] == t:
            return I
def cnt(l1,l2,N): 
    s = sgn(l1[N])
    l2[s] = l2[s] + 1
def shiharai(bill,purse):
    B = bill
    lst1 = []
    lst2 = [0]
    for i in range(0,4):
        for j in range(0,purse[i]):
            lst1.append(clst[i])
    lst2[0] = lst1[0]
    for i in range(1,len(lst1)):
        k = lst1[i] + lst2[i-1]
        lst2.append(k)
    pay = [0,0,0,0]
    while B > 0:
        i = 0
        while lst2[i] < B:
            i = i + 1
        if lst2[i] == B:
            for j in range(0,i+1):
                cnt(lst1,pay,j)
                B = B - lst1[j]
        else:
            cnt(lst1,pay,i)
            B = B - lst1[i]
    for i in range(4):
        purse[i] = purse[i] - pay[i]
    purse[0] = purse[0] - B//10
    return purse
def exchng(purse,n,r):
    while purse[n] >= r:
        purse[n] = purse[n] - r
        purse[n+1] = purse[n+1] + 1
def ryogae(purse):
    exchng(purse,0,5)
    exchng(purse,1,2)
    exchng(purse,2,5)
    return purse
L = 0
while True:
    bill = int(input().strip())
    if bill == 0:
        break
    if L != 0:
        print()
    lst = list(map(int,input().strip().split(" ")))
    purse = [0,0,0,0]
    for A in range(0,4):
        purse[A] = lst[A]
    purse = shiharai(bill,purse)
    purse = ryogae(purse)
    shouldpay = [0,0,0,0]
    for B in range(0,4):
        if lst[B] > purse[B]:
            shouldpay[B] = lst[B] - purse[B]
    for i in range(0,4):
        if shouldpay[i] != 0:
            print(clst[i],shouldpay[i])
    L = L + 1


Measured memory_bytes: 5624
import itertools
def func(n,j):
   if(n % 10 == 0 or j==4):
      return n
   return n //10 * 10 + 10
def myAnswer(A:int,B:int,C:int,D:int,E:int) -> int:
   dishes = [A,B,C,D,E]
   ans = 10**9
   for i in itertools.permutations(dishes):
      total = 0
      for j,a in enumerate(i):
         total+= func(a,j)
      ans = min(total,ans)
   return ans


def modelAnswer():
   tmp=1
def main():
   A = int(input())
   B = int(input())
   C = int(input())
   D = int(input())
   E = int(input())
   print(myAnswer(A,B,C,D,E))

if __name__ == '__main__':
   main()

Measured memory_bytes: 3064
#include <stdio.h>

int main(){
	int a,b,c,d;
	
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	
	if(a+b>c+d){
		printf("Left");
	}
	if(a+b==c+d){
		printf("Balanced");
	}
	if(a+b<c+d){
		printf("Right");
	}
		
	return 0;
}

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

// template {{{
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); (i) -= 1)

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// }}}

void solver() {
    int N = input(), M = input();

    int l = (N + 1) / 2 / 2, r = l + 1;
    range(i, 0, (M + 1) / 2) {
        cout << l << " " << r << endl;
        r++; l--;
    }

    l = N - (N / 2) / 2 - 1, r = N - (N / 2) / 2 + 1;
    range(i, 0, M / 2) {
        cout << l << " " << r << endl;
        r++; l--;
    }
}

signed main(int argc, char *argv[]) {
    solver();
}


Measured memory_bytes: 3656
N, K = [int(i) for i in input().split()]
cnt = 0
if K % 2 == 0:
    for i in range(1, 2*N//K+1):
        cnt += 1 + (2*N//K-i)//2 * 6 + (2*N//K-i)//2 * ((2*N//K-i)//2 - 1) * 3
else:
    for i in range(1, N//K+1):
        cnt += 1 + (N//K-i) * 6 + (N//K-i) * ((N//K-i) - 1) * 3

print(cnt)

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

#define int long long

using namespace std;

signed main()
{
    int n, ans = 0;
    cin >> n;

    if (n & 1)
        ans = 0;
    else
    {
        n /= 2;
        for (int i = 5; i <= n && i > 0; i *= 5)
            ans += n / i;
    }

    cout << ans;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int n,m,c,x,ans=0,count=0;
    cin>>n>>m>>c;
    int b[m];
    for(int i=0;i<m;i++)cin>>b[i];
    for(int i=0;i<n;i++){
        ans=0;
        for(int j=0;j<m;j++){
            cin>>x;
            ans=ans+x*b[j];
        }
        if(ans+c>0)count++;
    }
    cout<<count <<endl;
}


Measured memory_bytes: 888
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>

using namespace std;

int main()
{
    int N, M;
    std::cin >> N >> M;

    boost::multi_array<bool, 2> mat(boost::extents[N][N]);
    std::vector<std::pair<int, int>> path;

    for (size_t i = 0; i < M; ++i) {
        int a, b;
        std::cin >> a >> b;
        a--;
        b--;
        mat[a][b] = mat[b][a] = true;
        path.push_back(std::make_pair(a, b));
    }


    int bridge = 0;

    for (auto p: path) {
        auto m = mat;
        // パス消す
        m[p.first][p.second] = m[p.second][p.first] = false;

        auto f = [N](auto f, boost::multi_array<bool, 2>& m,
                    std::vector<bool>& visited, int i) -> void
            {
                if (visited[i]) {
                    return;
                }
                visited[i] = true;
                for (auto j = 0; j < N; ++j) {
                    if (m[i][j]) {
                        f(f, m, visited, j);
                    }
                }
            };

        std::vector<bool> visited(N);
        f(f, m, visited, 0);

        if (!std::all_of(std::begin(visited), std::end(visited), [](bool b) {
                    return b;
                }))
        {
            bridge++;
        }
    }

    std::cout << bridge << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(b);i>(a);--i)
#define eper(i,a,b) for(int i=((int)(a));i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF 2000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}
struct edge{int u, v, cost;};
template <typename T> class union_find {
  vector<T> par, rank;

public:
  union_find(size_t n) {
    par.reserve(n + 2);
    rank.reserve(n + 2);
  }

public:
  void init(T n) { // add a set
    rep(i, 0, n) {
      par[i] = i;
      rank[i] = 0;
    }
  }

public:
  T find(T x) { // find the parent of x
    if (par[x] == x)
      return x;
    else
      return par[x] = find(par[x]);
  }

public:
  void unite(T x, T y) { // unite x and y
    x = find(x);
    y = find(y);
    if (x == y)
      return;
    if (rank[x] < rank[y])
      par[x] = y;
    else
      par[y] = x;
    if (rank[x] == rank[y])
      rank[x]++;
  }

public:
  bool same(T x, T y) { // compare x's parent and y's parent
    return find(x) == find(y);
  }
};
bool comp(const edge& e1, const edge& e2) {
    return e1.cost < e2.cost;
}

int V, E;
edge es[100005];    
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> V >> E;
    rep(i, 0, E) {
        int s, t, d;
        cin >> s >> t >> d;
        edge e;
        e.u = s, e.v = t, e.cost = d;
        es[i] = e;
    }

    sort(es, es+E, comp);
    union_find<int> uf = union_find<int>(V);
    uf.init(V);
    int ans = 0;
    rep(i, 0, E) {
        edge e = es[i];
        if (!uf.same(e.u, e.v)) {
            uf.unite(e.u, e.v);
            ans += e.cost;
        }
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 4432
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<int(n);i++)
#define FOR(i,n,m) for(int i=n;i<int(m);i++)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
using namespace std;
 
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
 
int vx[]={0,0,-1,1};
int vy[]={1,-1,0,0};
int dx[]={1,0,-1,1,-1,1,0,-1};
int dy[]={1,1,1,0,0,-1,-1,-1};
 
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}	
 
const ll mod=1e9+7;
const int INF=INT_MAX/2;

int main(){
	string s;
	cin>>s;
	REP(i,3){
		if(s[i]=='7'){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}

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



int main()
{
    int  n, k;
    cin >> n >> k;
    double s[n];
    double pr = 0.000000000000;
    for(int l=0;l<n;l++){
        s[l] = 1.000000000000/n;
    }
    
    for(int i=1;i<=n;i++){
        int a = i;
        while(a<k){
            a = a*2;
            s[i-1] = s[i-1]/2.000000000000;
        }
    }
    for(int j=0;j<n;j++){
        pr = pr+s[j];
    }

    cout << setprecision(12) << pr << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

int main() {
    size_t N;
    scanf("%zu", &N);

    map<int, int> m;
    int max_a=0;
    for (size_t i=0; i<N; ++i) {
        int a;
        scanf("%d", &a);
        ++m[a];
        if (max_a < a)
            max_a = a;
    }

    if (N == 2)
        return !printf("%sossible\n", m[1]==2? "P":"Imp");

    if (m[1] > 1)
        return !printf("Impossible\n");

    for (int i=max_a; i>max_a/2; --i) {
        if (m[i] < 2)
            return !printf("Impossible\n");
    }

    if (max_a % 2)
        if (m[(max_a+1)/2] > 2)
            return !printf("Impossible\n");

    if (m[max_a/2] != 1-(max_a%2))
        return !printf("Impossible\n");

    for (int i=max_a/2; --i;)
        if (m[i])
            return !printf("Impossible\n");

    printf("Possible\n");
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 3; i <= n; ++i) {
		int cnt = 0;
      	if (i % 2 == 1)
		for (int j = 1; j <= i; ++j) {
			if (i % j == 0)
				cnt++;
		}
		if (cnt == 8)
			ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<long double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
#define INF 1LL<<60

int main() {
    int mod = 1e9+7;
    int N;
    string s;
    cin >> N >> s;

    vector<vector<ll>> dp(N, vector<ll>(N, 0));
    dp[0][0] = 1;

    for(int i=1; i<=N-1; i++) {
        ll tmp = 0;
        if(s[i-1] == '>')
            for(int j=i; j>=0; j--) {
                (tmp += dp[i-1][j]) %= mod;
                dp[i][j] = tmp;
            }
        else
            for(int j=0; j<=i; j++) {
                dp[i][j] = tmp;
                (tmp += dp[i-1][j]) %= mod;
            }
    }

    // cerr << "debug" << endl;
    // for(int i=0; i<=N-1; i++) {
    //     for(auto x: dp[i]) cerr << x << " "; cerr << endl;
    // }

    ll ans = 0;
    for(int i=0; i<N; i++) (ans += dp[N-1][i]) %= mod;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 70656
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const ll INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
using Graph = vector<vector<int>>;
ll mypow(ll x, ll n, ll m) {
	if (n == 0) {
		return 1;
	}
	if (n % 2 == 0) {
		return mypow(x*x%m, n / 2, m);
	}
	else {
		return x * mypow(x, n - 1, m) % m;
	}
}
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
const int MAX = 510000;
ll fac[MAX], finv[MAX], inv[MAX];
//テーブルをつくる前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;//mod pにおける1,2,,,nの逆元
	for (int i = 2; i < MAX; ++i) {
		fac[i] = fac[i - 1] * i%INF;
		inv[i] = INF - inv[INF%i] * (INF / i) % INF;
		finv[i] = finv[i - 1] * inv[i] % INF;
	}
}

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] % INF) % INF;
}
///////////////////////////////////////
ll PowMod_RepeatSquaring(ll N, ll P, ll M) {
	if (P == 0)return 1;
	if (P % 2 == 0) {
		ll t = PowMod_RepeatSquaring(N, P / 2, M);
		return t * t%M;
	}
	return N * PowMod_RepeatSquaring(N, P - 1, M);
}
int main() {
	int n, m; cin >> n >> m;
	int a[10010];
	int sum = 0;
	REP(i, m) {
		cin >> a[i];
		sum += a[i];
	}
	if (sum > n) {
		cout << -1 << endl;
	}
	else {
		cout << n - sum << endl;
	}
	return 0;
}


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


int main(){
    string s;
    cin>>s;
    if(s=="AAA" or s=="BBB"){
        cout<<"No"<<endl;
        return 0;
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 256
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=[a,b,c,d,e]
ma=max(f)
mi=min(f)
if ma-mi>k:
  print(":(")
else:
  print("Yay!")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      int S;
      
      cin >> S;
      
      if(S >= 1300 || S < 100){
        if(S%100 >= 13 || S%100 ==0){
          cout << "NA" << endl;
        }
        else cout << "YYMM" <<endl;
      }
      else if(S%100 >= 13 || S%100 ==0){
        cout << "MMYY" <<endl;
      }
      else cout<< "AMBIGUOUS" << endl;
    }

Measured memory_bytes: 256
l, r = [int(x) for x in input().split()]
NUM = 2019
if r // NUM - (l + NUM - 1) // NUM >= 0: #2019の倍数を区間に含む
    res = 0
elif r // 3 - (l + 3 - 1) // 3 >= 0 and r // 673 - (l + 673 - 1) // 673 >= 0:
    res = 0
else: #mod 2019 = 0にできない場合
    res = 2019
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            res = min(res, (i * j) % NUM)
print(res)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_a_genius = 0; ngtkana_is_a_genius < int(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (int i = int(begin); (i) < int(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
#define debug(...)\
  do {\
    std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_impl(__VA_ARGS__);\
    std::cerr << std::noboolalpha;\
  } while (false)
#else
#define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
  { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
 os << "{";
  for (auto it = v.begin(); it != v.end(); it++)
    {os << (it != v.begin() ? "," : "") << *it;}
  return os << "}";
}

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  lint n, D; std::cin >> n >> D;
  std::vector<lint>a(n),b(n+1),c(n+1,0);
  std::cin>>a;
  b.at(0) = D;
  rep(i,0,n) {
    lint & crr = b.at(i);
    lint & nxt = b.at(i+1);
    lint x = a.at(i);
    lint z = crr - x;
    if (z < 0) z = -z;
    nxt = crr;
    cmn(nxt, z);
  }
  for (int i = n-1; i >= 0; i--) {
    lint & crr = c.at(i);
    lint & nxt = c.at(i+1);
    crr = nxt;
    lint x = a.at(i);
    if (x <= 2 * nxt + 1) {
      crr += x;
    }
  }
  // debug(a,b,c);

  int q; std::cin >> q;
  loop(q) {
    int u; std::cin >> u;
    u--;
    bool ans = b.at(u) > c.at(u+1);
    std::cout << (ans ? "YES" : "NO") << std::endl;
  }
  return 0;
}

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

int f(int n) {
	if (n <= 1) return 0;
	return n * (n-1) / 2;
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0);
	int n, m;
	cin >> n >> m;
	cout << f(n) + f(m) << endl;
}

Measured memory_bytes: 256
N,K=map(int, input().split())
AA=list(map(int, input().split()))
A=sorted(AA)
B=sorted(AA)[::-1]
mod=10**9+7

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
n = 10**6+1
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n+1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans=0
for i in range(N-K+1):
  d=(A[K-1+i]%mod)*cmb(K-1+i,K-1,mod)
  e=(B[K-1+i]%mod)*cmb(K-1+i,K-1,mod)
  ans+=d%mod-e%mod
  ans%=mod
print(ans)

Measured memory_bytes: 129120
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream &operator << (ostream& out,const pair<S,T>& o){
    out << "(" << o.first << "," << o.second << ")"; return out;
}
/*
 Atcoder 100~200点代
 アな問題が多いので,まとめる
*/
// https://abc042.contest.atcoder.jp/tasks/abc042_a
//void solve(){ ll A,B,C; cin >> A >> B >> C; if(A == 5 && B == 5 && C == 7){ cout << "YES" << endl; return;} if(A == 5 && B == 7 && C == 5){ cout << "YES" << endl; return;} if(A == 7 && B == 5 && C == 5){ cout << "YES" << endl; return;} cout << "NO" << endl; return ; }
// https://abc043.contest.atcoder.jp/tasks/abc043_a
//void solve(){ ll N; cin >> N; cout << N*(N+1)/2 << endl; }
// https://abc044.contest.atcoder.jp/tasks/abc044_a
//void solve(){ll N,K,X,Y;cin>>N>>K>>X>>Y; cout<<X*min(N,K)+Y*max(0LL,N-K)<<endl;}
// https://abc045.contest.atcoder.jp/tasks/abc045_a
//void solve(){ll a,b,h;cin>>a>>b>>h;cout<<(a+b)*h/2<<endl;}
// https://abc046.contest.atcoder.jp/tasks/abc046_a
//void solve(){ ll a,b,c; cin >> a >> b >> c; set<ll> s; s.insert(a); s.insert(b); s.insert(c); cout << s.size() << endl; }
// https://abc047.contest.atcoder.jp/tasks/abc047_a
//void solve(){ll a,b,c;cin>>a>>b>>c;if(a==b+c||b==a+c||c==a+b)cout<<"Yes"<<endl;else cout<<"No"<<endl;}
// https://abc048.contest.atcoder.jp/tasks/abc048_a
//void solve(){string s1,s2,s3;cin>>s1>>s2>>s3;cout<<"A"<<s2[0]<<"C"<<endl;}
// https://abc049.contest.atcoder.jp/tasks/abc049_a
//void solve(){char c;cin>>c;string s="aiueo";if(s.find(c)!=string::npos)cout<<"vowel"<<endl;else cout<<"consonant"<<endl;}
// https://abc050.contest.atcoder.jp/tasks/abc050_a
//void solve(){ll A,B;char op;cin>>A>>op>>B;if(op=='+')cout<<A+B<<endl;else cout<<A-B<<endl;}
// https://abc051.contest.atcoder.jp/tasks/abc051_a
//void solve(){string s;cin>> s;cout<<s.substr(0,5)<<" "<<s.substr(6,7)<<" "<<s.substr(14)<<endl;}
// https://abc052.contest.atcoder.jp/tasks/abc052_a
//void solve(){ll A,B,C,D;cin>>A>>B>>C>>D;cout<<max(A*B,C*D)<<endl;}
// https://abc053.contest.atcoder.jp/tasks/abc053_a
//void solve(){ll x;cin>>x;cout<<(x<1200?"ABC":"ARC")<<endl;}
// https://abc054.contest.atcoder.jp/tasks/abc054_a
//void solve(){ll A,B;cin>>A>>B;if(A==1)A=14;if(B==1)B=14;cout<<(A>B?"Alice":(A==B?"Draw":"Bob"))<<endl;}
// https://abc055.contest.atcoder.jp/tasks/abc055_a
//void solve(){ll N;cin>>N;cout<<800*N-200*(N/15)<<endl;}
// https://abc056.contest.atcoder.jp/tasks/abc056_a
//void solve(){char a,b;cin>>a>>b;if(a=='H')cout<<b<<endl;else if(b=='H')cout<<'D'<<endl;else cout<<'H'<<endl;}
// https://abc057.contest.atcoder.jp/tasks/abc057_a
//void solve(){ll A,B;cin>>A>>B;cout<<(A+B)%24<<endl;}
// https://abc058.contest.atcoder.jp/tasks/abc058_a
//void solve(){ll a,b,c;cin>>a>>b>>c;cout<<(b-a==c-b?"YES":"NO")<<endl;}
// https://abc059.contest.atcoder.jp/tasks/abc059_a
void solve(){string s1,s2,s3;cin>>s1>>s2>>s3;cout<<(char)toupper(s1[0])<<(char)toupper(s2[0])<<(char)toupper(s3[0])<<endl;}

// Main function
int main(void) {cin.tie(0); ios::sync_with_stdio(false); solve(); return 0; }


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cctype>
#include <cassert>
#include <cstring>
#include <climits>
 
using namespace std;
 
#define FOR(k,a,b) for(int k=(a); k < (b); k++)
#define FORE(k,a,b) for(int k=(a); k <= (b); k++)
#define REP(k,a) for(int k=0; k < (a); k++)
 
#define ALL(c) (c).begin(), (c).end()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define RANGE(lb, x, ub) ((lb) <= (x) && (x) < (ub))
 
#define dump(x) cerr << #x << ": " << (x) << endl;
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
 
const int INF = 1000000000;
const double EPS = 1e-10;
const double PI = acos(-1.0);
 
int main(void) {
	ll n, k; cin >> n >> k;
	ll m = n % k;
	ll res = min(m, abs(m - k));

	cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<numeric>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#include<map>
#include<stack>
#include<queue>
#include<ctype.h>
#include <fstream>
#define For(a,b) for(int i=(a);i<(b);i++)
#define Rep(n) for(int i=0; i<(n); ++i)
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;
char isExist(char c, string s);
//----------program from here----------

int main(){
    string S;
    cin >> S;
    int Ans=0;
    for(int i=0,num=0; i<S.length(); ++i){
        if(isExist(S[i], "ATGC")) ++num;
        else num=0;
        Ans=max(Ans,num);
    }
    cout << Ans << endl;
}


char isExist(char c, string s){
    bool flag=false;
    for(char i:s)
    if(i==c) flag=true;
    return flag;
}

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

int main(){
	int a;
	while(cin >> a){
		int counter = 0;
		for(int i = 0; i < 10; i++)
			for(int j = 0; j < 10; j++)
				for(int k = 0; k < 10; k++)
					for(int l = 0; l < 10; l++)
						if(i+j+k+l == a)
							counter++;
		cout << counter << endl;
	}
}


Measured memory_bytes: 3092
N, M = map(int,input().split())
PY = [list(map(int,input().split()))+[0] for _ in range(M)]
sort_PY = sorted(PY, key = lambda x:x[1])
city = {}
for i in range(M):
  p, y = sort_PY[i][0], sort_PY[i][1]
  if(p in city):
    city[p] += 1
  else:
    city[p] = 1
  sort_PY[i][2] = city[p]
for p, y, z in PY:
  print(str(p).zfill(6)+str(z).zfill(6))

Measured memory_bytes: 30076
import math

n = int(input())
a = 1
b = 1
tmp_ans = 0
ans = 10**12

for i in range(1, int(math.sqrt(n))+1):
    j = n // i
    if n == i*j:
        tmp_ans = (i-a) + (j-b)
        ans = min(ans, tmp_ans)
print(ans)


Measured memory_bytes: 9072
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
//#define int long long //Strong Power
#ifdef LOCAL
#define lout cout
#else
stringstream devnull;
#define lout devnull
#endif
#define AMULET \
  cin.tie(0);  \
  ios::sync_with_stdio(false);
// https://github.com/kurokoji/.cpp-Template/blob/master/template/template2.cpp
#define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep4, rep3, rep2, rep1) \
(__VA_ARGS__)
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) rep4(i, a, n, 1)
#define rep4(i, a, n, d) for (decltype(n) i = (a); i < (n); i += (d))
#define rrep(...) GET_MACRO(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1) \
(__VA_ARGS__)
#define rrep1(a) rrep2(_, a)
#define rrep2(i, a) rrep3(i, a, 0)
#define rrep3(i, a, n) rrep4(i, a, n, 1)
#define rrep4(i, a, n, d) for (decltype(a) i = (a); i >= (n); i -= (d))
// -----
typedef long long ll;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
template <class C>
inline void vcin(C &c);
template <class C, class D>
inline void vcin(C &c, D &d);
template <class C>
inline void vcout(const C &c, const string separate = "\n");
template <class T = int>
inline T in();

void solve()
{
  while (true)
  {
    int n = in();
    if (n == 0)
    {
      break;
    }
    vector<int> a(n);
    vcin(a);

    int ave = accumulate(a.begin(), a.end(), 0) / a.size();

    int cnt = 0;
    for (auto &&e : a)
    {
      if (e <= ave)
        cnt++;
    }

    cout << cnt << endl;
  }
}

signed main()
{
  AMULET
  solve();
  return 0;
}

template <class C>
inline void vcin(C &c)
{
  for (auto &a : c)
  {
    cin >> a;
  }
}
template <class C, class D>
inline void vcin(C &c, D &d)
{
  for (auto it1 = c.begin(), it2 = d.begin(); it1 != c.end() && it2 != d.end(); it1++, it2++)
  {
    cin >> *it1 >> *it2;
  }
}
template <class C>
inline void vcout(const C &c, const string separate)
{
  for (auto it = c.begin(); it != c.end(); it++)
  {
    if (it != c.begin())
      cout << separate;
    cout << *it;
  }
}
template <class T = int>
inline T in()
{
  T x;
  cin >> x;
  return (x);
}



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

#define ll long long
#define INF 99999999
#define rep(i,n) for(int i=0,temp=(int)(n);i<temp;++i) //vec.size()がnの時等の高速化
#define loop(i,start,end) for(int i=start,temp=(int)(end);i<end;++i)
#define rfor(v,x) for(const auto& x : v) //xは値を表す
#define all(x) (x).begin(),(x).end()
#define SORT(v, n) sort(v, v+n)
#define vsort(v) sort(v.begin(), v.end())
#define vfsort(v,lambda) sort(v.begin(),v.end(),lambda)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vin(v) rep(i,v.size()) {cin >> v[i];}

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int ctoi(char c) {return c-'0';}
//(lambda (x y) (< x y)) => [](int x, int y) -> int { return x<y; }


int main(void){
  int n,k;
  cin >> n >> k;
  

  cout << n-k+1 << endl;

  return 0;
}


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

int main( )
{
    int a, b, c;
    cin >> a >> b >> c;
    set<int> st;
    st.insert(a);
    st.insert(b);
    st.insert(c);
    cout << (int) st.size() << '\n';
    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

def count(S,i,j):
    if i >= 0 and i < H and j >= 0 and j < W:
        if S[i][j] != '#':
            S[i][j] += 1

H, W = map(int, raw_input().split())
S = [['' for i in range(W)] for j in range(H)]
mine = []
for h in range(H):
    tmps = raw_input()
    for index,tmp in enumerate(tmps):
        if tmp == '#':
            S[h][index] = '#'
        else:
            S[h][index] = 0
for i,a in enumerate(S):
    for j,b in enumerate(a):
        if b == '#':
            count(S,i,j+1)
            count(S,i,j-1)
            count(S,i-1,j-1)
            count(S,i-1,j)
            count(S,i-1,j+1)
            count(S,i+1,j-1)
            count(S,i+1,j)
            count(S,i+1,j+1)
for s in S:
    p = ''
    for q in s:
        p = p + str(q)
    print(p)


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int ok[101010];
string S;
int L;
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	ok[0]=1;
	cin>>S;
	L=S.size();
	FOR(i,L) if(ok[i]) {
		if(i+5<=L && S.substr(i,5)=="dream") ok[i+5]=1;
		if(i+7<=L && S.substr(i,7)=="dreamer") ok[i+7]=1;
		if(i+5<=L && S.substr(i,5)=="erase") ok[i+5]=1;
		if(i+6<=L && S.substr(i,6)=="eraser") ok[i+6]=1;
	}
	
	if(ok[L]) _P("YES\n");
	else _P("NO\n");
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Measured memory_bytes: 848
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int n;
	int value;
	
	cin >> n;
	for (int j = 0; j < n; j++){
		cin >> value;
		cout << "Case " << j + 1 << ':' << endl;
		for (int i = 0; i < 10; i++){
			value = pow(value, 2);
			value /= 100;
			value %= 10000;
			cout << value << endl;
		}
	}
	return (0);
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MAXN = 100 * 1000 + 7;
int a[MAXN], b[MAXN];
int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
        b[i] = a[i];
    }
    sort(b, b + n);
    map<int, int> go;
    int res = 0;
    for (int i = 0; i < n; i++)
    {
        go[b[i]] = i;
    }
    for (int i = 0; i < n; i++)
    {
        if (i % 2 != go[a[i]] % 2) res++;
    }
    printf("%d\n", (res + 1) / 2);
    return 0;
}


Measured memory_bytes: 5760