akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1e18) + 1;

int main(void)
{
    int n;
    int i, j;
    bool flag = false;

    cin >> n;

    rep(i, 1, 10)
    {
        rep(j, 1, 10)
        {
            if (n == i * j)
            {
                flag = true;
            }
        }
    }

    if (flag)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
/*
 * a.c
 *
 *  Created on: 2017/06/13
 *      Author: AWV060608
 */

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

#define		MXHAIRETUSU		100

int		main(void)
{
	int		n, m;
	int		i,j;
	int		a[MXHAIRETUSU][MXHAIRETUSU]={0};
	int		b[MXHAIRETUSU];
	int		c;

	scanf("%d",&n);
	scanf("%d",&m);

	for(i=0; i<n; i++)
	{
		for(j=0; j<m; j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(i=0; i<m; i++)
	{
		scanf("%d",&b[i]);
	}

	for(i=0; i<n; i++)
	{
		c=0;
		for(j=0; j<m; j++)
		{
			c = a[i][j]*b[j] + c;
		}
		printf("%d\n",c);
	}

	return 0;
}

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

struct TCard
{
    char Suit;
    int  Num;
    bool operator==(const TCard& C)const
    {
        return Suit == C.Suit;// && Num == C.Num;
    }
    bool operator <(const TCard& C)const
    {
      return Num < C.Num;
    }
    bool operator <=(const TCard& C)const
    {
        return Num <= C.Num;
    }
};
typedef std::vector<TCard> TList;

int partition(TList& A, int p, int r)
{
  int i = p - 1;
  for(int j = p; j < r; ++j){
    if(A[j] <= A[r]){
      i = i + 1;
      std::swap(A[i],A[j]);
    }
  }
  std::swap(A[i+1],A[r]);
  return i+1;
}

void quickSort(TList& A, int p, int r)
{
  if(p < r){
    int q = partition(A, p, r);
    quickSort(A, p, q-1);
    quickSort(A, q+1, r);
  }
}
TList Input()
{
    int Count;
    std::cin >> Count;
    TList List(Count);
    for(int i = 0; i < Count; ++i){
        std::cin >> List[i].Suit;
        std::cin >> List[i].Num;
    }
    return List;
}
void Output(const TList& List)
{
    TList::const_iterator It = List.begin();
    std::cout << It->Suit << " " << It->Num;
    for(++It; It != List.end(); ++It){
        std::cout << "\n" << It->Suit << " " << It->Num;
    }
    std::cout << std::endl;
}
void Check(const TList& List, const TList& Stable)
{
    if(std::equal(List.begin(), List.end(), Stable.begin())){
        std::cout << "Stable" << std::endl;
    }else{
        std::cout << "Not stable" << std::endl;
    }
}

int main()
{
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    const TList List = Input();
    TList StableList = List;
    std::stable_sort(StableList.begin(), StableList.end());

    TList QuickList = List;
    quickSort(QuickList, 0, QuickList.size() - 1);
    Check(QuickList, StableList);
    Output(QuickList);
    return 0;
}

Measured memory_bytes: 5364
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=a;i--)
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;
int n,k,s,t,big=1e9;
int main(){
	cin>>n>>k>>s;
	if(s==big){
		t=s-1;
	}
	else{
		t=big;
	}
	rep(i,1,n){
		if(i<=k){
			printf("%d ",s);
		}
		else{
			printf("%d ",t);
		}
	}puts("");
	return 0;
}


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

int main(){
	
	string s; cin>>s;
	sort(s.begin(),s.end());
	if(s.at(1)!=s.at(2)){
		if(s.at(0)==s.at(1)&&s.at(2)==s.at(3)){
			cout << "Yes" << endl;
			return 0;
		}
		
	}
	cout << "No" << endl;
	
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <map>
using namespace std;

int main(){
  int n; cin >> n;
  bool *a = new bool[1000000000];
  int i;
  for(i = 0; i < n; i++){
    int x; cin >> x;
    if(a[x] == true){
      cout << "NO\n";
      return 0;
    }
    else a[x] = true;
  }
  if(i == n) cout << "YES\n";
  return 0;
}


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

int main(){
	int K, gu, ki;
	cin >> K;
	if(K % 2 == 1){
		ki = K / 2 + 1;	
		gu = K / 2;
	}else{
		gu = ki = K / 2;
	}
	cout << ki * gu;
	return 0;
}


Measured memory_bytes: 256
import java.util.*
import kotlin.math.*

fun str() = readLine()!!
fun int() = str().toInt()
fun long() = str().toLong()

fun read(d:String = " ") = str().split(d)
fun <T> list(d:String = " ",f:String.()->T) = read(d).map {f(it)}
fun list() = list {toInt()}

fun <T> MutableList<T>.removeLast() = this.removeAt(this.lastIndex)

const val mod = 998244353L

fun main() {
	abc000X()
}

fun abc000X() {
	val n = int()
	val t = list()
	val sum = t.sum()
	for(i in 1..int()) {
		val (p,x) = list()
		println(sum-t[p-1]+x)
	}
}


Measured memory_bytes: 37884
N = int(input())

A = list(map(int,input().split()))
B = list(map(int,input().split()))

ans = 0
for i,b in enumerate(B):
    t = min(b,A[i]+A[i+1])
    ans += t
    #A[i]を使いきったか否か
    A[i+1] -= max(0, t-A[i])
    
print(ans)

Measured memory_bytes: 18624
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Graph_I
{
    class Breadth_First_Search
    {

        static int[] dist;

        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var G = new bool[n][];
            dist = new int[n];

            for (int i = 0; i < n; i++)
            {
                var token = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
                var row = token[0] - 1;
                G[row] = new bool[n];
                for (int j = 0; j < token[1]; j++)
                    G[row][token[2 + j] - 1] = true;
            }

            var str = new StringBuilder();

            for (int i = 0; i < n; i++)
                str.Append(i + 1).Append(" ").Append(BreadthFirstSearch(G, i)).Append("\n");
            Console.Write(str.ToString());
        }

        static int BreadthFirstSearch(bool[][] graph, int destination)
        {
            if (dist[destination] != 0) return dist[destination];
            var n = graph.Length;
            var done = new bool[n];
            var queue = new Queue<int>();

            done[0] = true;
            dist[0] = 0;
            queue.Enqueue(0);

            while (queue.Count > 0)
            {
                var r = queue.Dequeue();
                if (r == destination) return dist[r];
                for (int i = 0; i < n; i++)
                {
                    if (graph[r][i] && !done[i])
                    {
                        done[i] = true;
                        dist[i] = dist[r] + 1;
                        queue.Enqueue(i);
                    }
                }
            }

            return -1;

        }
    }
}

Measured memory_bytes: 10508
#include<iostream>
#include<vector>
#define MAX 1e7
using namespace std;

int main(){
  int n, m;
  while(std::cin >> m >> n){
    vector<bool> isBoring(MAX, false);
    if(n == 0 and m == 0)break;
    int mini = m;
    for (int i = 0; i < n; i++) {
      while(isBoring[mini] == true) mini++;
      for (int j = mini; j < MAX; j+=mini) {
        isBoring[j] = true;
      }
    }
    int ans = 0;
    while(isBoring[ans] == false)ans++;
    while(isBoring[ans] == true)ans++;
    std::cout << ans << std::endl;
  }
  return 0;
}

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

int main(void) {
  int N, L, T;
  vector<int> X, W;
  
  cin >> N >> L >> T;
  X.resize(N);
  W.resize(N);
  for (int i = 0; i < N; i++) cin >> X[i] >> W[i];
  
  vector<int> tmp(N);
  for (int i = 0; i < N; i++) {
    if (W[i] == 1) tmp[i] = (X[i] + T) % L;
    else tmp[i] = ((X[i] - T) % L + L) % L;
  }
  
  sort(tmp.begin(), tmp.end());
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (W[i] == 1) count -= (T - (L - X[i]) + L) / L;
    else count += (T- (X[i]+1) + L) / L;
  }
  
  count = (count % N + N) % N;
  vector<int> res(N);
  for(int i = 0; i < N; i++) res[(i+count)%N] = tmp[i];
  for(int i = 0; i < N; i++) cout << res[i] << endl;
}

Measured memory_bytes: 2816
#include <stdio.h>

void init(int data[22][22],int w,int h){
	for(int i = 0;i < w+2;i++){
		data[0][i] = 1;
		data[h+1][i] = 1;
	}
	for(int i = 0;i < h;i++){
		data[i+1][0] = 1;
		data[i+1][w+1] = 1;
	}
}

void show(int data[22][22],int w,int h){
	for(int i = 0;i < h+2;i++){
		for(int j = 0;j < w+2;j++){
			printf("%d",data[i][j]);
		}
		printf("\n");
	}
}

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

void count(int data[22][22],int sx,int sy){
	for(int i = 0;i < 4;i++){
		if(data[sy+dy[i]][sx+dx[i]] == 0){
			ans++;
			data[sy+dy[i]][sx+dx[i]] = 2;
			count(data,sx+dx[i],sy+dy[i]);
		}
	}
}

int main(){
	int W,H,sx,sy;
	int data[22][22];
	char str[21];

	while(1){
		scanf("%d %d",&W,&H);
		if(W == 0 && H == 0){
			break;
		}

		init(data,W,H);
		for(int i = 0;i < H;i++){
			scanf("%s",str);
			for(int j = 0;j < W;j++){
				if(str[j] == '.'){
					data[i+1][j+1] = 0;
				}else if(str[j] == '#'){
					data[i+1][j+1] = 1;
				}else if(str[j] == '@'){
					data[i+1][j+1] = 2;
					sy = i+1;
					sx = j+1;
				}
			}
		}
		//show(data,W,H);

		ans = 1;
		count(data,sx,sy);

		printf("%d\n",ans);
	}

	return 0;
}

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

namespace competitive_programming
{
    class Program
    {
        static void Main(string[] args)
        {
            var main = new Program();
            main.solve();
        }

        void solve()
        {
            long N = long.Parse(Console.ReadLine());
            long[] strength = Console.ReadLine().Split(' ').Select(val => long.Parse(val)).ToArray();
            Array.Sort(strength);
            Array.Reverse(strength);
            long score = 0;
            for(int i = 1;i < 2 * N;i += 2)
            {
                score += strength[i];
            }

            Console.WriteLine(score);
        }
    }

    struct Vector2
    {
        public Vector2(long x, long y)
        {
            this.x = x;
            this.y = y;
        }
        public long x;
        public long y;
    }

    struct Vector3
    {
        public int x;
        public int y;
        public int z;
    }
}


Measured memory_bytes: 47940
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int Maxn=100005;
int a[Maxn];
ll p[Maxn];
vector<int>pos;
void solve(int l,int r,int s){
	if(s<=a[l])return pos.push_back(a[r]);
	if(s>=a[r])return pos.push_back(a[l]);
	if(p[l]>=p[r]){
		p[l]+=p[r];
		solve(l,r-1,s);
		pos.push_back(a[r]);
	}else{
		p[r]+=p[l];
		solve(l+1,r,s);
		pos.push_back(a[l]);
	}
}
int main(){
	int n,s;scanf("%d%d",&n,&s);
	for(int i=1;i<=n;i++)scanf("%d%d",&a[i],&p[i]);
	solve(1,n,s);
	ll ans=0;
	for(int x:pos)ans+=abs(s-x),s=x;
	cout<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 4604
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a<b and v<=w:
    print("NO")
elif a>b and v<=w:
    print("NO")
elif a<b:
    if -((a-b)//(v-w))<=t:
        print("YES")
    else:
        print("NO")
else:
    if -((-a+b)//(v-w))<=t:
        print("YES")
    else:
        print("NO")

Measured memory_bytes: 9160
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
using namespace std;
vector<string> c;
map<string,int> s;
int main(void)
{
  string str;
  while(cin >> str){
    s[str]++;
    if(s[str]==1) c.push_back(str);
  }
  int fbest=0,lbest=0;
  for(int i=1;i<c.size();i++){
    if(s[c[fbest]]<s[c[i]])fbest=i;
    if(c[lbest].size()<c[i].size())lbest=i;
  }
  cout << c[fbest] << " " << c[lbest] << endl;
}

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

#include<cstdio>
#define r(i,n) for(int i=0;i<n;i++)


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


Measured memory_bytes: 256
import sys

X = int(input())
# 例外処理
if X < 400 or X >= 2000:
    print("error") 
    sys.exit()

# 級の境界値とXを比較
for score, kyu in zip(reversed(range(400, 2000, 200)), range(1, 9)):
    if X >= score:
        print(kyu)
        break

Measured memory_bytes: 9124
#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    char buf[4];
    cin >> buf;
  
  	bool flg = true;
  
  	for (int i=0; i<3; i++) {
       if (buf[i] == buf[i+1]) flg = false;
    }
  	
    // 出力
    if (flg)
	    cout << "Good" << endl;
    else
        cout << "Bad" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int int_Tran(char t){
	return (t-'A')+10;
}

int main(){
	
	char X,Y;
	//while(cin>>X>>Y){
		cin>>X>>Y;
		int x = int_Tran(X);
		int y = int_Tran(Y);
		if(x>y){
			cout<<'>'<<endl;
		}
		else if(x<y){
			cout<<'<'<<endl;
		}
		else{
			cout<<'='<<endl;
		}
	//}
	return 0;
} 


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

def main():
    M, D = map(int, input().split())
    count = 0
    for month in range(4,M+1):
        for day in range(20,D+1):
            d10 = int(day / 10)
            d = day - d10 * 10
            if d >= 2 and d * d10 == month:
                count += 1
    print(count)


if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
n = input()
km = int(input())
dp1 = [[0] * (4) for _ in range(len(n) + 1)]
dp2 = [[0] * (4) for _ in range(len(n) + 1)]
dp1[0][0] = 1
for i in range(len(n)):
    for j in range(4):
        # i+1桁目に0が入る場合
        if n[i] == '0':
            dp1[i + 1][j] += dp1[i][j]
            dp2[i + 1][j] += dp2[i][j]
        else:
            dp2[i + 1][j] += dp1[i][j]
            dp2[i + 1][j] += dp2[i][j]
        if j < 3:
            for k in range(1, ord(n[i]) - ord('0')):
                dp2[i + 1][j + 1] += dp1[i][j]
            if n[i] != '0':
                dp1[i + 1][j + 1] += dp1[i][j]
            for k in range(1, 10):
                dp2[i + 1][j + 1] += dp2[i][j]
print(dp1[len(n)][km] + dp2[len(n)][km])

Measured memory_bytes: 3064
from collections import deque

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
ans = [0 for _ in range(n)]

explored = {0}

for _ in range(m):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

q = deque()
parent = 0
for k in graph[0]:
    ans[k] = 0
    q.append(k)
    explored.add(k)
ans[0] = 0
while len(q) != 0:
    now = q.popleft()
    parent = now
    for node in graph[now]:
        if node not in explored:
            q.append(node)
            ans[node] = parent
            explored.add(node)

print('Yes')
for i in range(1, n):
    print(ans[i]+1)

Measured memory_bytes: 40024
def main():
  N = int(input())
  INF = float('inf')
  A = [(i+1, a) for i, a in enumerate(map(int, input().split()))]
  A = sorted(A, key=lambda x: x[1], reverse = True)

  dp = [[-INF] * (N+1) for _ in range(N+1)]
  dp[0][0] = 0

  for s in range(1, N+1):
    for l in range(s+1):
      r = s - l
      dp[l][r] = max(dp[l-1][r] + A[s-1][1] * abs(A[s-1][0]-l), dp[l][r-1] + A[s-1][1] * abs(N-r+1-A[s-1][0]))
    
  ans = 0
  for m in range(N):
    if(dp[m][N-m] > ans):
      ans = dp[m][N-m]
    
  print(ans)

main()

Measured memory_bytes: 136152
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define OUT(x) cout << #x << " = " << x << endl; 
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

int deg[110];

void init(void){
	rep(i, 110) deg[i] = 0;
}

int main(void){
	int a, b;
	while(cin >> a >> b){
		if(a == 0 && b == 0){
			bool flag = true;
			reps(i, 3, 110){
				if(deg[i] % 2) flag = false;
			}
			if(deg[1] % 2 == 0) flag = false;
			if(deg[2] % 2 == 0) flag = false;
			if(flag) printf("OK\n");
			else printf("NG\n");
			init();
		}else{
			deg[a]++, deg[b]++;
		}
	}
	return 0;
}

Measured memory_bytes: 3020
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, a, b) for(int i = a, i##_len = (b); i < i##_len; ++i)

const int MAX_N = 202000;
size_t N, K;
int p[MAX_N], acum[MAX_N];

int main()
{
    scanf("%zu %zu", &N, &K);
    for (size_t i = 1; i <= N; i++)
    {
        scanf("%d", &p[i]);
    }
    
    for (size_t i = 0; i <= N; i++)
    {
        acum[i] += p[i];
        acum[i+1] += acum[i];
    }
    
    int max_sum = -1;
    for (size_t i = 1; i <= N - K + 1; i++)
    {
        max_sum = max(max_sum, acum[i+(K-1)] - acum[i-1]);
    }
    printf("%.10lf\n", double(max_sum + (int)K)/2.0);
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define ii pair<int,int>
#define MAX 1000000007

using namespace std;

int main(void){
	ll n,x;
	cin>>n>>x;
	ll pos[n];

	rep(i,n){
		ll tmp;
		cin>>tmp;
		pos[i]=abs(tmp-x);
	}
	sort(pos,pos+n);

	int res=n;
	int cid=0,cmin=pos[0],nid=-1,nmin=MAX;
	while(res>1){
		rep(i,n){
			if(i!=cid){
				pos[i]=pos[i]%pos[cid];
				if(pos[i]==0)res--;
				else if(nmin > pos[i]){
					nid=i;
					nmin=pos[i];
				}
			}
		}
		cid=nid;
		cmin=nmin;
		nid=-1;
		nmin=MAX;
	}
	rep(i,n){
		if(pos[i]!=0)cout<<pos[i]<<endl;
	}

	return 0;

}


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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = (1 << 30) - 1;
const long long LLINF = 1LL << 61;
const long long MOD = 1000000007LL;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

bool comp(int &a, int &b){
    return a % 10 < b % 10;
}

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

    vector<int> v(5);
    rep(i, 5){
        cin >> v[i];
    }
    sort(v.begin(), v.end(), comp);

    int j = 0;
    while(j < 5 && v[j] % 10 == 0){
        ++j;
    }

    if(j < 5){
        swap(v[j], v[4]);
    }

    int ans = 0;
    rep(i, 5){
        ans = ans / 10 * 10 + 10;
        ans += v[i];
    }
    ans -= min(j + 1, 5) * 10;

    cout << ans << endl;

    return 0;
}

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

typedef long long ll;
int q;
ll a, b;

int main() {
    scanf("%d", &q);
    while (q--) {
        scanf("%lld %lld", &a, &b);
        if (a == b) {
            printf("%lld\n", 2 * (a - 1));
        } else {
            ll t = sqrt(a * b);
            if (t * t == a * b) t--;
            if (t * (t + 1) < a * b) printf("%lld\n", 2 * t - 1);
            else printf("%lld\n", 2 * (t - 1));
        }
    }
    return 0;
}

Measured memory_bytes: 256
void main() {
	while(true) {
		auto ip = readAs!(int[]), H = ip[0], W = ip[1];
		if(H == 0 && W == 0) return;
		foreach(i; 0..H) {
			bool flag = i & 1;
			foreach(j; 0..W) {
				if(flag) {
					if(j & 1) write('#');
					else write('.');
				} else {
					if(j & 1) write('.');
					else write('#');
				}
			}
			writeln;
		}
		writeln;
	}
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}



Measured memory_bytes: 2496
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
string s;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> s;
  int a = sz(s);
  uniq(s);
  int b = sz(s);
  cout << (a==b ? "yes" : "no") << endl;
}

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

int main() {
	int s;
	cin >> s;

	// 時間の算出
	const int H = 3600;
	int h = s / H;
	int m = s - h * H;
	
	// 分の算出
	const int M = 60;
	m = m / M;
	s = s - h * H - m * M;

	cout << h << ':' << m << ':' << s << endl;
}


Measured memory_bytes: 3136
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        // ans: 二分木の頂点数の最大値(但し、深さiにA[i]個だけ葉がある)
        long ans = 0;
        
        // ・言い換え
        // 深さiにおける頂点数(count[i])の最大値を考える。
        // -> 上から見た時と下から見た時の
        
        // 下から見る時、count[i]はarray[i]個だけ増やせる
        // -> count[i] = arrayの後ろからの累積和。
        // 上から見る時、頂点数は葉を引いた2倍だけ増やせる
        // <- オーバーフローしそう。
        // -> 上から見るのを都度、下からのmaxでカットしてやる。
        
        int n = sc.nextInt();
        // array[i]: 深さiの葉の個数
        int[] array = new int[n+1];
        for (int i = 0; i < n+1; i++) {
            array[i] = sc.nextInt();
        }
        
        // sum[i]: 下から見たときのcount[i]の最大値
        long[] sum = new long[n+1];
        sum[n] = array[n];
        for (int i = n-1; i >= 0; i--) {
            sum[i] = sum[i+1] + array[i];
            
        }
        // System.out.println(Arrays.toString(sum));
        
        // count[i]: 深さiにおける頂点数
        long[] count = new long[n+1];
        long now = 1;
        for (int i = 0; i < n+1; i++) {
            count[i] = Math.min(sum[i], now);
            now = count[i] - array[i];
            if (now < 0) {
                System.out.println(-1);
                return;
            }
            now *= 2;
        }
        
        for (int i = 0; i < n+1; i++) {
            ans += count[i];
        }
        System.out.println(ans);
        
    }
}


Measured memory_bytes: 59028
use std::vec::Vec;
use std::cmp;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
  let (n, a, b, c) = {
    let v: Vec<i64> = read_vec();
    (v[0], v[1], v[2], v[3])
  };

  let mut l: Vec<i64> = Vec::new();

  for _ in 0..n {
    let e: i64 = read();
    l.push(e);
  }

  // println!("{:?}", dfs1(n-1, &l, (a, b, c), (0, 0, 0), 0));

  let mut v: Vec<i64> = vec![-1; n as usize];
  let mut ans: i64 = 100000;
  let mut count = 0;

  dfs2(n as usize, (a, b, c), &l, &mut v, &mut ans);
  println!("{}", ans);
}

// 愚直なdfsの実装
fn dfs1(n: i64, l: &Vec<i64>, a: (i64, i64, i64), e: (i64, i64, i64), cost: i64) -> i64 {
  if n == -1 {

    if e.0 > 0 && e.1 > 0 && e.2 > 0 {
      // ここで切断や延長のマジックポイントを計算している
      // 最初の一本目を選ぶときに
      // 二本以上ないのに合成魔法を使ってマジックポイントを30使っている
      return cost + (e.0 - a.0).abs() + (e.1 - a.1).abs() + (e.2 - a.2).abs() - 30;
    }
    else {
      return 100000;
    }
  }

  let ret1: i64 = dfs1(n - 1, &l, a, e, cost);
  let ret2: i64 = dfs1(n - 1, &l, a, (e.0 + l[n as usize], e.1, e.2), cost + 10);
  let ret3: i64 = dfs1(n - 1, &l, a, (e.0, e.1 + l[n as usize], e.2), cost + 10);
  let ret4: i64 = dfs1(n - 1, &l, a, (e.0, e.1, e.2 + l[n as usize]), cost + 10);

  return [ret1, ret2, ret3, ret4].iter().fold(std::i64::MAX, |acc, i| cmp::min(acc, *i))
}


//
fn dfs2(n: usize, an: (i64, i64, i64), l: &Vec<i64>, v: &mut Vec<i64>, cost: &mut i64) {
  if n == 0 {
    let mut a: i64 = 0;
    let mut ac: i64 = 0;
    let mut b: i64 = 0;
    let mut bc: i64 = 0;
    let mut c: i64 = 0;
    let mut cc: i64 = 0;

    for i in 0..v.len() as usize {
        match v[i] {
          0 => { a += l[i as usize]; ac += 1;},
          1 => { b += l[i as usize]; bc += 1;},
          2 => { c += l[i as usize]; cc += 1;},
          _ => {},
        }
    }

  if ac > 0 && bc > 0 && cc > 0 {
    let co: i64 = (a - an.0).abs() + (b - an.1).abs() + (c - an.2).abs() + 10 * (ac + bc + cc - 3);
    *cost = cmp::min(*cost, co);
  }
    return;
  }

  for i in 0..4 {
    v[n-1] = i;
    dfs2(n-1, an, l,  v, cost);
  }
}


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


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

   


Measured memory_bytes: 3104
///              B I S M I L L A H I R  R A H M A N I R  R A H I M

#include<bits/stdc++.h>
using namespace std;
typedef bool                   boo;
typedef int                    li;
typedef long                   il;
typedef unsigned long          ul;
typedef long long int          ll;
typedef unsigned long long     ull;
typedef double                 dd;
typedef string                 str;
#define vli                    vector<li>
#define vll                    vector<ll>
#define sli                    set<li>
#define sll                    set<ll>
#define pli                    pair<li, li>
#define pll                    pair<ll, ll>
#define vpi                    vector<pair<li, li>>
#define vpl                    vector<pair<ll, ll>>
#define mpl                    map<ll, ll>
#define wt                     ll t; cin>>t; while(t--)
#define input(a,n)             for(int i=0;i<n;i++) cin>>a[i];
#define lp(a, i, b)            for(ll i=a; i<b; i++)
#define rlp(a, i, b)           for(ll i=a; i>=b; i--)
#define sz(x)                  x.size()
#define len(z)                 z.begin(), z.end()
#define ci(x)                  cin>>x;
#define co(x)                  cout<<x nl
#define mem(z, l)              memset(z, l, sizeof(z))
#define MP                     make_pair
#define pb                     push_back
#define F                      first
#define S                      second
#define nl                     <<endl
#define nll                    cout<<endl
#define sp                     <<" "<<
#define sl                     <<" "
#define cy                     cout<<"YES"<<nl
#define cn                     cout<<"NO"<<nl
#define rn                     return
#define good_bye               return 0
#define PI                     3.1415926536
#define gcd(a,b)               __gcd(a,b)
#define lcm(a,b)               (a*(b/gcd(a,b)))
#define faster                 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define input_txt()            freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
const double eps=              1e-9;
const int inf=                 2000000000;
const ll infLL=                9000000000000000000;
//ll Pow(ll P, ll Q)           { ll R=1; for(ll I=1; I<=Q; I++) R*=P; rn R; }
//void dfs(ll K)               { vis[K]=true; for(auto J: v[K]) { if(!vis[J]) dfs(J); } }
//void seive(ll MX)            { S.pb(2); for(ll I=3; i<=MX; i+=2) { if(!vis[I]) { S.pb(I); for(ll J=I*I; j<=MX; J+=(2*I)) vis[J]=false; } } }
//bool isPrime(ll n)           { if(n%2==0) rn false; for(ll i=3; i*i<=n; i+=2) { if(n%i==0) rn false; } rn true; }
//----------------------------------------LET'S BEGIN-----------------------------------------------------------------------
const int mX = 1e6+123;
ll n;
dd l, x;
str s;

void case_i()
{
    ci(n);
    lp(0, i, n)
    {
        cin>>x>>s;
        if(s=="JPY") l+=x;
        else l+= x*380000.0;
    }
    co(fixed<<setprecision(4)<<l);
}

int main()
{
    faster;
//    input_txt();
//    wt
      case_i();
    good_bye;
}
///           _5_4_8_8_1_9_                ///



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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
    string s;cin >>s;
    ll k;cin >>k;
    ll n=s.size();
    ll now=0;
    for (int i = 0; i < n; ++i) {
        if(s[i]=='1')now++;
        else now+=INFll;
        if(now>=k){
            cout <<s[i]-'0'<<endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>

bool CheckMSPrime(int _n) {
	for (int i = 2; (i*i) <= _n;i++) {
		if (_n%i==0) {
			if (i % 7 == 1 || i % 7 == 6) {
				return false;
			}
		}
	}
	return true;
}

void PrintPrime(int _n) {
	printf("%d:", _n);
	for (int i = 2; i <= (_n/2);i++) {
		if (_n%i == 0) {
			if (i % 7 == 1 || i % 7 == 6) {
				if (CheckMSPrime(i) == true) {
					printf(" %d", i);
				}
			}

		}
	}
	if (_n % 7 == 1 || _n % 7 == 6) {
		if (CheckMSPrime(_n) == true) {
			printf(" %d", _n);
		}
	}
	printf("\n");
}

int main() {
	int n;
	while (true) {
		scanf("%d", &n);
		if (n==1) {
			break;
		}
		PrintPrime(n);
	}
	return 0;
}

Measured memory_bytes: 2584
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    s = input()
    for k in range(len(s)-1):
        if s[k] == s[k+1]:
            print(k+1,k+2)
            exit(0)

    if len(s) == 2:
        print("-1 -1")
        exit(0)

    for k in range(len(s)-2):
        if s[k] == s[k+2]:
            print(k+1,k+3)
            exit(0)
    print("-1 -1")

if __name__ == '__main__':
    main()


Measured memory_bytes: 39280
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
3 5
0 0 1
0 1 2
0 2 3
1 0 2
1 1 2

output:
1
2
"""

import sys
import math


class SegmentTree(object):
    __slots__ = ('dat', 'tree_range')

    def __init__(self, n):
        """
        Init a SegmentTree with update and find for range minimum queries.
        """
        self.tree_range = pow(2, math.ceil(math.log2(n)))
        self.dat = [float('inf')] * (2 * self.tree_range - 1)

    # let A[k]=a
    def update(self, k, a):
        k += self.tree_range - 1
        self.dat[k] = a
        while k > 0:
            k = (k - 1) // 2
            self.dat[k] = min(self.dat[k * 2 + 1], self.dat[k * 2 + 2])

    # get min(A[s] A[s+1] ... A[t])
    def find(self, s, t, k=0, l=0, r=float('inf')):
        if r <= s or t <= l:
            return float('inf')
        elif s <= l <= r <= t:
            return self.dat[k]
        else:
            vl = self.find(s, t, k * 2 + 1, l, (l + r) // 2)
            vr = self.find(s, t, k * 2 + 2, (l + r) // 2, r)
            return min(vl, vr)


def action(cmd_list):
    case = SegmentTree(n_num)
    end = pow(2, math.ceil(math.log2(n_num)))
    init_max = pow(2, 31) - 1

    for query in cmd_list:
        cmd, ele_1, ele_2 = map(int, query)
        if cmd == 0:
            case.update(ele_1, ele_2)
        elif cmd == 1:
            assert ele_1 <= ele_2
            res = case.find(s=ele_1, t=ele_2 + 1, r=end)
            if math.isinf(res):
                print(init_max)
            else:
                print(res)

    return case


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    n_num, q_num = map(int, _input[0].split())
    q_list = map(lambda x: x.split(), _input[1:])

    ans = action(q_list)

Measured memory_bytes: 19596
package main

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

func main() {
	N := nextInt()

	for N > 0 {
		if N%10 == 7 {
			fmt.Println("Yes")
			return
		}
		N = N / 10
	}

	fmt.Println("No")
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

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

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 1792
import java.util.Scanner;

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

    /*
        入力
    */

    int n=sc.nextInt();
    int w[]=new int[n];

    for(int i=0;i<n;i++){
      w[i]=sc.nextInt();
    }

    /*
        必要な変数
    */

    int total=0;
    double chuo;
    int s11=0;
    int s21=0;
    int s12=0;
    int s22=0;
    int k=0;

    /*
        全体の和を２分の１したもの
    */

    for(int i=0;i<n;i++){
      total+=w[i];
    }
    chuo=total/2;

    /*
        もしchuoの値を超えたら前後のiを記録する
    */

    total=0;

    for(int i=0;i<n;i++){
      total+=w[i];
      if(total>=chuo){
        k=i;
        break;
      }
    }

    /*
        二つの場合を試す
    */

    for(int i=0;i<k;i++){
      s11+=w[i];
    }
    for(int i=k;i<n;i++){
      s21+=w[i];
    }
    for(int i=0;i<k+1;i++){
      s12+=w[i];
    }
    for(int i=k+1;i<n;i++){
      s22+=w[i];
    }


    if(Math.abs(s11-s21)>=Math.abs(s12-s22)){
      System.out.println(Math.abs(s12-s22));
    }else{
      System.out.println(Math.abs(s11-s21));
    }

  }
}


Measured memory_bytes: 23760
package main

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

func main() {
	run()
}

func run() {
	setSpace()

	h, a := readN(), readN()

	cnt := 0
	for {
		h = h - a
		cnt++
		if h <= 0 {
			break
		}
	}

	fmt.Println(cnt)
}

// ------以下、ユーティリティ------

var sc = bufio.NewScanner(os.Stdin)

func setSpace() {
	sc.Split(bufio.ScanWords)
}

func read() string {
	sc.Scan()
	return sc.Text()
}

func readN() int {
	n, err := strconv.Atoi(read())
	if err != nil {
		panic(err)
	}
	return n
}


Measured memory_bytes: 640
#include<cstring>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<string>
#define fi first
#define se second
#define ll long long
#define INF 0x3f3f3f
using namespace std;
int main (void)
{
    int a,t,b,i,sum;
    scanf("%d%d",&a,&t);
    sum=0;
    while(t--)
    {
        scanf("%d",&b);
        sum+=b;
    }
    if(sum>=a)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val k = readLine()!!.toInt()
    val aList = readLine()!!.split(" ").map(String::toLong)
    val (min, max) = solve(k, aList)
    if (min < 0) {
        println(-1)
    } else {
        println("$min $max")
    }
}

fun solve(k: Int, aList: List<Long>): Pair<Long, Long> {
    val impossible = Pair(-1L, -1L)
    if (aList[k - 1] != 2L) {
        return impossible
    }
    var min = 2L
    var max = 3L
    for (i in k - 2 downTo 0) {
        val x = aList[i]
        min = (min + x - 1) / x * x
        max = max / x * x + x - 1
        if (min > max) {
            return impossible
        }
        // println("$min $max")
    }
    return Pair(min, max)
}

Measured memory_bytes: 59476
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String cards;
			while(true){
				cards = br.readLine();
				if(cards == null || cards.equals("-") ){
					break;
				}
				StringBuilder sb = new StringBuilder(cards);

				int m = Integer.parseInt(br.readLine());

				for(int i=0;i<m;i++){
					int h = Integer.parseInt(br.readLine());

					sb.append(sb.substring(0,h));
					sb.delete(0, h);

				}
				System.out.println(sb.toString());
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (br != null) {
				try {
					br.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}

		}
	}
}

Measured memory_bytes: 24204
#include<iostream>

using namespace std;

int main() {

	long long n, k, q;
	cin >> n >> k >> q;
	long long a[n];
	fill_n(a, n, k - q);
	long long x;

	for (int j = 0; j < q; j++) {
		cin >> x;
		a[x - 1]++;
	}


	for (int i = 0; i < n; i++) {
		if (a[i] > 0) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <cmath>
#include <string>
#include <vector>

typedef long long ll;
const ll INF = 1e12;

int main(int argc, char* argv[])
{
  ll N, M;
  std::cin >> N >> M;

  std::vector< ll > va(N, 0);
  std::vector< ll > vb(N, 0);
  std::vector< ll > vc(M, 0);
  std::vector< ll > vd(M, 0);
  std::vector< std::pair< ll, ll > > chk_point(N, std::make_pair(-1, INF));

  for (ll i = 0; i < N; i++) {
    std::cin >> va[i] >> vb[i];
  }
  for (ll i = 0; i < M; i++) {
    std::cin >> vc[i] >> vd[i];
  }

  for (ll i = 0; i < N; i++) {
    for (ll j = 0; j < M; j++) {
      ll tmp = std::fabs(va[i] - vc[j]) + std::fabs(vb[i] - vd[j]);
      if (tmp < chk_point[i].second) {
	chk_point[i].first  = j;
	chk_point[i].second = tmp;
      }
    }
  }

  for (ll i = 0; i < N; i++) {
    std::cout << chk_point[i].first + 1 << std::endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#include <numeric>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define sym cout<<"---------"<<endl;
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0
#define int ll

int gcd(int x,int y){
  int r;
  while((r=x%y)!=0){
    x=y;
    y=r;
  }
  return y;
}

signed main(){
  int x,y;
  cin>>x>>y;
  int ans=0;
  ans+=x-1+y-1+2;
  
  int g=gcd(x,y);
  ans-=g;
  ans++;
  cout<<ans<<en;
}



Measured memory_bytes: 3104
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cstring>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <ctime>
#include <fstream>
#include <cmath>
#include <unordered_map>

using namespace std;

#ifndef LOCAL
#define cerr if(0)cerr
#endif

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define RT fprintf(stderr, "\nTIME = %lf\n", 1.0 * clock()/CLOCKS_PER_SEC);

typedef long long ll;
typedef long double ld;

const int INFint = 2e9;
const ll INF = 2e18;
const int MOD = 1e9 + 7;

#define FILE "palindrome"


int main() {
    ios_base::sync_with_stdio(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#else
    //    freopen(FILE".in", "r", stdin); freopen(FILE".out", "w", stdout);
    //    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
    string t;
    cin >> t;
    int w = 0, e = 0, s = 0, n = 0;
    for (auto c : t) {
        if (c == 'N') n++;
        if (c == 'S') s++;
        if (c == 'E') e++;
        if (c == 'W') w++;
    }
    if ((max(s, n) != 0 && min(s, n) == 0) || (max(e, w) != 0 &&min(e, w) == 0)) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    RT;
    return 0;
}

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

int main() {
  
  int b, N, M;
  cin >> N;
  vector<string> v(N);
  for (int i = 0; i < N; i++) cin >> v.at(i);
  cin >> M;
  vector<string> w(M);
  for (int i = 0; i < M; i++) cin >> w.at(i);
  
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (v.at(i) == v.at(j)) a.at(i)++;
    }
    for (int j = 0; j < M; j++) {
      if (v.at(i) == w.at(j)) a.at(i)--;
    }
  }
  
  b = a.at(0);
  for (int i = 1; i < N; i++) {
    if (b < a.at(i)) b = a.at(i);
  }
  if (b < 0) b = 0;
  cout << b << endl;
}

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

int main()
{
    ll x, y;
    cin >> x >> y;
    int ans = 0;
    if(x * y < 0 || (x > y && x * y == 0)) ans++;
    else if(x > y) ans += 2;
    cout << ans + abs(abs(x) - abs(y)) << endl;
}

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

using namespace std;

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

    int n;
    cin >> n;

    int odd = 0, even = 0;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        if (a & 1) {
            odd++;
        } else {
            even++;
        }
    }
    if (odd && even) {
        if (odd & 1) {
            cout << n - 1 << endl;
        } else {
            cout << n - 2 << endl;
        }
    } else {
        cout << 0 << endl;
    }
}


Measured memory_bytes: 3204
import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		if (a != b && b != c && c!= a) System.out.println("3");
		else if (a != b || b != c || c != a)  System.out.println("2");
		else System.out.println("1");
	}
}

Measured memory_bytes: 21460
#include <stdio.h>
int main(){

  int i,j,k,num1,num2,num3;
 long long A[100][100],B[100][100],C[100][100];


  scanf("%d%d%d",&num1,&num2,&num3);

  for(i=0;i<num1;i++){
    for(j=0;j<num2;j++){
      scanf("%lld",&A[i][j]);
    }}

  for(i=0;i<num2;i++){
    for(j=0;j<num3;j++){
      scanf("%lld",&B[i][j]);
    }}


  for(i=0;i<num1;i++){
    for(j=0;j<num3;j++){
      C[i][j]=0;

  for(k=0;k<num2;k++){
    C[i][j] += A[i][k]*B[k][j];
  }}}

for(i=0;i<num1;i++){
    for(j=0;j<num3-1;j++){
      printf("%lld ",C[i][j]);
    }
    printf("%lld",C[i][num3-1]);
    printf("\n");
}

 return 0;
}

Measured memory_bytes: 836
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  double result;
  
  if(N%2 == 0) result = 0.5000000000;
  else result = ((double)N+1)/(2*(double)N);
    
  cout << result << endl;
}

Measured memory_bytes: 256
#include        "algorithm"
#include        "iostream"
#include        "numeric"
#include        "iomanip"
#include        "cstring"
#include        "math.h"
#include        "bitset"
#include        "string"
#include        "vector"
#include        "ctime"
#include        "queue"
#include        "stack"
#include        "map"
#include        "set"

#include        "ext/pb_ds/assoc_container.hpp" // Common file
#include        "ext/pb_ds/tree_policy.hpp" // Including tree_order_statistics_node_update
#include        "ext/pb_ds/detail/standard_policies.hpp"

using namespace std;
using namespace __gnu_pbds;


#define          f first
#define          lgn 25
#define          endl '\n'
#define          sc second
#define          N (int)2e5+5
#define          pb push_back
#define          mod 1000000007
#define          ld long double
#define          vi vector<int>
#define          eb emplace_back
#define          vpii vector<pii>
#define          mii map<int,int>
#define          int long long 
#define          pii pair<int,int>
#define          pq priority_queue
#define          BLOCK (int)sqrt(N)
#define          test(x) while(x--)
#define          all(x) begin(x),end(x)
#define          allr(x) rbegin(x),rend(x)
#define          fo(i,a,n) for(int i=a;i<n;i++)
#define          rfo(i,n,a) for(int i=n;i>=a;i--)
#define          FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define          time() cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n"
#define          PI acos(-1.0)
#define 		 bug(...)       __f (#__VA_ARGS__, __VA_ARGS__)

typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update > 
OS ;

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);   
	    freopen("output.txt","w",stdout);
	#endif 
}

const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;

int n,m,k,q;
string s;
vi adj[N];
int vis[N],par[N],a[N];

void go()
{
	cin >> s;
	n = s.size();

	int i = 0;
	if( n&1 )
	{
		cout << "No\n";
		return;
	}
	
	while( i + 1 < n )
	{
		if( s[i] != 'h' or s[i + 1] != 'i'  )
		{
			cout << "No\n";
			return;
		}
		i += 2;
	}
	cout << "Yes\n";
}

int32_t main()
{
	//INP(); 
	FAST;     
	int t=1; 
	// cin>>t;
	test(t) go();
}

 

Measured memory_bytes: 5504