akhauriyash/Code-Regression huggingface dataset:
def roundone(s):
    ans = [1, 1, 1]
    for i in s:
        ans[i - 1] = 0
    for a in range(len(ans)):
        if ans[a]:
            print(a + 1)

if __name__ == "__main__":
    import sys
    in_str = []
    for line in sys.stdin:
        in_str.append(int(line))
    roundone(in_str)

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

int main() {
    int k, t, a; cin >> k >> t;
    
    int m = -1;
    for (int i = 0; i < t; i++) {
        cin >> a;
        if (a > m) m = a;
    }
    
    cout << max((m-1)-(k-m), 0) << endl;
}


Measured memory_bytes: 256
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func getCombinationTable(n, k, p int) [][]int {
	table := make([][]int, n+1)
	table[0] = make([]int, k+1)
	table[0][0] = 1
	for i := 1; i <= n; i++ {
		table[i] = make([]int, k+1)
		table[i][0] = 1
		for j := 1; j <= k; j++ {
			table[i][j] = (table[i-1][j] + table[i-1][j-1]) % p
		}
	}
	return table
}

func main() {
	scanner.Split(bufio.ScanWords)

	prime := 1000000000 + 7

	nBalls := nextInt()
	nBoxes := nextInt()

	table := getCombinationTable(nBalls+nBoxes-1, nBalls, prime)
	fmt.Println(table[nBalls+nBoxes-1][nBalls])
}



Measured memory_bytes: 18264
#include<cstdio>
#include<string>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const static int MAX_LENGTH = 100000;
unsigned answer[MAX_LENGTH];

int main(){
    string S;
    cin >> S;
    unsigned sz = S.size();
    vector<unsigned> RL, LR = {0};
    for (size_t i = 1; i < sz; i++){
        if(S[i-1] == 'L' && S[i] == 'R') LR.push_back(i);
        else if(S[i-1] == 'R' && S[i] == 'L') RL.push_back(i);
    }
    LR.push_back(sz);
    unsigned meet = RL.size();
    for (size_t i = 0; i < meet; i++){
        answer[RL[i]-1] = (LR[i+1] - RL[i] >> 1) + (RL[i] - LR[i] + 1 >> 1);
        answer[RL[i]] = (LR[i+1] - RL[i] + 1 >> 1) + (RL[i] - LR[i] >> 1);
    }
    printf("%u", answer[0]);
    for (size_t i = 1; i < sz; i++){
        printf(" %u", answer[i]);
    }
    printf("\n");
	return 0;
}

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

int main() {
  int a, ans=0;
  cin >> a;
  
  if (a <= 999) ans = 999;
  if (a <= 888) ans = 888;
  if (a <= 777) ans = 777;
  if (a <= 666) ans = 666;
  if (a <= 555) ans = 555;
  if (a <= 444) ans = 444;
  if (a <= 333) ans = 333;
  if (a <= 222) ans = 222;
  if (a <= 111) ans = 111;
  
  cout << ans << endl;
}

Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#define MOD 1000000007

using namespace std;
typedef long long ll;

int main(void) {
	int h, w, k, i, j, a, b;
	cin >> h >> w >> k;
	vector<vector<ll>> dp(h + 1, vector<ll>(w, 0));
	dp[0][0] = 1;
	for (i = 0; i < h; i++) {
		for (a = 0; a < 1 << (w - 1); a++) {
			b = a;
			while (b > 0 && (b & 3) != 3)
				b >>= 1;
			if (b > 0)
				continue;
			for (j = 0; j < w; j++) {
				if (a & (1 << j)) {
					dp[i + 1][j + 1] += dp[i][j];
					dp[i + 1][j + 1] %= MOD;
				}
				else if (j > 0 && (a & (1 << (j - 1)))) {
					dp[i + 1][j - 1] += dp[i][j];
					dp[i + 1][j - 1] %= MOD;
				}
				else {
					dp[i + 1][j] += dp[i][j];
					dp[i + 1][j] %= MOD;
				}
			}
		}
	}
	cout << dp[h][k - 1] << "\n";
	return 0;
}

Measured memory_bytes: 256
n = int(input())
A = sorted(list(map(int, input().split())))
B = list(map(int, input().split()))
C = sorted(list(map(int, input().split())))

def isOK(target,mid):
  return target < mid
def isOK_dep(target,mid):
  return target <= mid

def bin_search(l,r,li,target):
  left = l
  right = r
  while right-left>1:
    mid = (left + right)//2
    if isOK(target,li[mid]):
      right = mid
    else:
      left = mid
  return left

def bin_search_dep(l,r,li,target):
  left = l
  right = r
  while right-left>1:
    mid = (left + right)//2
    if isOK_dep(target,li[mid]):
      right = mid
    else:
      left = mid
  return left

ans = 0
for i in range(n):
  top,bottom = 0,0
  top += bin_search_dep(-1,n,A,B[i]) + 1
  bottom += n-bin_search(-1,n,C,B[i])-1
  ans += top * bottom
print(ans)

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


int main()
{
    int x[5];
    cin >> x[0] >> x[1] >> x[2] >> x[3] >> x[4];
    for (int a = 0; a < 5; ++a)
    {
        if (x[a] == 0) {
            cout << a + 1;
            break;
        }
    }
	return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <algorithm>
using namespace std; 
const int N = 105;
int a[N];
int n;
void print()
{
	for(int i = 0;i < n;++i)
	{
		cout << a[i];
		if(i != n-1)
			cout << " ";		
	}
	cout << endl;
}

void insertionSort()
{
	for(int i = 1;i < n;++i)
	{
		int v = a[i];
		int j = i-1;
		while(j >= 0 && a[j] > v)
			a[j+1] = a[j],--j;
		a[j+1] = v;
		print();
	}
}

int main()
{
	cin >> n;
	for(int i = 0;i < n;++i)	cin >> a[i];
	print();
	insertionSort();
	return 0;
}


Measured memory_bytes: 3088
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define f(i,n) for(i=1; i<=n;i++)
int main(){
    long long s=1,n,i,a,b,k;
    char c;
    scanf("%lld", &n);
    f(i,n)
        s=s*i;                   
    printf("%lld", s);
    cout<<endl;
    return 0;
}

Measured memory_bytes: 1224
#include <iostream>
using namespace std;
int main(){
 int H;
 int n;

cin>>H;
 cin>>n;
 
int sum=0;
int A[n];

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

 if(H<=sum){

     cout<<"Yes";
 }
 else{

     cout<<"No";
 }

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define gre greater //sortを降順にする
#define pri_queue priority_queue //優先度付きキュー
const int mod = 1000000007;
int n; double ans=0;
std::vector<int> x,y,test;
int main(){
  cin >> n;
  x.resize(n); y.resize(n);
  for (size_t i = 0; i < n; i++) {
    test.pb(i);
  }
  for (size_t i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  int xx=0;
  do {
    double a=0;
    for (size_t i = 0; i < n-1; i++) {
      a += sqrt(pow(x[test[i]] - x[test[i+1]] , 2) + pow(y[test[i]] - y[test[i+1]] , 2));
    }
    ans += a;
    xx++;
  } while(next_permutation(all(test)));
  ans /= xx;
  cout << std::fixed << std::setprecision(6) << ans << endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
N,Q=map(int,input().split())
ans=[0]*N
ki=[[] for _ in range(N)]
for i in range(N-1):
 a,b=map(int,input().split())
 ki[a-1].append(b-1)
 ki[b-1].append(a-1)
for i in range(Q):
 p,q=map(int,input().split())
 ans[p-1]+=q
# dfs
stack = [0]
visited = ["False"] * N
while stack:
 ne = stack.pop()
 if visited[ne] == "False":
  visited[ne] = "True"
  for j in ki[ne]:
   if visited[j] == "False":
    ans[j]+=ans[ne]
    stack.append(j)
print(*ans)

Measured memory_bytes: 55728
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

int main()
{
    int n;
    std::cin >> n;
    std::vector<int> min_count(26, 999);
    for (int i = 0; i < n; ++i)
    {
        std::string s;
        std::cin >> s;

        std::vector<int> count(26);
        for (const char c : s)
        {
            ++count[c - 'a'];
        }

        std::transform(min_count.begin(), min_count.end(),
                       count.begin(), min_count.begin(),
                       [](const int x, const int y) {
                           return std::min(x, y);
                       });
    }

    for (int i = 0; i < 26; ++i)
    {
        for (int j = 0; j < min_count[i]; ++j)
        {
            std::cout << static_cast<char>('a' + i);
        }
    }
    std::cout << std::endl;
    return 0;
}


Measured memory_bytes: 3632
using System;

class Program
{
    static void Main()
    {
        while (true)
        {
            string input = Console.ReadLine();
            if (input == "#") break;
            bool crh=ckhnd(input[0]);
            int count = 0;
            for (int i = 1; i < input.Length; i++)
            {
                if (ckhnd(input[i]) != crh)
                {
                    count++;
                    crh = !crh;
                }
            }
            Console.WriteLine(count);
        }
    }
    static bool ckhnd(char target)
    {
        if (target > 'g' && target < 'q') return true;
        if (target == 'u' || target == 'y') return true;
        return false;
    }
}

Measured memory_bytes: 5600
#include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <string.h>
    #define ll long long
    #define SIZE 4005
    
    int max(int aa, int bb);
    
    int main(void) {
        int a_len,b_len,itr,itrA,itrB,dp[SIZE][SIZE],tmp,piv_x,piv_y,piv_ans=0,ans_len;
        char a_str[SIZE],b_str[SIZE], ans[SIZE] = {};
        //memset(ans, '\0', sizeof(ans));
        scanf("%s %s",a_str,b_str);
        //配列の長さを取得
        a_len = strlen(a_str);
        b_len = strlen(b_str);
        //初期化
        for(itr = 0;itr <= a_len; itr++){
            dp[itr][0] = 0;
        }
        for(itr = 0;itr <= b_len; itr++){
            dp[0][itr] = 0;
        }
        /*
        dpの計算
        三通りあるので、それらの最大値を取る
        */
        for(itrA = 1;itrA <= a_len; itrA++){
            for(itrB = 1;itrB <= b_len; itrB++){
                dp[itrA][itrB] = max(dp[itrA][itrB-1],dp[itrA-1][itrB]);
                if(a_str[itrA-1]==b_str[itrB-1]){
                    tmp = dp[itrA-1][itrB-1] + 1;
                    dp[itrA][itrB] = max(dp[itrA][itrB],tmp);
                }
            }
        }
        //右下から探索を始める
        piv_x = a_len;
        piv_y = b_len;
        
        while(piv_x != 0 && piv_y != 0){
            if(dp[piv_x][piv_y] == dp[piv_x-1][piv_y]){
                piv_x--;
            }
            else if(dp[piv_x][piv_y] == dp[piv_x][piv_y-1]){
                piv_y--;
            }
            else{
                //左上なのでansに追加
                ans[piv_ans] = a_str[piv_x-1];
                piv_ans++;
                piv_y--;
            }
        }
        ans_len = strlen(ans);
        //反転しながら出力
        for(itr = ans_len-1;itr >= 0; itr--){
            printf("%c",ans[itr]);
        }
        printf("\n");
        
        return 0;
    }
    //maxを計算する関数
    int max(int aa, int bb) {
        if (aa > bb)
            return aa;
        else
            return bb;
    }


Measured memory_bytes: 48896
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	#a = int(input())
	#b , c = IN()
	s = input()
	is_coffee_like = (s[2]==s[3]) and (s[4]==s[5])
	ret = 'Yes' if is_coffee_like else 'No'
	print(ret)
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 38256
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args)throws IOException{
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        String input = br.readLine();
        int result = 0;

        if(input.contains("A")){
          result++;
        }

        if(input.contains("B")){
          result++;
        }

        if(result == 2){
          System.out.println("Yes");
        }else{
          System.out.println("No");
        }
      }
    }
}

Measured memory_bytes: 21204
#include<iostream>
using namespace std;
long long a[100010];

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)cin >> a[i];
	int zero = 0;
	for (int i = 0; i < n; i++)if (a[i] == 0)zero++;
	if (zero>0) {
		cout << 0;
		return 0;
	}
	long long prod = 1;
	for (int i = 0; i < n; i++) {
		if (a[i] <= 1000000000000000000 / prod) {
			prod *= a[i];
		}
		else {
			cout << -1;
			return 0;
		}
	}
	cout << prod;
}

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


int main(){
    int n, ans = 0;
    cin >> n;
    vector<int> a(n+1), b(n+1, 0);
    for(int i = 1; i < n+1; i++) cin >> a[i];

    for(int i = n; i >= 1; i--){
        int cnt = 0, k = 1;
        for(int j=1; i*j <= n; j++)if(b[i*j])cnt^=1;
        if(cnt != a[i]){
            b[i] ^= 1;
            ans++;
        }
    }
    cout << ans << endl;
    for(int i = 1; i <= n; i++){
        if(b[i]) cout << i << " ";
    }
    cout << endl;
}


Measured memory_bytes: 2432
#include <iostream>

using namespace std;

typedef long long ll;

ll mod = 1e9 + 7;
ll dp[100005][13];

int main(int argc, char *argv[])
{
	string S;

	cin >> S;

	ll len = S.size();
	ll mul = 1;

	dp[0][0] = 1;
	for (int i = len - 1; i >= 0; i--) {
		int c;
		if (S[i] == '?') {
			c = -1;
		} else {
			c = S[i] - '0';
		}
		for (int j = 0; j < 10; j++) {
			if (c != -1 && c != j) {
				continue;
			}
			for (int k = 0; k < 13; k++) {
				dp[len - i][(mul * j + k) % 13] += dp[len - 1 - i][k];
				dp[len - i][(mul * j + k) % 13] %= mod;
			}
		}
		mul *= 10;
		mul %= 13;
	}

	cout << dp[len][5] << endl;

	return 0;
}


Measured memory_bytes: 10624
using System;

namespace ABC091_A_Two_Coins
{
	internal class Program
	{
		public static void Main(string[] args)
		{
			string[] input = Console.ReadLine().Split(' ');
			int a = int.Parse(input[0]);
			int b = int.Parse(input[1]);
			int c = int.Parse(input[2]);

			if (a + b >= c)
			{
				Console.WriteLine("Yes");
			}
			else
			{
				Console.WriteLine("No");
			}
		}
	}
}

Measured memory_bytes: 11092
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
b = []
for _ in range(n):
    b.append(int(input()))
data = [0] * 9
for i in b:
    if i in a1:
        data[a1.index(i)] = 1
    if i in a2:
        data[a2.index(i)+3] = 1
    if i in a3:
        data[a3.index(i)+6] = 1

if data[0:3] == [1, 1, 1]:
    print('Yes')
elif data[3:6] == [1, 1, 1]:
    print('Yes')
elif data[6:9] == [1, 1, 1]:
    print('Yes')
elif data[0::3] == [1, 1, 1]:
    print('Yes')
elif data[1::3] == [1, 1, 1]:
    print('Yes')
elif data[2::3] == [1, 1, 1]:
    print('Yes')
elif [data[0], data[4], data[8]] == [1, 1, 1]:
    print('Yes')
elif [data[2], data[4], data[6]] == [1, 1, 1]:
    print('Yes')
else:
    print('No')


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

using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end)for(int i=start;i<end;i++)
#define SORT(v) sort(v.begin(),v.end())
typedef long long ll;

int gcd(int a,int b)
{
    if(a<b)swap(a,b);
    if(b==0) return a;
    else return(gcd(b,a%b));
}

int main()
{
    int k,ans=0;
    cin>>k;
    for(int h=1;h<=k;h++)
    {
        for(int i=1;i<=k;i++)
        {
            for(int j=1;j<=k;j++)
            {
                ans+=gcd(h,gcd(i,j));
            }
        }
    }
    // ans=gcd(6,9);
    cout<<ans;
}

Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include <vector>
#include <cstdio>
#include <iomanip>
#include <cmath>  
#include <cstdlib>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i <= n; i++) 
 
int main() {
    int n;
    cin >> n;
    if (n%10==7) {
        cout << "Yes" << endl;
        return 0;
    }
    n /= 10;
    if (n%10==7) {
        cout << "Yes" << endl;
        return 0;
    }
    n /= 10;
     if (n%10==7) {
        cout << "Yes" << endl;
        return 0;
    }
 
    cout << "No" << endl;
    return 0;
 
}

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

int main(){
  std::vector<int> v(3);
  std::cin>>v[0]>>v[1]>>v[2];

  std::sort(v.begin(), v.end());

  std::cout<<(10 * v[2]+ v[0] + v[1])<<std::endl;
  return 0;
}

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

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

typedef long long lint;

using namespace std;

int main(){
  string S;
  cin>>S;
  bool f=true;
  REP(i,S.size()){
    if(i%2==0 and S[i]=='L')f=false;
    else if(i%2==1 and S[i]=='R')f=false;
  }
  cout<<(f?"Yes":"No")<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
#include<list>
using namespace std;
typedef unsigned long long int ulint;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define RE return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
const int mod=1e9+7;
const llint big=1e18+100;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
template <class T> void soun(T& ar)
{sort(ar.begin(),ar.end());ar.erase(unique(ar.begin(),ar.end()),ar.end());}
llint gcd(llint a,llint b){if(a%b==0){return b;}else{return gcd(b,a%b);}}
llint lcm(llint a,llint b){return a/gcd(a,b) *b;}
template<class T,class U> auto LB(T& ve,U in){return lower_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto UB(T& ve,U in){return upper_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto LBI(T& ve,U in){return LB(ve,in)-ve.begin();}
template<class T,class U> auto UBI(T& ve,U in){return UB(ve,in)-ve.begin();}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
int main(void){
	int K,i;cin>>K;
	vector<llint>a(K);
	for(i=0;i<K;i++){cin>>a[i];}
	reverse(a.begin(),a.end());
	if(a[0]!=2){cout<<-1<<endl;RE;}
	llint mina=2,maxa=2;
	for(i=1;i<K;i++){
		llint A=a[i];
		llint smin=A*((mina+A-1)/A),smax=A*((maxa+a[i-1]-1)/A);
		if(smax<smin){cout<<-1<<endl;RE;}
		mina=smin;maxa=smax;
	}
	maxa=maxa+a[i-1]-1;
	cout<<mina<<" "<<maxa<<endl;
}

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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int func(int n){
    int res = n%10;
    while(n/10 != 0){
        n /= 10;
        res += n%10;
    }
    return res;
}
int main(){

    int n, a, b;
    cin >> n >> a >> b;

    int ans = 0;
    for(int i = 1; i <= n; i++){
        int v = func(i);
        if((v >= a) && (v <= b)) {
            ans += i; 
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3620
main = do
    s <- getLine
    let x01 = solve01 s
    let x10 = solve10 s
    print $ min x01 x10

solve01 :: String -> Int
solve01 [] = 0
solve01 (x:xs) =
    let f = if (x=='0')
                then succ
                else id
    in f $ solve10 xs

solve10 :: String -> Int
solve10 [] = 0
solve10 (x:xs) =
    let f = if (x=='1')
                then succ
                else id
    in f $ solve01 xs



Measured memory_bytes: 7548
#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5;
int T;
int dp[mxn+5];
int a[mxn+5];

int fn(int pos){
    if(pos==T-1) return 0;
    if(pos>=T) return 1<<30;
    if(dp[pos]!=-1) return dp[pos];
    return dp[pos] = min( fn(pos+1)+abs(a[pos]-a[pos+1]) , fn(pos+2)+abs(a[pos]-a[pos+2]) );
}

void solve(){

    cin>>T;
    memset(dp,-1,sizeof(dp));
    for(int i=0; i<T; i++)
        cin>>a[i];

    cout<<fn(0)<<"\n";

}

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




Measured memory_bytes: 2560
#include<iostream>
using namespace std;
int main(){
	int a,b,c;
	
	cin>>a>>b>>c;
	if(a<=b && a<=c){
		if(b<=c)
			cout<<a<<" "<<b<<" "<<c<<"\n";
		else if(c<=b)
			cout<<a<<" "<<c<<" "<<b<<"\n";
	}
	else if(b<=a && b<=c){
		if(a<=c)
			cout<<b<<" "<<a<<" "<<c<<"\n";
		else if(c<=a)
			cout<<b<<" "<<c<<" "<<a<<"\n";
	}
	else if(c<=b && c<=a){
		if(a<=b)
			cout<<c<<" "<<a<<" "<<b<<"\n";
		else if(b<=a)
			cout<<c<<" "<<b<<" " <<a<<"\n";
	}
}

Measured memory_bytes: 1164
#pragma region template 1.2
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> ii;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define OUT(x) cout << (x) << endl;
#define OUTA(a) \
    REP(i, (a).size()) { cout << (a[i]) << (i == (a).size() - 1 ? "\n" : " "); }
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

ll N;
vi A;
map<ii, ll> dp;

ll f(ll i, ll k)
{
    ii p = ii(i, k);
    if (dp.find(p) != dp.end())
    {
        return dp[p];
    }
    if (k == 0)
    {
        return 0;
    }
    if (2 * k - 1 == i)
    {
        dp[p] = f(i - 2, k - 1) + A[i - 1];
        return dp[p];
    }
    dp[p] = max(f(i - 1, k), f(i - 2, k - 1) + A[i - 1]);
    return dp[p];
}

int main()
{

    cin >> N;
    A = vi(N);
    REP(i, N)
    {
        cin >> A[i];
    }

    ll ans = f(N, N / 2);
    OUT(ans);
}

Measured memory_bytes: 32768
def 一日経過(n):
    return n+1
    
D=int(input())
C=list(map(int,input().split()))
S=[]
last=[0 for i in range(26)]
for i in range(D):
    s=list(map(int,input().split()))
    S.append(s)
for i in range(D):
    last=list(map(一日経過,last))
    max_score=0
    for j in range(26):
        a=0
        last_kari=last
        last_kari[j]=0
        a+=S[i][j]
        for k in range(26):
            a-=C[k]*last_kari[k]
        if a>max_score:
            max_score=a
            Ans=j
    last[Ans]=0
    print(Ans+1)

Measured memory_bytes: 9540
require 'set'

def check(arr)
  arr[1..8].all?{|i| arr[0] == i} &&
  arr[10..11].all?{|i| arr[9] == i} &&
  arr[13..14].all?{|i| arr[12] == i} &&
  arr[16..17].all?{|i| arr[15] == i} &&
  arr[19..20].all?{|i| arr[18] == i} &&
  arr[22..29].all?{|i| arr[21] == i} 
end

MV = [[0,1,2,14,18,27,28,29,15,20],
      [6,7,8,12,9,21,22,23,17,11],
      [0,3,6,9,15,23,26,29,20,17],
      [2,5,8,11,12,21,24,27,18,14]]
  
gets.to_i.times do
  cube = gets.split(" ").map(&:to_i)
  s = Set.new(cube)
  q = []
  q << [cube, 0]
  until q.empty?
    tmp, cnt = q.shift
    if check(tmp)
      p cnt
      break
    end
    MV.each do |arr|
      tmp2 = tmp.dup
      arr[0,5].zip(arr[5,5]).each do |a, b|
        tmp2[a], tmp2[b] = tmp2[b], tmp2[a]
      end
      unless s.include?(tmp2)
        q << [tmp2, cnt+1] 
        s.add(tmp2)
      end
    end
  end
end

Measured memory_bytes: 9276
def eratosthenes(n: int) -> list:
    is_prime = [True] * (n + 1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, n // 2 + 1):
        if is_prime[i]:
            for j in range(2, n // i + 1):
                is_prime[i * j] = False
    return is_prime


x = int(input())
is_prime = eratosthenes(x * 2 + 100)
ans = x
while not is_prime[ans]:
    ans += 1
print(ans)


Measured memory_bytes: 4596
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> PA;
typedef priority_queue<int, vector<int>, greater<int> > PQG;
#define REP(i, a, n) for(ll i = (ll) a;i < (ll) n;i++)
#define fi first
#define se second
#define pb push_back
#define INF 1000000009
#define MOD 1000000007
#define MAXN 200005
#define MAXM 200005
#define MAXV 1000000009

int n, m;
vector<int> G[MAXM];

int main()
{
    cin >> n >> m;
    REP(i, 0, m){
        int a, b;
        cin >> a >> b;
        G[a].pb(b);
        G[b].pb(a);
    }
    REP(i, 0, G[1].size()){
        REP(j, 0, G[G[1][i]].size()){
            //printf("%d\n", G[G[1][i]][j]);
            if(G[G[1][i]][j] == n){
                printf("POSSIBLE\n");
                return 0;
            }
        }
    }
    printf("IMPOSSIBLE\n");



    return 0;
}
/*
*/





Measured memory_bytes: 12016
use proconio::input;

#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::ops::*;

#[derive(Clone, Debug, Default)]
struct Struct;

//#[proconio::fastout]
fn main() {
    input! {
        s: Bytes,
        nq: usize,
    }

    let mut reversed = false;
    let mut head = VecDeque::new();
    let mut tail = Vec::new();
    for _ in 0..nq {
        input! { t: usize }
        if t == 1 {
            reversed = !reversed;
        } else {
            input! {
                f: usize,
                c: Bytes,
            }
            if f == 1 && !reversed || f == 2 && reversed {
                head.push_front(c[0]);
            } else {
                tail.push(c[0]);
            }
        }
    }

    let it = head
    .iter()
    .chain(s.iter())
    .chain(tail.iter());
    let mut s: Vec<u8> = it
        .map(|&x| x)
        .collect();
    if reversed {
        s.reverse();
    }
    println!("{}", String::from_utf8(s).unwrap());
}


Measured memory_bytes: 3976
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define sz(x) x.size()
#define rep(n) for (ll i = 0; i < n; i++)
#define repc(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, x, y) for (ll i = x; i < y; i++)
#define DEC(i, x, y) for (ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define alla(a, n) a, a + n
using namespace std;
 
// Some typedef's
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef vector<ll> vlli;
typedef vector<ii> vii;
 
template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
 
ll lcm(ll a, ll b) { return (a * (b / __gcd(a, b))); }
 
// Some contants
const ll inf = 1e12 + 7;
const double eps = 1e-9;
const long double pi = 1.00 * acos(-1.00);
 
vi inp , aux;
vi::iterator it;

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

    int x;
    cin >> x;

    int ans;
    if(360%x==0){
        ans = 360/x;
    }else{
        int rem = 360%x;
        ans = (360/rem)*(360/x);
    }
    cout << ans << endl;


    return 0;
 
 
}


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

int main() {
  int K;
  cin >> K;
  vector<int> A = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
              1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

  cout << A[K - 1] << endl;
  return 0;
}

Measured memory_bytes: 256
// {{{
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
// }}}

using ll = long long;

int main() {
    int a, b;
    cin >> a >> b;
    if (a + b == 15) {
        cout << "+" << endl;
    } else if (a * b == 15) {

        cout << "*" << endl;
    } else {
        cout << "x" << endl;
    }



    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define fi first
#define se second
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

int main(){
    ll N;
    cin >> N;
    vector<ll> a(N);
    bool flag = 0;
    rep(i,N){
        cin >> a[i];
        if(a[i]%2 == 1){
            flag = 1;
        }
    }
    cout << (flag?"first":"second") << endl;
}

Measured memory_bytes: 3980
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long
using namespace std;
int main(){ 
  ll h,w;
  cin >>h>>w;
  if(h==1||w==1){
    cout <<1<<endl;
  }else{
 cout <<(h*w+1)/2<<endl;
  }
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String S = sc.nextLine();
    int w = 0, b = 0;
    for(int i = 0; i < N; i++){
      if(S.charAt(i) == '.'){
        w++;
      }
    }
    
    int ans = w;
    for(int i = 0; i < N; i++){
      if(S.charAt(i) == '#'){
        b++;
      }else{
        w--;
      }
      ans = Math.min(ans, b+w);
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 28088
main=do
 n<-readLn
 a<-words<$>getLine
 let o=[b|(b,i)<-zip a[1..],odd i]
 let e=[b|(b,i)<-zip a[1..],even i]
 putStrLn$unwords$if odd n then (reverse o)++e else (reverse e)++o

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

int S[1000];
int top = 0;

int pop() {
	top--;
	return S[top + 1];
}

void push(int x) {
	S[++top] = x;
}


int main() {
	char s[100];
	int a, b;

	while (scanf("%s", &s) != EOF){
		if (s[0] == '+') {
			a = pop();
			b = pop();
			push(a + b);
		} else if(s[0] == '*'){
			a = pop();
			b = pop();
			push(a * b);
		}
		else if (s[0] == '-') {
			a = pop();
			b = pop();
			push(b - a);
		} else {
			push(atoi(s));
		}
	}

	printf("%d\n", pop());

	return 0;
}


Measured memory_bytes: 2040
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <tuple>
#include <complex>
#include <cassert>
#include <exception>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << "\n"
static const int INF = 1e+18+7;
int n,m,l;
int p;
string s,t;
ll d[200010],dp[300][300];
char field[200][200];

int main(){
  cin >> n;
  lep(i,1,n){
    cin >> d[i];
    d[i] += d[i-1];
  }
  // lep(i,0,n)print(d[i]);
  ll ans = INF;
  rep(i,1,n){
    ans = min(ans,abs(2 * d[i] - d[n]));
  }
  print(ans);
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
  ll A, B, C;
  cin >> A >> B >> C;
  ll AB, BC, CA;
  AB = A*B; BC = B*C; CA = C*A;
  ll maxrec = min(A*B, min(B*C, C*A));
  ll ans = -1;
  if(maxrec == AB){
    if(C % 2 == 0) ans = 0;
    else ans = maxrec;
  }
  if(maxrec == BC){
    if(A % 2 == 0) ans = 0;
    else ans = maxrec;
  }
  if(maxrec == CA){
    if(B % 2 == 0) ans = 0;
    else ans = maxrec;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
MOD = 10**9+7

MAXN = N+5
fac = [1,1] + [0]*MAXN
finv = [1,1] + [0]*MAXN
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def comb(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

ans = 0
for i in range(N-K+1):
    c = comb(N-1-i,K-1)
    ans += (A[-i-1] - A[i]) * c
    ans %= MOD
print(ans)

Measured memory_bytes: 25492
#include <iostream>
#include <climits>
using namespace std;
const long long inf=LLONG_MAX;
int main()
{
    int n,a[405];
    long long dp[405][405];
    cin >> n;
    for (int i=1;i<=n;i++)
    {
        cin >> a[i];
    }
    for (int i=n;i>=1;i--)
    {
        for (int j=i;j<=n;j++)
        {
            if (i==j)
            {
                dp[i][j]=0;
            }
            else
            {
                long long s=0;
                dp[i][j]=inf;
                for (int k=i;k<=j;k++)
                {
                    s+=a[k];
                }
                for (int k=i;k<j;k++)
                {
                    dp[i][j]=min(dp[i][k]+dp[k+1][j]+s,dp[i][j]);
                }
            }
        }
    }
    cout << dp[1][n];
}

Measured memory_bytes: 1536
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>
#include <utility>

using namespace std;
typedef long long int ll;

int main(int argc, char const *argv[])
{
    string s;
    cin >> s;
    vector<char> c;
    for (ll i = 0; i < s.size(); i++)
    {
        if (s[i] == 'B')
        {
            if(!c.empty())
                c.erase(c.end() - 1);
        }
        else
        {
            c.push_back(s[i]);
        }
    }
    for (auto t : c)
    {
        cout << t;
    }
    cout << endl;
}

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

int main(){
    ll n,m; cin >> n >> m;
    vector<ll> d;
    ll sqm = sqrt(m);
    for(ll i = 1; i <= sqm; i++){
        if(m % i == 0){
            d.push_back(i);
            d.push_back(m/i);
        }
    }
    sort(d.begin(),d.end());
    ll ans = 1;
    for(int i = 0; i < d.size(); i++){
        if(m/d[i] < n) break;
        ans = d[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
S=input()
mae=int(S[:2])
ato=int(S[2:])

if (1<=mae<=12) and (1<=ato<=12):
  print('AMBIGUOUS')
elif (1<=mae<=12) and (not (1<=ato<=12)):
  print('MMYY')
elif (not (1<=mae<=12)) and (1<=ato<=12):
  print('YYMM')
else:
  print('NA')

Measured memory_bytes: 3060
from sys import stdin
import sys
import math

# A, B, C = [int(x) for x in stdin.readline().rstrip().split()]
S, W = [int(x) for x in stdin.readline().rstrip().split()]
# U = input().split()
# A, B = [str(x) for x in stdin.readline().rstrip().split()]
if S <= W:
    print("unsafe")
else:
    print("safe")
# print("YES")
# print("NO")


Measured memory_bytes: 9152
import sys

ERROR_INPUT = 'input is invalid'


def main():
    n = get_length()
    arr = get_array(length=n)

    bubbleLi = bubbleSort(li=arr.copy(), length=n)
    selectionLi = selectionSort(li=arr.copy(), length=n)

    print(' '.join(list(map(lambda c: c.card, bubbleLi))))
    print(checkStable(inp=arr, out=bubbleLi))
    print(' '.join(list(map(lambda c: c.card, selectionLi))))
    print(checkStable(inp=arr, out=selectionLi))
    return 0


def get_length():
    n = int(input())
    if n < 1 or n > 36:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n


def get_array(length):
    nums = input().split(' ')
    return [Card(n) for n in nums]


def bubbleSort(li, length):
    for n in range(length):
        for n in range(1, length - n):
            if li[n].num < li[n - 1].num:
                li[n], li[n - 1] = li[n - 1], li[n]

    return li


def selectionSort(li, length):
    for i in range(0, length - 1):
        min_index = i
        for j in range(i, length):
            if li[j].num < li[min_index].num:
                min_index = j

        if i != min_index:
            li[i], li[min_index] = li[min_index], li[i]

    return li


def checkStable(inp, out):
    small_num = out[0].num

    for n in range(1, len(out)):
        if out[n].num == small_num:
            if inp.index(out[n]) < inp.index(out[n - 1]):
                return 'Not stable'
        elif small_num < out[n].num:
            small_num = out[n].num
            continue

    return 'Stable'


class Card:
    def __init__(self, disp):
        li = list(disp)
        self.card = disp
        self.chara = li[0]
        self.num = int(li[1])
        return


main()

Measured memory_bytes: 5620
import System.IO

toI :: String -> Int
toI = read

main = do
    a <- getLine
    b <- getLine
    c <- getLine
    d <- getLine
    p <- getLine
    let x = (toI a) * (toI p)
    let y = if (toI p) < (toI c) then (toI b) else (toI b) + ((toI p) - (toI c)) * (toI d)
    print $ if x < y then x else y

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

// 基本テンプレート
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// 型
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// 定数
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion


int main()
{
    string s, t, u;
    cin >> s >> t >> u;
    cout << "A" << t[0] << "C" << endl;
}



Measured memory_bytes: 764
#include<bits/stdc++.h>
const int N=200007;
int a[N],n,m;
bool chk(int x){
	int tm=a[m]<=x,tl=a[m-1]<=x,tr=a[m+1]<=x;
	if(tm==(tm+tl+tr>>1))return tm;
	for(int pl=m-1,pr=m+1;;--pl,++pr){
		if(pl<1)return a[1]<=x;
		if((a[pl]<=x)==(a[pl-1]<=x))return a[pl]<=x;
		if((a[pr]<=x)==(a[pr+1]<=x))return a[pr]<=x;
	}
}
int main(){
	scanf("%d",&m);
	n=m*2-1;
	for(int i=1;i<=n;++i)scanf("%d",a+i);
	int L=1,R=n,M;
	while(L<R)chk(M=L+R>>1)?R=M:(L=M+1);
	printf("%d",L);
	return 0;
}

Measured memory_bytes: 1024
package main

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

const (
	BUFSIZE   = 10000000
	MOD       = 1000000007
	INF_INT   = math.MaxInt32
	INF_INT64 = math.MaxInt64
)

var rdr *bufio.Reader

func main() {
	rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
	solve()
}

func solve() {
	A := readint()
	B := readint()

	fmt.Println(6 - A - B)
}

func readline() string {
	buf := make([]byte, 0, BUFSIZE)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			fmt.Println(e.Error())
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func readIntSlice(size int) []int {
	slice := make([]int, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i(v)
	}
	return slice
}

func readInt64Slice(size int) []int64 {
	slice := make([]int64, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i64(v)
	}
	return slice
}

func readint() int {
	return s2i(readline())
}

func readint64() int64 {
	return s2i64(readline())
}

// For int64
func b2i64(b bool) int64 {
	if b {
		return 1
	}
	return 0
}

func abs64(v int64) int64 {
	if v < 0 {
		return -v
	}
	return v
}

func min64(values ...int64) int64 {
	ret := int64(INF_INT64)
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max64(values ...int64) int64 {
	ret := -int64(INF_INT64)
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i64(s string) int64 {
	v, ok := strconv.ParseInt(s, 10, 64)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int64")
	}
	return v
}

// For int
func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

func abs(v int) int {
	if v < 0 {
		return -v
	}
	return v
}

func min(values ...int) int {
	ret := INF_INT
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max(values ...int) int {
	ret := -INF_INT
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i(s string) int {
	v, ok := strconv.Atoi(s)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int")
	}
	return v
}

/* ------------------------------------------------ */
/* Data stracture                                   */
/* ------------------------------------------------ */
type IntHeap []int

func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }


Measured memory_bytes: 12316
#include <stdio.h>

int main(){
  double x1,x2,x3,y1,y2,y3,xp,yp;
  double ab[2],ac[2],ap[2];
  double alpha, beta;
  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) != EOF){
    ab[0] = x2 - x1;
    ab[1] = y2 - y1;
    ac[0] = x3 - x1;
    ac[1] = y3 - y1;
    ap[0] = xp - x1;
    ap[1] = yp - y1;

    alpha = (ap[0]*ac[1]-ac[0]*ap[1])/(ab[0]*ac[1]-ac[0]*ab[1]);
    beta =  (ap[0]*ab[1]-ab[0]*ap[1])/(ac[0]*ab[1]-ab[0]*ac[1]);
    if(alpha+beta<=1 && alpha >= 0 && beta >=0){
      printf("YES\n");
    }else{
      printf("NO\n");
    }
  }
  return 0;
}
    

Measured memory_bytes: 612
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	String str = sc.next();
      	Integer cnt = 0;
      	Integer tmp = 0;
		for(int i=0; i < str.length(); i++){
          char C = str.charAt(i);
          if(C=='A'){
			tmp++;
            continue;
          }
          if(C=='G'){
			tmp++;
            continue;
          }
          if(C=='C'){
			tmp++;
            continue;
          }
          if(C=='T'){
			tmp++;
            continue;
          }
          if(tmp > cnt){
            cnt = tmp;
          }  
          tmp = 0;
        }
      	if(tmp > cnt){
            cnt = tmp;
        }  
		System.out.println(cnt);
      	return;
	}
}


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

int main() {
    int a, b;
    double c1, c2;
    cin >> a >> b;
    c1 = (a + b) / 2;
    c2 = (a + b - 1) / 2;
    if (c1 == c2){
        c1++;
    }
    cout << c1 << endl;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair

/*int P[10010];
void init(int n){//Union-find
    for(int i=0;i<n;++i)P[i]=i;
}
int root(int a) {
    if(P[a]==a)return a;
    return (P[a]=root(P[a]));
}
bool is_same_set(int a,int b){
    return root(a) == root(b);//代表元を求める
}
void unite(int a,int b){
    P[root(a)]=root(b);
}//対set,グラフ？
//セグメント木？？
*/

double dot_product(xy_t a, xy_t b) { return (conj(a)*b).real(); }//内積
double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }//外積
xy_t projection(xy_t p, xy_t b) { return b*dot_product(p,b)/norm(b); }//投影
//対図形

#define mod 1000000007
/*ll f[2001];
//int n,k とかしておく

ll pw(ll x, ll y){//euclidの互除法より
    ll a= 1;
    while(y){
        if(y&1){//奇数なら
            a = a*x%mod;
        }
        x = x*x%mod;
        y /= 2;
    }
    return a;
}

ll modinv(ll x){//逆元を求める
    return pw(x, mod - 2 );
}

ll comb(int n,int r){
    if(n<r){
        return 0;
    }
    return f[n] * modinv(f[r])%mod*modinv(f[n-r])%mod;
}//対combination//ただしfは用意してね
*/


/*
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
*/

//cerrはコメントアウトしなくても通る
vector<int> a;
int cnt=1;

void q(){
    a.push_back(2);
    for(int i=3;i<55555;i++){
        if(i%10==1){
            bool ok=1;
            for(int j=3;j<i;j+=2){
                if(i%j==0)ok=0;
            }
            if(ok){
                a.push_back(i);
            }
        }
    }
}

int main(){
    int n;
    cin >> n;
    q();
    cerr<<"数"<<a.size()<<endl;
    rep(i,n){
        cout<<a[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 256