akhauriyash/Code-Regression huggingface dataset:
using System;

class MainClass
{
	public static void Main (string[] args)
	{
		const double p = 3.141592653589;

		double r = double.Parse(Console.ReadLine ());

		double d = r * r * p;
		string a = d.ToString ("F8");

		double f = 2 * r * p;
		string b = f.ToString ("F8");

		Console.WriteLine(a + " " + b);


	}
}

Measured memory_bytes: 9236
#include<bits/stdc++.h>
#define int long long 
#define endl '\n'
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

using namespace std;	

signed main(){IOS;
	int n,w; 
	cin>>n>>w;
	int value[n],weight[n];
	for(int i=0;i<n;i++) cin>>weight[i]>>value[i];
	int total_value = accumulate(value,value+n,0ll);
	vector<int>dp(total_value+1,INT_MAX);
	dp[0]=0;
	for(int i=0;i<n;i++){
		for(int j=total_value-value[i];j>=0;j--) dp[j+value[i]]=min(dp[j+value[i]],dp[j]+weight[i]);
	}
	int ans=0;
	for(int i=0;i<(int)dp.size();i++){
		if(dp[i]<=w) ans=i;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
class Node{
public:
  int location;
  int p,l,r;
  Node(){}
};
class Point{
public:
  int id,x,y;
  Point(){}
  Point(int id,int x,int y): id(id),x(x),y(y){}
  bool operator<(const Point &p)const{
    return id<p.id;
  }
  void print(){
    printf("%d\n",id);
  }
};
static const int MAX = 1000000;
static const int NIL = -1;

int N;
Point P[MAX];
Node T[MAX];
int np;

bool lessX(const Point &p1,const Point &p2){return p1.x<p2.x;}
bool lessY(const Point &p1,const Point &p2){return p1.y<p2.y;}

int makeKDTree(int l,int r,int depth){
  if(!(l<r)) return NIL;
  int mid=(l+r)/2;
  int t = np++;
  if(depth%2==0){
    sort(P+l,P+r,lessX);
  }else{
    sort(P+l,P+r,lessY);
  }
  T[t].location=mid;
  T[t].l = makeKDTree(l,mid,depth+1);
  T[t].r = makeKDTree(mid+1,r,depth+1);

  return t;
}

void find(int v,int sx,int tx,int sy,int ty,int depth,vector<Point> &ans){
  int x=P[T[v].location].x;
  int y=P[T[v].location].y;


  if(sx<=x&&x<=tx&&sy<=y&&y<=ty){
    ans.push_back(P[T[v].location]);
  }

  if(depth%2==0){
    if(T[v].l!=NIL){
      if(sx<=x) find(T[v].l,sx,tx,sy,ty,depth+1,ans);
    }
    if(T[v].r!=NIL){
      if(x<=tx) find(T[v].r,sx,tx,sy,ty,depth+1,ans);
    }
  }else{
    if(T[v].l!=NIL){
      if(sy<=y) find(T[v].l,sx,tx,sy,ty,depth+1,ans);
    }
    if(T[v].r!=NIL){
      if(y<=ty) find(T[v].r,sx,tx,sy,ty,depth+1,ans);
    }
  }
  
} 
   
int main(){
  int x,y;
  scanf("%d",&N);
  for(int i=0;i<N;i++) {
    scanf("%d %d",&x,&y);
    P[i]=Point(i,x,y);
    T[i].l = T[i].r = T[i].p = NIL;
  }
  np=0;
  int root=makeKDTree(0,N,0);

  int q;
  scanf("%d",&q);
  int sx,tx,sy,ty;
  vector<Point> ans;
  for(int i=0;i<q;i++){
    scanf("%d %d %d %d",&sx,&tx,&sy,&ty);
    ans.clear();
    find(root,sx,tx,sy,ty,0,ans);
    sort(ans.begin(),ans.end());
    for(int j=0;j<ans.size();j++){
      ans[j].print();
    }
    printf("\n");
  }
  
  return 0;
}

Measured memory_bytes: 17416
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		try {
			System.setIn(new FileInputStream("src/aoj0089/input.txt"));
			System.setOut(new PrintStream(new FileOutputStream("src/xxxyyyy/result.txt")));
		} catch (FileNotFoundException e) {
		}
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		final int inf = 1 << 29;
		int[] cur = new int [128];
		fill(cur, -inf);
		cur[0] = 0;
		int prev_n = 0;
		while(sc.hasNext()){
			String[] vars = sc.next().split(",");
			int n = vars.length;
			int[] next = new int[128];
			fill(next, -inf);
			for(int i = 0; i < vars.length; i++) {
				int v = Integer.valueOf(vars[i]);
				next[i] = max(next[i], cur[i] + v);
				if( n > prev_n && i - 1 >= 0 ) next[i] = max(next[i], cur[i - 1] + v);
				if( n < prev_n && i + 1 < prev_n) next[i] = max(next[i], cur[i + 1] + v);
			}
			cur = copyOf(next, next.length);
			prev_n = n;
		}
		int ans = -inf;
		for(int x : cur)
			ans = max(ans, x);
		System.out.println(ans);
	}
	
	void debug(Object... os) {
		System.err.println(deepToString(os));
	}
}

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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#include <set>
#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;

void solve(){

}
int main(){
    int X,A,B;
    cin >> X >> A >> B;
    X -= A;
    X -= X/B * B;
    cout << X << endl;

    return 0;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
lrs = [[int(x) for x in input().split()] for _ in range(m)]
lrs.sort()

ans = 0
m = -1
for l, r in lrs:
    if r < m:
        m = r
    if l >= m:
        ans += 1
        m = r

print(ans)

Measured memory_bytes: 23212
#include <bits/stdc++.h>
#define ll long long
#define newl "\n"
#define rep(a, b, c, i) for (int i = a; i < b; i += c)
#define ff first
#define ss second

using namespace std;

class RainySeason{
public:
	int maxRain(string s){
		int c = 0;
		int maxc = 0;
		rep(0, s.size(), 1, i){
			if (s[i] == 'R') c++;
			else c = 0;
			maxc = max(c, maxc);
		}
		return maxc;
	}
};

int main(){
	string s;
	cin >> s;
	RainySeason rnss;
	cout << rnss.maxRain(s) << newl;
}


Measured memory_bytes: 3628
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class A
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var C = Scanner.Scan<char>();
            Console.WriteLine((char)++C);
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
            public static IEnumerable<T> ScanEnumerable<T>() => Console.ReadLine().Trim().Split(" ").Select(x => (T)Convert.ChangeType(x, typeof(T)));
        }
    }
}


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

int readInt(){
  int ret = 0;
  char c;
  while((c=getchar()) && isdigit(c)){
    ret = ret * 10 + (c-'0');
  }
  return ret;
}

main(){
  int n,s;
  while(true){
    n = readInt();
    s = readInt();
    if (n==0)break;
    int r[101]={0};
    for(int i=0;i<n;i++){
      int tmp;tmp=readInt();r[tmp]++;
    }
    int ans = 0;
    for(int i=0;i<101;i++){
      if (i+i > s && r[i])ans += (r[i]*(r[i]-1))/2;
      for(int j=i+1;j<101;j++){
	if (i+j > s)ans += r[i]*r[j];
      }
    }
    printf("%d\n",ans);
  }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	int ans=0;
	for(int i=0;i<s.length();i++)
		if(s[i]=='x') ans++;
	if(ans>7) cout<<"NO\n";
	else cout<<"YES\n";
	return 0;
}

Measured memory_bytes: 256
//
//  main.cpp
//  dp
//
//  Created by 贾皓翔 on 2019/11/26.
//  Copyright © 2019 贾皓翔. All rights reserved.
//
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstring>
#include<limits.h>
#define ll long long
using namespace std;
int buf[20005];
int H,N;
int A[10005];
int B[10005];
int F(int x){
    if(x<=0){
        return 0;
    }
    if(buf[x]!=-1){
        return buf[x];
    }
    int min=0X7FFFFFFF;
    for(int i=0;i<N;i++){
        int a=F(x-A[i])+B[i];
        min=min<a?min:a;
    }
    buf[x]=min;
    return min;
    
}
int main(){
    cin>>H>>N;
    memset(buf, -1, sizeof(buf));
    int maxA=0;
    
    for(int i=0;i<N;i++){
        cin>>A[i]>>B[i];
        maxA=A[i]>maxA?A[i]:maxA;
    }
    for(int i=0;i<=(H+maxA);i++){
        F(i);
    }
    int res=buf[H];
    for(int i=H;i<(H+maxA);i++){
        res=res<buf[i]?res:buf[i];
    }
    cout<<res<<endl;
    
}


Measured memory_bytes: 384
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

if load(str) == "ABC":
    print("ARC")
else:
    print("ABC")



Measured memory_bytes: 67444
#include<stdio.h>
#define r 100000
int main(){
  int i,j,k;
  int n,x;
  int count=0,count1=0;
  int s[r];
  while(1){
    scanf("%d%d", &n, &x);
    if( n == 0 && x == 0) break;
    count1++;
    for( i = 1; i <= n; i++){
      for( j = i+1; j <= n; j++){
	for( k = j+1; k <= n; k++){
	  if( i + j + k == x)
	    count++;
	}
      }
    }
    s[count1]=count;
    count=0;
  }
  for( i = 1; i <= count1; i++){
    printf("%d\n", s[i]);
  }

  return 0;
}



Measured memory_bytes: 2068
#include <iostream>

using namespace std;
long long a[100010],ans = 0;
int main(){
	int i,j,n;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> a[i];
	}
	for(i=1;i<n;i++){
		long long sum = 0;
		for(j=0;j<n-1;j+=i){
			sum += (a[j] + a[n - 1 - j]);
			if(i>=n - 1 - j) break;
			if((n-1)%i==0 && j>n/2 - 1) break;
			ans = max(ans,sum);
		}
	}
	cout << ans << endl;
}


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

int main(void)
{
	char name[21]; //入力した名前用
	char nickname[4]; //ニックネーム用
	int len=0,i=0,count=0; //文字数カウント、ループ用、小文字カウント用
	//printf("名前を小文字で3文字以上20文字以内で入力してEnterボタンを押してください\n");
	scanf("%s", name); //名前の入力用

	//文字数判定
	len = strlen(name);
	if(len<3 || 20<len){
		printf("文字数の要件を満たしていません。再実行してください");
		return 0;
	}

	//小文字判定
	for(i = 0; i < len; i++){
        if('a' <= name[i] && name[i] <= 'z'){
            count++;
        }
    }

    if(len != count){
    	printf("小文字の要件を満たしていません。再実行してください");
		return 0;
    }

	//nicknameの出力
    strncpy( nickname, name, 3 ); //strの先頭+3の位置から5文字をtにコピー
    nickname[3] = '\0';            //取り出した文字数分の最後に'\0'を入れる
    printf( "%s\n", nickname );

	return 0;
}


Measured memory_bytes: 2084
#include <iostream>
#include <string>

using namespace std;

int main(int argc, const char *argv[]) {
  int N;
  int count = 1;
  cin >> N;
  string S;
  cin >> S;

  for(int i = 0; i < N-1; i++){
    if (S[i] != S[i + 1]) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


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

int N;
int D[50];

bool check(int m) {
  vector<int> v = {D[0]};
  int below12 = 0;
  for (int i = 1; i < N; i++) {
    if (D[i] - D[below12] < m) {
      v.insert(lower_bound(v.begin(), v.end(), 24-D[i]), 24-D[i]);
    } else {
      v.insert(lower_bound(v.begin(), v.end(), D[i]), D[i]);
      below12 = i;
    }
  }
  v.emplace_back(24);
  for (int i = 0; i+1 < v.size(); i++) {
    if (v[i+1] - v[i] < m) return false;
  }
  return true;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> D[i];
  }
  sort(D, D+N);
  int ok = 0, ng = D[0]+1;
  while (ng - ok > 1) {
    int m = (ok + ng) / 2;
    if (check(m)) ok = m;
    else ng = m;
  }
  cout << ok << endl;

  return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int check;
        HashSet hs = new HashSet();
        for(int i = 0;i < n;i++){
          check = sc.nextInt();
          if(hs.contains(check)){
            hs.remove(check);
          }else{
            hs.add(check);
          }
        }
          System.out.println(hs.size());
    }
}

Measured memory_bytes: 62416
// AOJ Vol3-0382 Cake Party
// 2018.12.22

//#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int N, C, p, S;
	int ans;

	scanf("%d%d", &N, &C);
	for (S = 0; C; C--) {
		scanf("%d", &p);
		S += p;
	}
	ans = S / (N + 1);
	if (S % (N + 1)) ans++;
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 2108
#include <iostream>
#include <map>
#include <utility>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[])
{

    map<pair<int, int>, int> pq{};
    int n;
    int x[50], y[50];
    int pointx[50][50];
    int pointy[50][50];
    int answer = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            pq[make_pair(x[i] - x[j], y[i] - y[j])]++;
        }
    }
    pq.erase(make_pair(0, 0));
    for (auto output : pq)
    {
        answer = max(output.second, answer);
    }
    cout << n - answer;
    return 0;
}


Measured memory_bytes: 384
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

using namespace std;

class ABichromeCells {
public:
void solve(std::istream& cin, std::ostream& cout) {
    int n, a;
    cin >> n >> a;
    cout << n * n - a << endl;
}
};

int main() {
	ABichromeCells solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007


lli dp[1010][1010];
lli data[1010][1010];

signed main(){

	lli h,w;
	cin>>h>>w;

	REP(i,0,1010)REP(j,0,1010){
		data[i][j]=-1;
		dp[i][j]=0;
	}

	REP(i,1,h+1)REP(j,1,w+1){
		char c;
		cin>>c;
		if(c=='.')data[i][j]=0;
	}

	dp[1][1]=1;
	for(lli i=1;i<=h;i++){
		for(lli j=1;j<=w;j++){
			if(data[i][j]==-1)continue;
			dp[i][j] += dp[i-1][j] + dp[i][j-1];
			dp[i][j]%=MOD;
		}
	}

	cout<<dp[h][w]<<endl;

	return 0;
}

Measured memory_bytes: 16256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <unordered_map>
#include <tuple>
#include <complex>


#define FOR(i, a, b)		for(int i = (int)(a); i < (int)(b); ++i)
#define FORE(i, a, b)		for(int i = (int)(a); i <= (int)(b); ++i)
#define REP(i, n)			FOR(i, 0, n)
#define REPE(i, n)			FORE(i, 0, n)
#define ALL(x)				(x).begin(),(x).end()
#define DEBUG_DC(x)			cout << #x << ": " << x << endl
#define ANS_DC(x)			cout <<  x << endl
#define V_TYPE				int
#define INF					1e4+1

using namespace std;
typedef long long ll;
typedef vector<V_TYPE> vdef;
typedef vector<vdef> vvdef;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T>inline T mygcd(T a, T b) { return b ? mygcd(b, a%b) : a; }
template<typename T>inline T mylcm(T a, T b) { return a * b / mygcd(a, b); }


double myPow(double in, int _exp)
{
	double ans = 1.0;
	int i = _exp;
	while (i != 0)
	{
		ans = ans *in;
		--i;
	}
	return ans;
}

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

	double first = 1.0 / n;
	vdef coin_CNT(n, 0);

	for (int i = 0; i < n; ++i)
	{
		int point = i + 1;
		int CNT = 0;
		while (k > point)
		{
			point *= 2;
			++CNT;
		}
		coin_CNT[i] = CNT;
	}

	double ans = 0.0;
	double sum = 0.0;
	for (int i = 0; i < n; ++i)
	{
		if (i == 0)
		{
			sum = first * myPow((double)0.5, coin_CNT[i]);
			ans += sum;
		}
		else
		{
			int diff = coin_CNT[i - 1] - coin_CNT[i];
			if (diff > 0) sum = sum * myPow((double)2.0, diff);
			ans += sum;
		}
	}

	printf("%2.12lf", ans);
	return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<functional>
#include<queue>
using namespace std;
typedef long long ll;
int main()
{
	int n;
	cin >> n;
	int sum[100010] = {};
	for (int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b;
		sum[a - 1]++;
		sum[b]--;
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		sum[i] += sum[i - 1];
	}
	for (int i = 0; i <= n; i++) {
		if (sum[i] >= i) {
			ans = i;
		}
	}
	cout << ans << endl;
	return	0;
}





Measured memory_bytes: 3504
n = gets.to_i

lines = []
n.times do
  l = gets.split(' ').map(&:to_i)
  lines << l
end

count = 0
lines.map!(&:uniq)
lines.each_with_index do |l,i|
  if l.length == 1
    if count == 2
      puts "Yes"
      break
    elsif count == 1
      count += 1
    elsif count == 0
      count += 1
    end
  else
    count = 0
  end
  if i == (lines.length - 1)
    puts "No" if count < 3
  end
end

Measured memory_bytes: 14392
import java.util.Scanner;

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

        long a = sc.nextLong();
        long b = sc.nextLong();
        long x = sc.nextLong();

        a = a > 0 ? (a-1) / x + 1 : 0;
        b = b / x + 1;
        long cnt = b - a;

        System.out.println(cnt);
    }
}


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

public class Main {

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		int[] points=new int[n];

		for(int i=0; i<n; i++) {
			int hitCount=0;
			int outCount=0;
			points[i]=0;
			while(outCount<3) {
				String line=br.readLine();
				if("HIT".equals(line)) {
					if(hitCount==3)
						points[i]++;
					else
						hitCount++;
				} else if("HOMERUN".equals(line)) {
					points[i]+=hitCount+1;
					hitCount=0;
				} else {
					outCount++;
				}
			}
		}
		
		for(int i=0; i<n; i++)
			System.out.println(points[i]);

		br.close();
	}
}

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

int main(int argc, char const* argv[])
{
	int n;
	cin >> n;
	int taro = 0;
	int hana = 0;
	for(int i = 0; i < n; i++){
			string t, h;
			cin >> t >> h;
			if(t > h)taro+=3;
			else if(t < h)hana+=3;
			else{
					taro++;
					hana++;
			}
	}
	cout << taro << " " << hana << endl;
	return 0;
}



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

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

    int ans = s.size() - 1;
    for(char c='a';c<='z';++c){
        string curr = s, next = "";
        int cnt = 0;
        while(true){
            bool flag = true;
            for(int i=1;i<curr.size();++i){
                if(curr[i] != curr[i-1]){
                    flag = false;
                    break;
                }
            }
            if(flag)break;
            for(int i=0;i<curr.size()-1;++i){
                if(curr[i] == c || curr[i+1] == c){
                    next.push_back(c);
                }else{
                    next.push_back(curr[i]);
                }
            }
            cnt++;
            curr = next;
            next = "";
        }
        ans = min(ans, cnt);
    }

    cout << ans << endl;

    return 0;
}


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

using namespace std;

const double PI = 3.141592653589;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define int long long
#define ll long long
#define ll long long
#define all(c) (c).begin(),(c).end()
#define M 1000000007
#define INF LLONG_MAX
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
// Use pr(a,b,c,d,e) or cerr<<anything or prc(v.begin(),v.end()) or prc(v,v+n)
//  


int32_t main()
{
    fastio;
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    int tot = 0;
    for(int i=0;i<n;i++)
    {
        cin >> v[i];
        tot += v[i];
    }
    sort(all(v), greater<int>());
    int count = 0;
    int z = tot/(4*m);
    if(tot%(4*m)) z++;
    for(int i=0;i<n;i++)
    {
        
        if(v[i] >= z)
        {
            count++;
        }
    }
    if(count >=m ) cout << "Yes\n";
    else cout << "No\n";

    
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

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

		int a = scan.nextInt();
		int b = scan.nextInt();
		int sum = a + b;
		if (sum % 2 == 1){
			sum++;
		}
		System.out.println(sum / 2);
	}
}


Measured memory_bytes: 23252
#include<stdio.h> 
#define INFTY 1000000000

long long cnt; //intでは扱えないためlong long(巨大な数)
long long merge(int A[],int left,int mid,int right){
	int n1=mid-left;		//左側の要素数
	int n2=right-mid;		//右側の要素数
	cnt=0;
	int L[n1],R[n2];
	int i,j,k;		
	for(i=0;i<n1;i++){		//左半分の要素代入
		L[i]=A[left+i];
	}
	for(i=0;i<n2;i++){		//右半分の要素代入
		R[i]=A[mid+i];
	}
	
	L[n1]=INFTY;
	R[n2]=INFTY;
	i=0;
	j=0;
	for(k=left;k<right;k++){
		if(L[i]<=R[j]){
			A[k]=L[i];
			i++;
		}
		else{
			A[k]=R[j];
			j++;
			cnt=cnt+n1-i;
		}
	}
	return cnt;
}

long long mergeSort(int A[],int left,int right){
	int mid;
	long long a,b,c;	//intでは扱えないためlong long(巨大な数)
	if(right-left>1){	//両端の交差の有無で判断
		mid=(left+right)/2;
		a=mergeSort(A,left,mid);
		b=mergeSort(A,mid,right);
		c=merge(A,left,mid,right);
		return a+b+c;
	}
	return 0;
}

int main(void){
	
	int n;
	scanf("%d",&n);
	int A[n];
	int i;
	long long ans;

	
	for(i=0;i<n;i++){
		scanf("%d",&A[i]);
	}
	
	ans=mergeSort(A,0,n);
	printf("%lld\n",ans);
	
	return 0;
	
}



Measured memory_bytes: 3400
class Dice
  attr_reader :top, :north, :west

  def initialize
    @top = 1
    @north = 2
    @west = 3
  end

  def tumble(s)
    if s == "north"
      self.n
    elsif s == "east"
      self.e
    elsif s == "west"
      self.w
    elsif s == "south"
      self.s
    end
  end

  def change(top, north, west)
    @top, @north, @west = top, north, west
  end

  def n
    change(7-@north, @top, @west)
  end

  def e
    change(@west, @north, 7-@top)
  end

  def w
    change(7-@west, @north, @top)
  end

  def s
    change(@north, 7-@top, @west)
  end
end

while (n = gets.to_i) != 0 do
  die = Dice.new
  n.times do
    die.tumble(gets.chomp)
  end
  puts die.top
end

Measured memory_bytes: 6104
@A=glob<>;@l=<>;printf sort{$a-$b}map{$x=@v=$T=$_;$v[$T&3]+=$T&3&&($x+=10,$_),$T/=4for@l;$x+=abs$A[$_]-($v[$_]||1e9)for 1..3;$x-31}1..1e5

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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cout << (*begin) << " ";
    *begin++;
  }
  cout << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

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

const int INF = 1e15;

int n, k;
int h[111111];
int dp[111111];

signed main() {
  cin >> n >> k;
  rep (i, n) {
    cin >> h[i];
  }

  fill(dp, dp+n+10, INF);
  dp[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int step = 1; step <= k; step++) {
      if (i - step >= 0) {
        chmin(dp[i], dp[i-step] + abs(h[i] - h[i-step]));
      }
    }
  }

  cout << dp[n-1] << endl;
  // print1(dp, dp+n+1);

  return 0;
}

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

int main() {
  int A, B, K;
  cin >> A >> B >> K;

  int m = min(A, B);

  int count = 0;
  for (int i = m; i > 0; i--) {
    if (A % i == 0 && B % i == 0) {
      count++;
      if (count == K) {
        cout << i << endl;
        return 0;
      }
    }
  }
}


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

int main(){
  int n, m;
  cin >> n >> m;
  if(n == m) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


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

int gcd(int a,int b) {return b==0? a:gcd(b,a%b);}


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

    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int k=1;k<=n;k++){
                ans+=gcd(i,gcd(j,k));
            }
        }
    }

    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 3624
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever while (true)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
using namespace std;
// clang-format on

using Weight = int;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(const int &s = 0, const int &d = 0, const Weight &w = 0) : src(s), dst(d), weight(w) {}
};

using Edges = std::vector<Edge>;
using Array = std::vector<Weight>;
using Matrix = std::vector<Array>;

class Graph {
  std::vector<Edges> g;

public:
  Graph(const int &size = 0) : g(size) {}

  void addArc(const int &src, const int &dst, const Weight &w = 1) { g[src].emplace_back(src, dst, w); }

  void addEdge(const int &node1, const int &node2, const Weight &w = 1) {
    addArc(node1, node2, w);
    addArc(node2, node1, w);
  }

  const Edges &operator[](const int &i) const { return g[i]; }

  Graph toRootedTree(int r);
  std::pair<std::vector<Weight>, std::vector<int>> dijkstra(const int &src, const int &inf);
  Matrix warshallFloyd(const int &inf);
  std::pair<Weight, Edges> prim(const int &r);
  template<typename UnionFind> std::pair<Weight, Edges> kruskal();
  Weight solveTSP(const int &inf);
};

std::pair<std::vector<Weight>, std::vector<int>> Graph::dijkstra(const int &src, const int &inf = std::numeric_limits<Weight>::max() / 8) {
  using state = std::pair<Weight, int>;
  std::priority_queue<state, std::vector<state>, std::greater<state>> q;
  std::vector<Weight> dist(g.size(), inf);
  std::vector<int> via(g.size());
  dist[src] = 0;
  q.emplace(0, src);
  while (q.size()) {
    Weight d;
    int v;
    std::tie(d, v) = q.top();
    q.pop();
    if (dist[v] < d) continue;
    for (auto &e : g[v]) {
      if (cmin(dist[e.dst], dist[v] + e.weight)) {
        via[e.dst] = v;
        q.emplace(dist[e.dst], e.dst);
      }
    }
  }
  return {dist, via};
}

main {
  int n;
  cin >> n;
  Graph g(n);
  rep(_, n) {
    int u, k;
    cin >> u >> k;
    while (k--) {
      int v, c;
      cin >> v >> c;
      g.addArc(u, v, c);
    }
  }
  vi d = g.dijkstra(0).first;
  rep(i, n) cout << i << ' ' << d[i] << endl;
}

Measured memory_bytes: 15904
using System;
using System.Linq;

namespace AtCoderPractice0705
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int[] AP = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int A = AP[0];
            int P = AP[1];
            int ans = (A * 3 + P) / 2;
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 28236
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int arr[n];
    int sum=0;
    for(int i=0;i<n;i++)
        {
            cin>>arr[i];
            sum+=arr[i];
        }
    sort(arr,arr+n);
    int x=0;
    if(sum % (4*m)==0)
        x=sum/(4*m);
    else
        x=sum/(4*m)+1;
   int i=0;
    for(i=0;i<n;i++)
    {
        if(arr[i]>=x)
           break;
    }
    if(n-i>=m)
        cout<<"Yes";
    else
        cout<<"No";
}


Measured memory_bytes: 256
'use strict'

const main = (input) => {
    input = input.split(' ').map(v => parseInt(v))
    const a = input[0]
    const b = input[1]

    if(a === 1){
        if(b === 1){
            console.log('Draw')
            return
        }else{
            console.log('Alice')
            return
        }
    }
    if(b === 1){
        console.log('Bob')
        return
    }
    if(a > b){
        console.log('Alice')
    }else if(a < b){
        console.log('Bob')
    }else{
        console.log('Draw')
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int n;
    cin >> n;
    cout << n * (n+1) / 2 << endl;
    return 0;
}


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

#define mod 998244353

long long dp[300001];

int a[300001];

int N;

long long f(int i) {
    stack<int> st;
    
    for(int i = 0; i < N; i++) {
        if(st.size() > 0) {
            if(st.top() % 2 == a[i] % 2) {
                st.pop();
            }else st.push(a[i]);
        }else st.push(a[i]);
    }
    long long cnt = 0;
    while(!st.empty()) {
        if(st.top() % 2) cnt++;
        st.pop();
    }
    return cnt;

}


int main() {
    // oh hi mark
    int n; cin >> n;
    string a,b; cin >> a >> b;
    for(int i = 0; i < n; i++) {
        cout << a[i] << b[i];
    }
    return 0;
}


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

int main(){
    long long a,b,n;

    scanf("%lld",&n);
    for (long long i = sqrt(n) + 1; i > 0; i--){
        if (n % i == 0){
            a = i;
            b = n / i;
            break;
        }
    }
    cout << a + b -2;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String message = "No";
		String[] a = new String[3];
		a[0] = s.charAt(0) + "";
		a[1] = s.charAt(1) + "";
		a[2] = s.charAt(2) + "";
		Arrays.sort(a);
		if("abc".equals(a[0] + a[1] + a[2])) {
			message = "Yes";
		}
		System.out.println(message);
	}
}

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

using namespace std;

int N, M;
vector<bool> visited;
vector<vector<int>> graph;

int dfs(int u, int cnt) {
  if (cnt == N) return 1;
  int res = 0;
  for (int v : graph[u]) {
    if (visited[v]) continue;
    visited[v] = true;
    res += dfs(v, cnt + 1);
    visited[v] = false;
  }
  return res;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  visited.assign(N, false), graph.assign(N, vector<int>());
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    graph[a].emplace_back(b);
    graph[b].emplace_back(a);
  }
  visited[0] = true;
  cout << dfs(0, 1) << '\n';
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

inline int read(){
	int x=0,f=1;char ch;
	for(ch=getchar();!isdigit(ch);ch=getchar())if(ch=='-')f=-1;
	for(;isdigit(ch);ch=getchar())x=(x<<3)+(x<<1)+ch-'0';
	return x*f;
}

int main(){
	int n=read(),i=read();
	printf("%d\n",n-i+1);
	return 0;
}

Measured memory_bytes: 256
/**
  *    █████╗  ██████╗       ██████╗ ██╗     ███████╗
  *   ██╔══██╗██╔════╝       ██╔══██╗██║     ╚══███╔╝
  *   ███████║██║            ██████╔╝██║       ███╔╝
  *   ██╔══██║██║            ██╔═══╝ ██║      ███╔╝
  *   ██║  ██║╚██████╗▄█╗    ██║     ███████╗███████╗
  *   ╚═╝  ╚═╝ ╚═════╝╚═╝    ╚═╝     ╚══════╝╚══════╝
  *
  *  @Author: TieWay59
  *  @Created: 2020/8/15 21:20
  *  @Link: https://atcoder.jp/contests/agc047/tasks/agc047_a
  *  @Tags:
  *
  *******************************************************/

#include <bits/stdc++.h>

#ifdef DEBUG

#   include "libs59/debugers.h"
//  #define debug(x)  cerr <<#x << " = "<<x<<endl;
#else
#   define endl '\n'
#   define debug(...)
#   define max(x,y) ((x)>(y)?(x):(y))
#   define min(x,y) ((x)>(y)?(y):(x))
#endif

#define STOPSYNC ios::sync_with_stdio(false);cin.tie(nullptr)
#define MULTIKASE int Kase=0;cin>>Kase;for(int kase=1;kase<=Kase;kase++)
typedef long long ll;
const int MAXN = 2e5 + 59;
const int MOD = 1e9 + 7;
const int INF = 0x3F3F3F3F;
const ll llINF = 0x3F3F3F3F3F3F3F3F;
using namespace std;
using pii = pair<int, int>;
using vint = vector<int>;

ll fpow(ll a, ll b, ll mod = MOD) {
    if (a % mod == 0) return 0;
    ll ret = 1;
    a %= mod;
    while (b) {
        if (b & 1)ret = ret * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ret;
}


void solve(int kaseId = -1) {
    int n;
    cin >> n;
    map<pair<ll, ll>, ll> cnt;
    for (int i = 1; i <= n; ++i) {
        long double ai;
        cin >> ai;
        ll val = (ll) (ai * 1000000000.0 + 0.5);
        ll cnt2 = 0;
        ll cnt5 = 0;
        while (val % 2 == 0) {
            cnt2++;
            val /= 2;
        }
        while (val % 5 == 0) {
            cnt5++;
            val /= 5;
        }
        cnt[make_pair(cnt2, cnt5)]++;
    }

    ll ans = 0;
    for (const auto &pi: cnt) {
        for (const auto &pj: cnt) {
            if (pi.first.first + pj.first.first >= 18 &&
                pi.first.second + pj.first.second >= 18) {
                if (pi == pj) {
                    ans += pi.second * (pi.second - 1ll);
                } else {
                    ans += pi.second * 1ll * pj.second;
                }
            }
        }
    }
    debug(cnt);

    cout << ans / 2 << endl;
}

void solves() {
    MULTIKASE {
        solve(kase);
    }
}

int main() {
#ifdef DEBUG
    freopen("input.txt", "r+", stdin);
#endif
    STOPSYNC;
    solve();
    return 0;
}
/*

 */

Measured memory_bytes: 3728
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.array;
import std.range;
import std.bigint;

void main()
{
    auto input = readln.chomp.split.to!(int[]);
    auto N = input[0];
    auto K = input[1];
    
    auto x = new long[N];
    auto y = new long[N];
    foreach(i ; 0..N){
        auto input2 = readln.chomp.split.to!(long[]);
        x[i] = input2[0];
        y[i] = input2[1];
    }
    long[] x2 = x.dup;
    long[] y2 = y.dup;

    sort(x);
    sort(y);
    long s = (x[N - 1] - x[0]) * (y[N - 1] - y[0]);
    foreach(i ; 0..N) foreach(j ; i+1 ..N) foreach(k ; 0..N) foreach(l ; k+1..N){
        int count = 0;
        foreach(m ; 0..N){
            if(x[i] <= x2[m] && x2[m] <= x[j] && y[k] <= y2[m] && y2[m] <= y[l]){
                count++;
            }
        }
        if(count >= K){
            s = min(s, (x[j] - x[i]) * (y[l] - y[k]));
        }
    }
    s.writeln;
}

Measured memory_bytes: 380
#include<stdio.h>

int main(void){
	int w[300], h[300];
	int i_count = 0;
	while (1){
		scanf("%d %d", &h[i_count], &w[i_count]);
		if (h[i_count] == 0 && w[i_count] == 0)
			break;

		i_count++;
	}

	int i, j,n=i_count;
	for (i_count = 0; i_count < n; i_count++){
		for (i = 0; i < h[i_count]; i++){
			for (j = 0; j < w[i_count]; j++){
				if ((i+j)%2==0)
					printf("%c", '#');
				else
					printf("%c", '.');
			}
			putchar('\n');
		}
		putchar('\n');
	}


	return 0;
}


Measured memory_bytes: 2120
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    int a;
    cin >> a;
    cout << a+a*a+a*a*a << endl;
}

Measured memory_bytes: 3592
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

const double EPS = 1e-9;
const int LIM = 50;

bool eq(double a, double b) {
    return abs(a-b) < EPS;
}

long long square(long long x) {
    return x * x;
}

long long dist(int x1, int y1, int z1, int x2, int y2, int z2) {
    return square(x1 - x2) + square(y1 - y2) + square(z1 - z2);
}

int inner_product(int x1, int y1, int z1, int x2, int y2, int z2) {
    return x1*x2 + y1*y2 + z1*z2;
}

int main() {
    int N, Q;
    long long x[LIM], y[LIM], z[LIM], r[LIM];
    long long l[LIM];

    cin >> N >> Q;

    for (int j = 0; j < N; ++j) {
        cin >> x[j] >> y[j] >> z[j] >> r[j] >> l[j];
    }

    for (int _ = 0; _ < Q; ++_) {
        long long sx, sy, sz, dx, dy, dz;
        cin >> sx >> sy >> sz >> dx >> dy >> dz;

        long long ans = 0;

        for (int k = 0; k < N; ++k) {
            if (dist(sx, sy, sz, x[k], y[k], z[k]) <= square(r[k]) ||
                    dist(dx, dy, dz, x[k], y[k], z[k]) <= square(r[k])) {
                ans += l[k];
                continue;
            }
            long long plane1 = (sx-dx)*(x[k]-sx) + (sy-dy)*(y[k]-sy) + (sz-dz)*(z[k]-sz);
            long long plane2 = (sx-dx)*(x[k]-dx) + (sy-dy)*(y[k]-dy) + (sz-dz)*(z[k]-dz);


            if (plane1 * plane2 > 0) {
                continue;
            }

            long long ip = inner_product(x[k]-sx, y[k]-sy, z[k]-sz, dx-sx, dy-sy, dz-sz);

            double dist_f = dist(x[k], y[k], z[k], sx, sy, sz) - ((double)square(ip))/dist(sx, sy, sz, dx, dy, dz);
            
            if (dist_f <= square(r[k])) {
                ans += l[k];
            }
        }

        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 1168
Scanf.(Array.(
  let n,x=scanf" %d %d"@@fun u v->u,v in
  let s,p=make 50 1,make 50 1 in
  init 49 (fun i->
    s.(i+1)<-2*s.(i)+3;
    p.(i+1)<-2*p.(i)+1) |> ignore;
  let rec f lv ofs =
    if lv=0 then
      if ofs=1 then 1 else 0
    else let r=s.(lv-1) in
    if ofs=0 || ofs=1 then 0
    else if ofs<=1+r   then f (lv-1) (ofs-1)
    else if ofs =2+r   then 1 + p.(lv-1)
    else if ofs<=2+r+r then 1 + p.(lv-1) + f (lv-1) (ofs-2-r)
    else if ofs =3+r+r then 1 + 2 * p.(lv-1)
    else failwith ""
  in print_int @@ f n x
));;

Measured memory_bytes: 384
#include <iostream>
#include <string>
using namespace std;
int main() {
	int i,turn;
	string a, b, c;
	cin >> a >> b >> c;
	a += "0";
	b += "0";
	c += "0";
	if (a[0] == 'a') {
		turn = 0;
	}
	else if (a[0] == 'b') {
		turn = 1;
	}
	else {
		turn = 2;
	}
	a.erase(0, 1);
	while (turn < 3) {
		if (turn == 0) {
			if (a[0] == 'a') {
				turn = 0;
			}
			else if (a[0] == 'b') {
				turn = 1;
			}
			else if (a[0] == 'c') {
				turn = 2;
			}
			else {
				turn = 3;
			}
			a.erase(0, 1);
		}
		if (turn == 1) {
			if (b[0] == 'a') {
				turn = 0;
			}
			else if (b[0] == 'b') {
				turn = 1;
			}
			else if (b[0] == 'c') {
				turn = 2;
			}
			else {
				turn = 4;
			}
			b.erase(0, 1);
		}
		if (turn == 2) {
			if (c[0] == 'a') {
				turn = 0;
			}
			else if (c[0] == 'b') {
				turn = 1;
			}
			else if (c[0] == 'c') {
				turn = 2;
			}
			else {
				turn = 5;
			}
			c.erase(0, 1);
		}
	}
	if (turn == 3) {
		cout << "A" << endl;
	}
	else if (turn == 4) {
		cout << "B" << endl;
	}
	else {
		cout << "C" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
signed main(){
  string s,a;
  ll n,l,cun,j=1;
  cin>>s;
  n = s.size();
  while(true){
    a = s.erase(n-j);
    l = a.size();
    cun = 0;
    if(l % 2 == 0){
      for(ll i=0;i<l/2;i++){
        if(a[i]==a[l/2+i]){
          cun++;
        }
      }
      if(cun==l/2){
        cout<<l<<"\n";
        return 0;
      }
    }
    j++;
  }
}

Measured memory_bytes: 256
#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;
typedef long long ll;




int main()
{
    int N,K;
    cin >> N >> K;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    A.push_back(0);
    sort(all(A));
    
    if(A.back() < K){
        cout << "IMPOSSIBLE" << endl;
        return 0;
    }
    for (int i = 1; i < int(A.size()); i++) {
        if(K%A[i] == 0){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    
    while (int(A.size()) > 2) {
        priority_queue<int, vector<int>, greater<int>> q;
        for (int i = int(A.size())-1; i >= 1; i--) q.push(A[i] - A[i-1]);
    
        A.assign(0,0);
        A.push_back(0);
        
        while (!q.empty()) {
            int a = q.top();
            
            if((A.back() != a)){
                if(K % a == 0){
                    cout << "POSSIBLE" << endl;
                    return 0;
                }else{
                    A.push_back(q.top());
                }
            }
            q.pop();
        }
        
    }
    
    for (int i = 1; i < int(A.size()); i++) {
        if(K%A[i] == 0){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE" << endl;
  
    
    
    return 0;
}



Measured memory_bytes: 1528
#include <stdio.h>

int main()
{
	int a[5], t;

	scanf("%d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &a[4]);

	for (int i = 0; i < 5; ++i){
		for (int i = 0; i < 4; i++){
			if(a[i] < a[i+1]){
				t = a[i];
				a[i] = a[i+1];
				a[i+1] = t;
			}
		}
	}

	printf("%d %d %d %d %d\n", a[0], a[1], a[2], a[3], a[4]);

	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int a,b,c,k;
  cin>>a>>b>>c>>k;
  if(k<=a) cout<<k;
  else if(k>a && k<b+a) cout<<a;
  else cout<<2*a+b-k;
}

Measured memory_bytes: 3648
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();

		for (int i = 1; i <= s.length(); i++) {
			if (i % 2 == 1) {
				System.out.print(s.charAt(i - 1));
			}
		}
	}
}


Measured memory_bytes: 28936
#include <iostream>
#include <cstdio>
#define N 305
using namespace std;

typedef long long ll;
ll n, m, e, Q, s, st, en, a[N][N], x[90005], y[90005], b[90005];
ll ab(ll p) {return p > 0 ? p : -p;}
int main()
{
	ll i, j;
	cin >> n >> m >> e;
	for (i = 1; i <= n; i++) {
		for (j = 1; j <= m; j++) {
			scanf ("%lld", &a[i][j]);
			x[a[i][j]] = i;
			y[a[i][j]] = j;
		}
	}
	for (i = e + 1; i <= n * m; i++) {
		b[i] = b[i - e] + ab(x[i] - x[i - e]) + ab(y[i] - y[i - e]);
	}
	cin >> Q;
	while (Q--) {
		scanf ("%lld %lld", &st, &en);
		printf("%lld\n", b[en] - b[st]);
	}
    return 0;
}


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

int main(){
    int n;cin>>n;
    string slimes;
    cin >> slimes;

    vector<char> merged_slimes;
    char prev = slimes[0];
    if (n == 1){
        cout << 1 << endl;
        return 0;
    }
    merged_slimes.push_back(prev);
    for (int i=1;i<n;i++){
        if (slimes[i] != prev){
            prev = slimes[i];
            merged_slimes.push_back(prev);
        }
    }
    cout << merged_slimes.size() << endl;
    return 0;
}

Measured memory_bytes: 640