akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main(){
    string N;
    cin >> N;
    int count = 0;
    for(char i : N){
        count += i - '0'; //(int)i とすると、charのアドレス番号が出るみたい 
    }
    if(count % 9 == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    
}

Measured memory_bytes: 3724
import java.util.Scanner;


public class Main {

    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long mod = 1000000007L;
        int n = s.length();
        long [][] number = new long[n + 1][13];
        number[0][0] = 1;
        for (int i = 1; i <= n; ++i) {
            if (s.charAt(i - 1) == '?') {
                for (int j = 0; j <= 9; ++j) {
                    for (int k = 0; k <= 12; ++k) {
                        if (number[i - 1][k] > 0) {
                            int currentMod = ( k * 10 + j  + 13) % 13;
                            number[i][currentMod] += number[i - 1][k];
                            number[i][currentMod] %= mod;
                        }
                    }
                }
            } else {
                int current = s.charAt(i - 1) - '0';
                for (int k = 0; k <= 12; ++k) {
                    int currentMod = ( k * 10 + current  + 13) % 13;
                    number[i][currentMod] += number[i - 1][k];
                    number[i][currentMod] %= mod;
                }
            }

        }
        System.out.println(number[n][5]);

    }
}


Measured memory_bytes: 38572
A = int(input())
B = int(input())
C = int(input())
X = int(input())

S = [(A,B,C),]
ans = 0
while len(S) > 0:
    a, b, c = S.pop()
    s = 500*a+100*b+50*c
    if s == X:
        ans += 1
    if c > 0:
        S.append((a, b, c-1))
    elif b > 0:
        S.append((a, b-1, C))
    elif a > 0:
        S.append((a-1, B, C))
print(ans)

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string str1 = Console.ReadLine();
            string str2 = Console.ReadLine();
            string[] a = new string[3];
            string[] b = new string[3];
            int sum = 0;
            for(int i = 0;i < 3; ++i)
            {
                a[i] = str1.Substring(i,1);
                b[i] = str2.Substring(i, 1);
                if (a[i] == b[i])
                {
                    sum++;
                }
            }
            Console.WriteLine(sum);
        }
    }
}


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

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    int a;
    for(int i = 0; i < N-1; i++) {
        cin >> a;
        A.at(a - 1)++;
    }

    for(int i = 0; i < N; i++) {
        cout << A.at(i) << endl;
    }

    return 0;
}

Measured memory_bytes: 4052
#include <iostream>
#include <bits/stdc++.h>
#define rep(i,z) for(int i = 0; i<(int)(z); i++)
#define rep1(i,z) for(int i = 1; i<=(int)(z); i++)
 
using namespace std;

typedef long long ll;
const ll mod=1e9+7;
 
using pear = pair<int,int>;
 
int main(){
    int a,b;
    cin >>a>>b;
    if(a>9||b>9)cout<<-1<<endl;
    else cout<<a*b<<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>

using namespace std;
typedef pair<int,int> pii;

struct query{
	int a,b,c;
}query[200001];
int n,m,q;
vector<pii> adj[100001];
int ea[19][100001],ed[19][100001],pa[100001],dist[100001];

int find(int cur) {
	return cur==pa[cur] ? cur : pa[cur]=find(pa[cur]);
}
void dfs(int cur,int p,int d,int cost) {
	dist[cur]=d;
	int pp=p,a=1;
	ea[0][cur]=p;
	ed[0][cur]=cost;
	while(ea[a-1][pp]!=0) {
		ea[a][cur] = ea[a-1][pp];
		ed[a][cur] = ed[a-1][pp] + ed[a-1][cur];
		pp = ea[a-1][pp];
		a++;
	}
	for(auto &it:adj[cur]) if(it.second!=p) {
		dfs(it.second,cur,d+1,-it.first);
	}
}
int lca(int u,int v) {
	int f=1,ds=0;
	if(u==3 && v==4) f=2;
	if(dist[v] < dist[u]) swap(u,v),f=-1;
	int dif=dist[v]-dist[u];
	for(int i=0; 1<<i <= dif;i++) {
		if(dif>>i & 1) {
			ds += ed[i][v];
			v = ea[i][v];
		}
	}
	if(u==v) return u;
	int du=0,dv=ds;
	for(int i=18;i>=0;i--) if(ea[i][u]!=0 && ea[i][v]!=0 && ea[i][u]!=ea[i][v]) {
		u=ea[i][u]; v=ea[i][v];
	}
	return ea[0][v];
}
int getLen(int u,int v) {
	int dif=dist[v]-dist[u],ds=0;
	for(int i=0; 1<<i <= dif;i++) {
		if(dif>>i & 1) {
			ds+=ed[i][v];
			v=ea[i][v];
		}
	}
	return ds;
}

int main() {
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) pa[i]=i;
	for(int i=0;i<m;i++) {
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		if(find(a)!=find(b)) {
			adj[a].push_back(pii(c,b));
			adj[b].push_back(pii(-c,a));
			int pu=find(b),pv=find(a);
			pa[pu]=pv;
		}
		else {
			query[q].a=a; query[q].b=b; query[q].c=c;
			q++;
		}
	}

	for(int i=1;i<=n;i++) if(!dist[i]) dfs(i,0,1,0);
	for(int i=0;i<q;i++) {
		int aa=lca(query[i].a,query[i].b);
		int d=getLen(aa,query[i].a)-getLen(aa,query[i].b);
		if(d!=query[i].c) {
			puts("No");
			return 0;
		}
	}
	puts("Yes");
	
	return 0;
}


Measured memory_bytes: 26240
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
vector<int> manacher(string s) { // res[i] := 要素iを中心とする回文の半径((回文長+1)/2)を返す
    vector<int> R(s.length());
    int i = 0, j = 0;
    while (i < s.size()) {
        while (i - j >= 0 && i + j < s.size() && s[i - j] == s[i + j]) ++j;
        R[i] = j;
        int k = 1;
        while (i - k >= 0 && i + k < s.size() && k + R[i - k] < j) R[i + k] = R[i - k], ++k;
        i += k; j -= k;
    }
    return R;
}
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/

typedef long long ll;
string A;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A;
    int N = A.length();

    vector<int> cnt(26);
    ll ans = 1;
    rrep(i, N - 1, 0) {
        rep(j, 0, 26) if (j != (A[i] - 'a')) ans += cnt[j];
        cnt[A[i] - 'a']++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 720
import fractions
a, b = map(int, input().split())
x = fractions.gcd(a, b)
t = x

i = 2
ans = 1;
while i * i <= t:
  if x % i == 0:
    while x % i == 0:
      x /= i
    ans += 1
  i += 1
if x != 1:
  ans += 1

print(ans)

Measured memory_bytes: 5176
import sys
input = sys.stdin.buffer.readline

n, k = map(int, input().split())
TD = [[0, 0] for _ in range(n)]
for i in range(n):
    t, d = map(int, input().split())
    TD[i][0], TD[i][1] = d, t

TD.sort(reverse=True)
S = set()
f = 0
h = []
import heapq
heapq.heapify(h)
for i in range(k):
    d, t = TD[i]
    if t in S:
        heapq.heappush(h, d)
    else:
        S.add(t)
    f += d

INF = 10**18
F = [-INF]*(k+1)
cur = len(S)
F[cur] = f

for i in range(k, n):
    d, t = TD[i]
    if t in S:
        continue
    else:
        if h:
            x = heapq.heappop(h)
            f += d-x
            S.add(t)
            cur += 1
            F[cur] = f

for i in range(0, k+1):
    F[i] += i*i

print(max(F))


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

int main() {
  string str;
  cin>>str;
  if (str[0]==str[1] && str[1]==str[2]) puts("Yes");
  else if (str[1]==str[2] && str[2]==str[3]) puts("Yes");
  else puts("No");
}

Measured memory_bytes: 256
N = int(input())
H = list(map(int, input().split()))

ans = 0
for i in range(N-1):
    while True:
        if H[i] <= 0:
            break

        base = H[i]
        for j in range(i+1, N):
            # 花の高さが0なら初期のまま
            if H[j] <= 0:
                break

            # 次の花(j+1)が基準の花(j)以下か
            if base <= H[j]:
                H[j] -= 1
            else:
                break
        H[i] -= 1
        ans += 1

ans += max(0, H[-1])
print(ans)


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

int main() {
  int N;
  cin >> N;
  int A;
  int warukaisu;
  int zantei_kotae;
  int kotae = 100;
  for(int i = 0; i < N; i++){
    warukaisu = 1;
    zantei_kotae = 0;
  	cin >> A;
    while(A % (warukaisu * 2) == 0){
    	zantei_kotae += 1;
      	warukaisu *= 2;
    }
    if (zantei_kotae < kotae){
    	kotae = zantei_kotae;
    }
  }
  cout << kotae << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <limits.h>
#include <queue>

using namespace std;

int n,m,p,a,b;

#define FOR(i,n) for(int i = 0; i < n; i++)

typedef struct{
	int x,y,z;
} LOAD;

typedef struct{
	double cost[256];
	bool used;
}CITY;

int ticket[8];
LOAD load[465];
CITY city[30+1]; //city[0]Ídummy

double get_min(double a,double b){return (a>b)?b:a;}

void search()
{
	queue<int> city_nums;
	

	for(city_nums.push(a); !city_nums.empty(); city_nums.pop()){
		int pipot = city_nums.front();
		if(pipot == b)
			continue; //±±ÌoHÍIíè

		city[pipot].used = true; //±±Íà¤Kê½±ÆÉÈé
		for(int j = 0; j < p; j++){
			if((load[j].x != pipot && load[j].y != pipot)) continue; //¹ðgÁ½©AÊêÈ¢
			int next = (load[j].x != pipot) ? load[j].x : load[j].y; //Â¬Ìcity
			if(city[next].used) continue; //»Ì¬Í·ÅÉKê½
			city_nums.push(next); //ÉKêé¬
			//RXgvZ
			for(int i = 0; i < (1 << n); i++){
				if(city[pipot].cost[i] == INT_MAX) continue; //»Ì`Pbg\¬ÍÈ¢
				FOR(k,n){
					if(i & (1 << k)) continue; //kÔÚÍgÁÄ¢Ü·
					int new_tickets = i | (1 << k); //Vµ¢tO
					city[next].cost[new_tickets] = 
						get_min(city[next].cost[new_tickets],city[pipot].cost[i] + load[j].z / (double)ticket[k]); //RXgvZ
				}
			}
		}
	}
}

void solve()
{
	FOR(i,n)
		cin >> ticket[i];
	FOR(i,p)
		cin >> load[i].x >>load[i].y>>load[i].z;

	int flagNum = (1 << n);

	for(int i = 1; i <= m; i++){
		city[i].used = false;
		FOR(j,flagNum)
			city[i].cost[j] = INT_MAX;
	}

	//gp`PbgÈµAcost0ÉÝè
	city[a].cost[0] = 0;
	search();

	double ans = (double)INT_MAX;
	FOR(i,flagNum)
		ans = get_min(ans,city[b].cost[i]);
	if(ans == (double)INT_MAX) cout << "Impossible" << endl;
	else cout << ans << endl;

}

int main()
{
	while(cin>>n>>m>>p>>a>>b,(n||m||p||a||b)){
		solve();
	}

	return 0;
}

Measured memory_bytes: 1100
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
using System.Diagnostics;

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

}

class Magatro
{
    private int N,K;
    private void Scan()
    {
        var sc=new Scanner();
        N=sc.NextInt();
        K=sc.NextInt();
    }

    public void Solve()
    {
        Scan();
        int f=1;
        for(int i=0;i<N;i++)
        {
            if(f<K)
            {
                f*=2;
            }
            else
            {
                f+=K;
            }
        }
        Console.WriteLine(f);
    }

    static public void Main(string[]args)
    {
        new Magatro().Solve();
    }
}

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

int main() {
	int n, a[110], tmp, alice=0, bob=0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	a[n] = 0;
	for (int i = 0; i < n - 1; i++) {
		for (int j = 0; j < n - 1 - i; j++) {
			if (a[j] < a[j + 1]) {
				tmp = a[j];
				a[j] = a[j + 1];
				a[j + 1] = tmp;
			}
		}
	}
	for (int i = 0; i < n; i++) {
		if (i % 2 == 0) {
			alice += a[i];
		}
		else {
			bob += a[i];
		}
	}
	cout << alice - bob << endl;

	return 0;
}

Measured memory_bytes: 256
a,b = map(int,input().split())
am = a%4
bm = b%4
ad = a//4
bd = b//4
ans = 0
if ad == bd:
    for i in range(a, b+1):
        ans ^= i
else:
    while am != 0:
        ans ^= a
        a += 1
        am += 1
        am %= 4
    while bm != 3:
        ans ^= b
        b -= 1
        bm -= 1
        bm %= 4
print(ans)



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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define PI 3.14159265358979
#define MOD 1000000007 // = 10^9 + 7

using namespace std;
using ll = long long;


void solve()
{
	int n;
	string s, t;
	cin >> n >> s >> t;
	for(int i = 0; i < n; ++i)
	{
		cout << s[i] << t[i];
	}
}

int main()
{
	fastio;
	solve();

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, S, q, T;
    vector<int> uS(100000);
    cin >> n;
    int k = 0;
    for (int i=0; i<n; ++i) {
        cin >> S;
        if (k == 0 || uS[k] != S) {
            uS[k] = S;
            k ++;
        }
    }

    int ans = 0;
    cin >> q;
    for (int i=0; i<q; ++i) {
        cin >> T;
        if (binary_search(uS.begin(), uS.begin() + k, T)) ans ++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll a[26];
int main() {
	ll h,w;
	cin>>h>>w;
	ll ko4=(h/2)*(w/2);
	ll ko2=0;ll ko1=0;
	if(h%2!=0){
		ko2+=w/2;
	}
	if(w%2!=0){
		ko2+=h/2;
	}
	if(w%2!=0&&h%2!=0){
		ko1=1;
	}
	for(int i=0;i<h*w;i++){
		char x;
		cin>>x;
		ll now=x-'a';
		a[now]++;
	}
	for(int i=0;i<26;i++){
		ll now=a[i];
		ll yon=min(now/4,ko4);
		ko4-=yon,now-=4*yon;
		ll ni=min(now/2,ko2);
		ko2-=ni,now-=2*ni;
		ll iti=min(now,ko1);
		ko1-=iti,now-=iti;
		if(now>0){
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int d=sc.nextInt();
    int x=sc.nextInt();
    int[] a=new int[n];
    for(int i=0;i<n;i++){
      a[i]=sc.nextInt();
    }
    int c=0;
    for(int i=0;i<n;i++){
      c+=(d-1)/a[i]+1;
    }
    System.out.println(c+x);
  }
}

Measured memory_bytes: 21844
void main() {
	auto n = ri;
	bool[] S, H, C, D;
	S = new bool[](13);
	H = new bool[](13);
	C = new bool[](13);
	D = new bool[](13);
	foreach(_; 0..n) {
		auto ip = rs.split, kind = ip[0], num = ip[1].to!int;
		switch(kind) {
			case "S":
				S[num-1] = true;
				break;
			case "H":
				H[num-1] = true;
				break;
			case "C":
				C[num-1] = true;
				break;
			case "D":
				D[num-1] = true;
				break;
			default:
				assert(0);
		}
	}

	auto kindarr = ["S", "H", "C", "D"];
	foreach(kind, arr; [S, H, C, D]) {
		foreach(i, v; arr) {
			if(!v) {
				writefln("%s %d", kindarr[kind], i+1);
			}
		}
	}
}

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

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: 2516
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		while(!(line = br.readLine()).equals("0 0")){
			String s[] = line.split(" ");
			int n = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);
			System.out.println(soi(n, b, -1));
		}
	}
	static int soi(int n, int s, int i) {
		if (n == 0) {
			return (s == 0) ? 1 : 0;
		}
		int a = 0;
		int l = Math.min(s, 9);
		for (i = i + 1; i <= l; i++) {
			a += soi(n - 1, s - i, i);
		}
		return a;
	}

}

Measured memory_bytes: 24524
N = int(input())
a = list(map(int, input().split()))
sumval = sum(a)
ans = 10 ** 15
suma = 0
for i in range(N-1):
  suma += a[i]
  if ans > abs(sumval - 2 * suma):
    ans = abs(sumval - 2 * suma)
print(ans)

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

void main(){
    int[] ary;
    int[] temp1, temp2;
    while(true){
        auto input = readln.split;
        int n = input[0].to!int;
        int r = input[1].to!int;
        if(n == 0 && r == 0){
            break;
        }
        ary = iota(1, n + 1).retro.array;
        temp1 = new int[n];
        temp2 = new int[n];
        foreach(i; 0..r){
            auto input2 = readln.split;
            int p = input2[0].to!int;
            int c = input2[1].to!int;
            temp1[0..(p-1)] = ary[0..(p-1)];
            temp2[0..c] = ary[(p-1)..(p-1) + c];
            ary[c..c + (p-1)] = temp1[0..(p-1)];
            ary[0..c] = temp2[0..c];
        }
        ary[0].writeln;
    }
}

Measured memory_bytes: 1544
#include <bits/stdc++.h>
using namespace std;
long long mod=1e9+7;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long T;
  T=1;
  while(T--)
  {
    int a,b,c;
    cin>>a>>b>>c;
    cout<<c<<" "<<a<<" "<<b<<endl;
  }
   return 0;
}


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

int main() {

  int D;
  cin >> D;

if( D == 22 ){
    cout << "Christmas Eve Eve Eve" << endl;
}
if( D == 23 ){
    cout << "Christmas Eve Eve" << endl;
}
if( D == 24 ){
    cout << "Christmas Eve" << endl;
}
if( D == 25 ){
    cout << "Christmas" << endl;
}
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (h, w) = readLine()?.split(" ")?.map { it.toInt() } ?: return
    val grid: List<List<String>> = (0 until h).map {
        readLine()?.toCharArray()?.map { it.toString() } ?: listOf()
    }
    // 空きマスを0に、爆弾を-1に変換
    val result = grid.map { list -> list.map {
        if (it == ".") 0 else - 1
    }.toMutableList() }.toMutableList()

    for ((i, list) in result.withIndex()) {
        for ((j, c) in list.withIndex()) {
            if (c >= 0) {
                continue
            }

            val hasUpSpace = i > 0
            val hasBottomSpace = i < h - 1
            val hasLeftSpace = j > 0
            val hasRightSpace = j < w - 1

            // 上
            if (hasUpSpace && result[i - 1][j] != -1) {
                result[i - 1][j] += 1
            }
            // 下
            if (hasBottomSpace && result[i + 1][j] != -1) {
                result[i + 1][j] += 1
            }
            // 左
            if (hasLeftSpace && result[i][j - 1] != -1) {
                result[i][j - 1] += 1
            }
            // 右
            if (hasRightSpace && result[i][j + 1] != -1) {
                result[i][j + 1] += 1
            }
            // 左上
            if (hasUpSpace && hasLeftSpace && result[i - 1][j - 1] != -1) {
                result[i - 1][j - 1] += 1
            }
            // 右上
            if (hasUpSpace && hasRightSpace && result[i - 1][j + 1] != -1) {
                result[i - 1][j + 1] += 1
            }
            // 左下
            if (hasBottomSpace && hasLeftSpace && result[i + 1][j - 1] != -1) {
                result[i + 1][j - 1] += 1
            }
            // 右下
            if (hasBottomSpace && hasRightSpace && result[i + 1][j + 1] != -1) {
                result[i + 1][j + 1] += 1
            }
        }
    }

    result.forEach { list ->
        list.forEach {
            if (it == -1) {
                print("#")
            } else {
                print(it)
            }
        }
        print("\n")
    }
}

Measured memory_bytes: 37740
import math
a, b, h, m = map(int, input().split())

mc = 360*m/60
hc = 360*(h/12+m/720)
c = abs(mc-hc)
c = min(c, 360-c)

ans = math.sqrt((a**2)+(b**2)-2*a*b*math.cos(2*math.pi*c/360))
print(ans)

Measured memory_bytes: 9456
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define INF 120000000

using namespace std;

typedef pair<int, int> P;
typedef long long int LL;

class UnionFind {
public:
    vector<int> par, rank;
    UnionFind(int size): par(size, -1), rank(size, 0) {}

    int find(int x) {
        if (par[x] < 0) return x;
        else return par[x] = find(par[x]);
    }

    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y) return;

        if (rank[x] < rank[y]) {
            par[y] += par[x];
            par[x] = y;
        } else {
            par[x] += par[y];
            par[y] = x;
            if (rank[x] == rank[y]) rank[x]++;
        }
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }

    int size(int x) {
        return -par[find(x)];
    }
};


int main() {
    int n, m;
    cin >> n >> m;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
        int tmp;
        cin >> tmp;
        tmp--;
        p[tmp] = i;
    }

    UnionFind uf(n);
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >> x >> y;
        x--; y--;
        uf.unite(x, y);
    }

    int cnt = 0;
    for (int i = 0; i < n; i++) {
        if (uf.same(i, p[i])) cnt++;
    }

    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define fore(i,a,b) for(ll i=(ll)(a);i<=(ll)(b);++i)
#define rep(i,n) fore(i,0,(n)-1)
#define rfore(i,a,b) for(ll i=(ll)(b);i>=(ll)(a);--i)
#define rrep(i,n) rfore(i,0,(n)-1)
#define all(x) (x).begin(),(x).end()
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
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;}
const string YES = "Yes";
const string NO = "No";

ll a[3][3];
bool c[3][3];
void solve(){
    rep(i,3)rep(j,3)cin>>a[i][j];
    ll n;cin>>n;
    vl b(n);
    rep(i,n)cin>>b[i];

    rep(i,3)rep(j,3)rep(k,n){
        if(a[i][j]==b[k]){
            c[i][j]=true;
        }
    }
    bool flg=false;
    rep(i,3){
        if(c[i][0]&&c[i][1]&&c[i][2])flg=true;
        if(c[0][i]&&c[1][i]&&c[2][i])flg=true;
    }
    if(c[0][0]&&c[1][1]&&c[2][2])flg=true;
    if(c[0][2]&&c[1][1]&&c[2][0])flg=true;
    cout<<(flg?YES:NO)<<endl;
}

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


Measured memory_bytes: 256
#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(){
   ll ans=0;
   ll n;cin >>n;
    for (int i = 0; i < n; ++i) {
        ll x;cin >>x;
        while(x%2==0){
            ans++;
            x/=2;
        }
    }
    cout <<ans <<endl;
   return 0;
}

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

///////////////////////////////////////////
const long long int INF = 1000000000000000000LL;
using ll = long long int;
using vi = vector<int>;
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rep(i,N) for(int i=0;i<N;i++)
//template <class  T>T max(T x,T y){if(x>y){return x;}else{return y;}}
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return 1; } return 0; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return 1; } return 0; }
template<class T>T sqar(T x){ return x*x; }
///////////////////////////////////////////

int main(){
    int a,b;
    cin>>a>>b;
    if(a<=b){
        cout<<a<<endl;
    }else{
        cout<<a-1<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>          // printf(), scanf()

int
main(int argc, char **argv)
{
	double d;
	double h, l;

	scanf("%lf", &d);
	h = d, l = d;
	while (scanf("%lf", &d) != EOF)
	{
		if (d > h)
			h = d;

		if (d < l)
			l = d;
	}

	printf("%f\n", h - l);
	return 0;
}

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

using namespace std;

#define INF 1e9
#define ll long long
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

int N;
ll ans=0;
vll a,s;
map<ll, ll> mp;

void solve(){
    for(auto itr=mp.begin(); itr != mp.end(); itr++){
        ll num = itr->second;
        ans += num * (num-1)/2;
    }

    cout << ans << endl;
}

int main(){
    cin >> N;
    
    a.resize(N), s.resize(N+1,0);
    
    rep(i,N)
        cin >> a[i];

    rep(i,N){
        s[i+1] = a[i] + s[i];
    }

    rep(i,N+1) mp[s[i]]++;

    solve();
}


Measured memory_bytes: 15872
n, z, w = map(int, input().split())
a = list(map(int, input().split()))

"""
xの選択肢は2つ。最後を取ってwと比較するか、最後から2番目を取って最後と比較する
"""

if n<2:
    ans = abs(a[-1]-w)
else:
    ans = max(abs(a[-2]-a[-1]), abs(a[-1]-w))
print(ans)

Measured memory_bytes: 9284
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


N, M, C = map(int, input().split())
B = list(map(int, input().split()))

cnt = 0
for _ in range(N):
    A = list(map(int, input().split()))
    s = sum([a*b for a, b in zip(A, B)])
    if s+C > 0:
        cnt += 1
print(cnt)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
    int h,n;
    cin >> h >> n;
    ll goukei=0;
    bool hantei=false;
    for(ll i=0; i<n; i++){
        ll a;
        cin >> a;
        goukei += a;
        if(goukei>=h){
            hantei = true;
            break;
        }
    }
    if (hantei) cout << "Yes" << endl;
    else            cout << "No" << endl;
    
    
}

Measured memory_bytes: 256
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#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 sim template < class c
#define int long long
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << '\n'; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef tree< pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
const ll MOD = 1e9 + 7 ;
const ll N = 2e5 + 10 ;
const ll INF = 1e18 + 10 ;
signed main(){
    fastio
    int n , m , k ;
    cin >> n >> m >> k ; 
    vector<int> A(n + 1) , B(m + 1) ; 
    for(int i = 0; i < n; i++){
        int x ;
        cin >> x ;
        A[i + 1] = A[i] + x ;
    }
    for(int i = 0; i < m; i++){
        int x ;
        cin >> x ;
        B[i + 1] = B[i] + x ;
    }
    int answer = 0 ;
    for(int i = 0; i < n + 1; i++){
        if ( A[i] <= k ){
            int target = k - A[i] ;
            int L = 0, R = m ;
            int ans = -1 ;
            while(L <= R){
                int mid = L + (R - L) / 2 ;
                if ( B[mid] <= target ){
                    ans = mid ;
                    L = mid + 1;
                }
                else R = mid - 1;
            }
            assert(ans != -1) ;
            answer = max(answer, i + ans) ;
        }
    }
    cout << answer << endl;
    return 0; 
}

Measured memory_bytes: 6376
#include<iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<stdlib.h>
#include<stack>
using namespace std;
#define PI 3.14159265358979
typedef  long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#include<set>
int main(void)
{
    float n,x,t;
    cin>>n>>x>>t;

    float ans = ceil(n/x);

    int tans = ans*t;
  
    cout<<tans<<endl;

}

Measured memory_bytes: 3228
N, K = (int(x) for x in input().split())
R, S, P = (int(x) for x in input().split())
T = input()

def getScore(t):
    if t == "r":
        return P
    elif t == "s":
        return R
    elif t == "p":
        return S

score=0
mycard = []
for i in range(N):
    if i < K:
        score += getScore(T[i])
        mycard.append(1)
    else:
        if mycard[i-K] == 0:
            score += getScore(T[i])
            mycard.append(1)
        else:
            if T[i] != T[i-K]:
                score += getScore(T[i])
                mycard.append(1)
            else:
                mycard.append(0)
print(score)

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

int main() {
    int n;
    cin >> n;
    vector<int> nums(n, 0);
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        cin >> nums[i];
        if (nums[i] > i || (i>0&&nums[i] > nums[i-1] + 1)) {
            cout << "-1\n";
            return 0;
        }
        if (i > 0 && nums[i] == nums[i-1] + 1) {
            ans++;
        } else {
            ans += nums[i];
        }
    }
    cout << ans << "\n";
    return 0;
}


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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

ll dfs(vector<set<ll>> &g, vector<bool> &seen, vector<ll> &depth, ll point) {
    seen[point] = true;
    ll ans = 1;
    for (auto next : g[point]) {
        if (depth[next] != 0) {
            ans = max(ans, depth[next] + 1);
            continue;
        }
        if (seen[next] && depth[next] == 0) {
            ans = mod;
            break;
        }

        ans = max(ans, dfs(g, seen, depth, next) + 1);
    }
    depth[point] = ans;
    return ans;
}

int main() {
source:
    ll n;
    cin >> n;
    ll a[n][n - 1];
    ll memo[n][n - 1];
    rep(i, n) {
        rep(j, n - 1) {
            cin >> a[i][j];
            a[i][j]--;
            ll small = min(i, a[i][j]);
            ll big = max(i, a[i][j]);
            ll index = (big - 1) * big / 2 + small;
            memo[i][j] = index;
        }
    }

    vector<set<ll>> g(n * (n - 1) / 2);

    rep(i, n) {
        rep(j, n - 2) { g[memo[i][j]].insert(memo[i][j + 1]); }
    }

    vector<bool> seen(n * (n - 1) / 2), finished(n * (n - 1) / 2);
    vector<ll> depth(n * (n - 1) / 2, 0);

    ll ans = 0;
    rep(i, n * (n - 1) / 2) {
        if (seen[i]) {
            continue;
        }
        ll temp = dfs(g, seen, depth, i);
        ans = max(ans, temp);
    }

    if (ans >= mod) {
        ans = -1;
    }
    cout << ans << endl;

    return 0;
}



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


int main() {
#ifdef HOME
    freopen("in", "r", stdin);
#endif

    int n, m;
    while (scanf("%d%d", &n, &m) == 2) {
        vector<pair<int, int> > e(m);
        for (int i = 0; i < m; i++) {
            scanf("%d%d", &e[i].first, &e[i].second);
            e[i].first--;
            e[i].second--;
        }

        vector<vector<int> > vct(n);
        for (int i = 0; i < m; i++) {
            vct[e[i].first].push_back(i);
            vct[e[i].second].push_back(i);
        }

        int ans = 0;
        for (int u = 0; u < n; u++) {
            for (int v = u + 1; v < n; v++) {
                priority_queue<pair<int, int> > q;
                vector<int> ptr(n, -2);
                ptr[u] = (int)vct[u].size() - 1;
                ptr[v] = (int)vct[v].size() - 1;
                if (ptr[u] >= 0) q.push(make_pair(vct[u][ptr[u]], u));
                if (ptr[v] >= 0) q.push(make_pair(vct[v][ptr[v]], v));
                bool ok = 1;
                while (!q.empty()) {
                    auto o = q.top();
                    q.pop();
                    //if (ptr[o.second] != o.first) continue;
                    if (ptr[e[o.first].first] != -2 && ptr[e[o.first].second] != -2) {
                        ok = 0;
                        break;
                    }
                    int v = o.second;
                    int u = e[o.first].first ^ e[o.first].second ^ v;
                    ptr[v] = lower_bound(vct[v].begin(), vct[v].end(), o.first) - vct[v].begin() - 1;
                    ptr[u] = lower_bound(vct[u].begin(), vct[u].end(), o.first) - vct[u].begin() - 1;
                    if (ptr[u] >= 0) q.push(make_pair(vct[u][ptr[u]], u));
                    if (ptr[v] >= 0) q.push(make_pair(vct[v][ptr[v]], v));
                }
                ans += ok;
            }
        }
        printf("%d\n", ans);
    }

#ifdef HOME
    cerr << clock() / (double)CLOCKS_PER_SEC << endl;
#endif
    return 0;
}


Measured memory_bytes: 2304
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String s1 = sc.nextLine();
		if (s1.equals("000")) {
			System.out.println(0);
		} else if (s1.equals("001") || s1.equals("010") || s1.equals("100")) {
			System.out.println(1);
		} else if (s1.equals("011") || s1.equals("101") || s1.equals("110")) {
			System.out.println(2);
		} else {
			System.out.println(3);
		}

	}

}


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

int main() {
	char c; cin >> c;
	bool ok = false;
	if (c == 'a') ok = true;
	if (c == 'i') ok = true;
	if (c == 'u') ok = true;
	if (c == 'e') ok = true;
	if (c == 'o') ok = true;
	if(ok) cout << "vowel" << endl;
	else cout << "consonant" << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <iomanip>
#include <cstdint>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <limits>

int main() 
{
    std::vector<int64_t> f(10010);

    for (int64_t x = 1; x <= 100; ++x) {
    for (int64_t y = 1; y <= 100; ++y) {
    for (int64_t z = 1; z <= 100; ++z) {
        int64_t v = x*x + y*y + z*z + x*y + y*z + z*x;
        if (v > 10000) continue;
        f.at(v)++;
    }
    }
    }

    int64_t N;
    std::cin >> N;

    for (int64_t i = 1; i <= N; ++i) {
        std::cout << f.at(i) << std::endl;
    }

    return 0;
}

Measured memory_bytes: 3692
#include <iostream>
#include <array>
#include <vector>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <set>

using namespace std;

typedef long long LL;
typedef vector<LL> VEC;
typedef vector<VEC> VVEC;
typedef  pair<LL,LL> P;


const LL INF=1<<30;
const LL MOD=1000000007;




int main(){

        int N;
        string S;
        int K;
        cin>>N>>S>>K;
        K--;
        for(int i=0;i<N;++i){
                if(S[i]!=S[K]){
                        S[i]='*';
                }
        }
        cout<<S<<endl;
}

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

long long choose2(long long n){
    long long ans;
    ans = n*(n-1)/2;
    return ans;
}

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
        a[i]--;
    }
    vector<int> cnt(n,0);
    for(int i=0; i<n; i++){
        cnt[a[i]]++;
    }
    long long tot;
    tot = 0;
    for(int i=0; i<n; i++){
        tot += choose2(cnt[i]);
    }
    long long ans;
    for(int i=0; i<n; i++){
        ans = tot;
        ans -= choose2(cnt[a[i]]);
        ans += choose2(cnt[a[i]]-1);
        cout << ans << endl;
    }
    return 0;
}




Measured memory_bytes: 4096
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int m = scanner.nextInt();

        final Map<Integer, List<Integer>> graph = new HashMap<>();
        for (int i = 0; i < m; i++) {
            final int u = scanner.nextInt();
            final int v = scanner.nextInt();
            graph.computeIfAbsent(u * 3, list -> new ArrayList<>()).add(v * 3 + 1);
            graph.computeIfAbsent(u * 3 + 1, list -> new ArrayList<>()).add(v * 3 + 2);
            graph.computeIfAbsent(u * 3 + 2, list -> new ArrayList<>()).add(v * 3);
        }

        final int s = scanner.nextInt() * 3;
        final int t = scanner.nextInt() * 3;
        final int[] distances = new int[(n + 1) * 3];
        Arrays.fill(distances, -1);
        distances[s] = 0;
        final Deque<Integer> queue = new ArrayDeque<>();
        queue.add(s);
        while (!queue.isEmpty()) {
            final int current = queue.pollFirst();
            final List<Integer> list = graph.get(current);
            if (list == null) {
                continue;
            }
            for (final int next : list) {
                if (distances[next] >= 0) {
                    continue;
                }
                distances[next] = distances[current] + 1;
                queue.add(next);
            }
        }

        System.out.println(distances[t] >= 0 ? distances[t] / 3 : -1);
    }
}


Measured memory_bytes: 137688
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    int max = 0;
    int temp = 0;
    string S;
    cin >> N >> S;
    for (int i = 0; i < N; ++i) {
        if (S[i] == 'I') ++temp;
        if (S[i] == 'D') --temp;
        if (temp > max) {
            max = temp;
        }
    }
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>

typedef long long ll;

#define FOR(i,a,b) for(ll i = (a);i < (b);++i)
#define REP(i,n) FOR(i,0,n)

#define debug(x) cout << #x << "=" << x << endl;

using namespace std;

int main(void){

  int waterA, waterB, sugarC, sugarD;
  int dissolveRatio;
  int limit;

  cin >> waterA >> waterB >> sugarC >> sugarD >> dissolveRatio >> limit;

  vector<int> waterAmount;
  int wlpInd = max(limit/100/waterA,limit/100/waterB);

  REP(i,wlpInd+1){
    REP(k,wlpInd+1){
      int wam = 100*waterA*i+100*waterB*k;
      if (wam <= limit) waterAmount.push_back(wam);
    }
  }
  sort(waterAmount.begin(), waterAmount.end());
  waterAmount.erase(unique(waterAmount.begin(),waterAmount.end()),waterAmount.end());
  
  vector<int> sugarAmount;
  int slpInd = max(limit/sugarC,limit/sugarD);

  REP(i,slpInd+1){
    REP(k,slpInd+1){
      int sam = sugarC*i+sugarD*k;
      if (sam <= limit) sugarAmount.push_back(sam);
    }
  }

  sort(sugarAmount.begin(), sugarAmount.end());
  sugarAmount.erase(unique(sugarAmount.begin(),sugarAmount.end()),sugarAmount.end());
  
  int ans1 = 0;
  int ans2 = 0;
  double maxCons = -1.;

  REP(i,(int)waterAmount.size()){
    REP(k,(int)sugarAmount.size()){
      int wam = waterAmount[i];
      int sam = sugarAmount[k];
      int wsSum = wam + sam;
      if(wsSum <= limit && ((wam / 100 * dissolveRatio) >= sam)){
        double consentration = 100.0 * sam / wsSum;
        if(maxCons <= consentration){
          maxCons = consentration;
          ans1 = wsSum;
          ans2 = sam;
        }
      }
    }
  }

  cout << ans1 <<" "<< ans2 << endl;

  return 0;
}


Measured memory_bytes: 1400
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int):
    if N % 2 == 0:
        print(0.5)
    else:
        print(-(-N//2)/N)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()


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

int main(void){
	double n;
	while(cin>>n){
		if(n<=48.00)cout<<"light fly"<<endl;
		else if(n<=51.0)cout<<"fly"<<endl;
		else if(n<=54.0)cout<<"bantam"<<endl;
		else if(n<=57.0)cout<<"feather"<<endl;
		else if(n<=60.0)cout<<"light"<<endl;
		else if(n<=64.0)cout<<"light welter"<<endl;
		else if(n<=69.0)cout<<"welter"<<endl;
		else if(n<=75.0)cout<<"light middle"<<endl;
		else if(n<=81.0)cout<<"middle"<<endl;
		else if(n<=91.0)cout<<"light heavy"<<endl;
		else cout<<"heavy"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3144
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007ll
#define fi first
#define se second
#define pii pair<long long,long long>
#define int long long
#define endl '\n'
#define pll pair<long long,long long>
#define LONGLONG_MAX 100000000000000
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a);}
                a=(a*a);
                b>>=1;
        }
    return ans;
        
}
int dp[25][1<<21];
int a[25][25];
int fun(int i,int mask,int n){
    if(i==n)return 1;
    if(dp[i][mask]!=-1)return dp[i][mask];
    int ans=0;
    for(int j=0;j<n;j++){
        if((mask&(1ll<<j)))continue;
        if(a[i][j]==1){
            ans+=fun(i+1,(mask+(1ll<<j)),n);
            ans%=mod;
        }
    }
    return dp[i][mask]=ans;
}
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    srand(time(0));
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>a[i][j];
        }
    }
    memset(dp,-1,sizeof(dp));
    cout<<fun(0,0,n);
    return 0;
}

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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;

//status unsolved
int main(){
    long long n;
    cin>>n;
    cout<<((1+(n-1))*(n-1))/2<<endl;
    return 0;

}
/*


*/


Measured memory_bytes: 256
// ProblemURL : https://atcoder.jp/contests/abc072/tasks/abc072_c
// ---------------------------------------------
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	as := make([]int, n)
	for i := range as {
		fmt.Scan(&as[i])
	}
	cts := make([]int, 1e5+10)
	for _, a := range as {
		if a-1 >= 0 {
			cts[a-1]++
		}
		cts[a]++
		cts[a+1]++
	}

	mx := 0
	for i := range cts {
		if cts[i] > mx {
			mx = cts[i]
		}
	}
	fmt.Println(mx)
}


Measured memory_bytes: 5504
#include <iostream>

using namespace std;

int main()
{
    int i, ans, a, b, c;
    
    cin >> a >> b >> c;
    ans = 0;
    for(i=a; i<=b; i++)
    {
        if(c%i==0)
         ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3116
#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  bool b=false;
  for(int i=1; i<=9; i++){
    if(n%i!=0) continue;
    int d=n/i;
    if(d>=1 && d<=9) b=true;
  }
  if(b) cout << "Yes";
  else cout << "No";
  return 0;
}

Measured memory_bytes: 256
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,m = readInts()
A = readInts()
sumA = sum(A)
div = sumA * (1/(4*m))
A = sorted(A,reverse=True)
for i in range(m):
    if A[i] < div:
        print('No')
        exit()
print('Yes')


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

int main(){
    string s;
    cin >> s;
    if(s[2]==s[3]&&s[4]==s[5]){
        puts("Yes");
        return 0;
    }
    puts("No");
    return 0;

}

Measured memory_bytes: 256
N, Q = map(int, input().split())
S = input()

t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Measured memory_bytes: 7748
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int[] t = new int[n];
			int sum = IntStream.range(0, n).map(i -> t[i] = scanner.nextInt()).sum();
			int m = scanner.nextInt();
			int[] p = new int[m], x = new int[m];
			IntStream.range(0, m).forEach(i -> {
				p[i] = scanner.nextInt() - 1;
				x[i] = scanner.nextInt();
			});
			IntStream.range(0, m).map(i -> sum - t[p[i]] + x[i]).forEach(System.out::println);
		}
	}
}


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

#define int long long

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

int a,b;

signed main() {
    cin >>a>>b;
    if(a>0){
        cout<<"Positive"<<endl;
        return 0;
    }
    if(b>=0){
        cout<<"Zero"<<endl;
        return 0;
    }
    if((b-a)%2==0){
        cout<<"Negative"<<endl;
    }else{
        cout<<"Positive"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256