akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define all(c) begin(c),end(c)
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//最大公約数
ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}
//最小公倍数
ll lcm(ll x, ll y) {
  return x/gcd(x, y)*y;
}
//素因数分解
vector<pair<ll,int>> factorize(ll n) {
  vector<pair<ll,int>> res;
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i) continue;
    res.emplace_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n,1);
  return res;
}
 
 
 
 
int main() {
  int a,b;
  cin>>a>>b;
  int c;
  c=a-2*b;
  if(c<0){
    cout<<'0';
    return 0;
  }
  cout<<c;
}




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

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	ll r[200000], n;
  cin >> n;
  rep(i, n) cin >> r[i];

  ll maxv = -2000000000;
  ll minv = r[0];

  FOR(i, 1, n) {
    maxv = max(maxv, r[i] - minv);
    minv = min(minv, r[i]);
  }

  cout << maxv << endl;
  return 0;
}


Measured memory_bytes: 4736
import java.util.*;

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

        int N = sc.nextInt();
        int Y = sc.nextInt();

        // 1000, 5000, 10000 yen

        for (int i = 0; i <= N; i++) {
            for (int j = 0; j <= N - i; j++) {
                int k = N - i - j;

                if (1000 * i + 5000 * j + 10000 * k == Y) {
                    System.out.println(String.format("%d %d %d", k, j, i));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
}

Measured memory_bytes: 23764
#include <stdio.h>
 
int main() {
  char w[2000];
  int w_long;
  scanf("%s", w);
  w_long = strlen(w);

  if(w[w_long -1]=='s'){
    w[w_long] = 'e';
    w[w_long +1] = 's';
    w[w_long+2]='\0';
  }else{
    w[w_long] = 's';
    w[w_long+1]='\0';
  }
  
  printf("%s" ,w);
 
	return 0;
}

Measured memory_bytes: 1736
s=input()
if s=='SUN':
    print(7)
elif s=='MON':
    print(6)
elif s=='TUE':
    print(5)
elif s=='WED':
    print(4)
elif s=='THU':
    print(3)
elif s=='FRI':
    print(2)
elif s=='SAT':
    print(1)
    

Measured memory_bytes: 2940
"use strict";
function main(input) {
    let line = input.split(/\r?\n/g);
    let arr = line[0].split(" ");
    const H = arr[0], N = arr[1];
    let A = line[1].split(" ");
    let accum = 0;
    for (let i in A)
        accum += parseInt(A[i]);
    console.log(accum < H ? "No" : "Yes");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 19532
from Queue import * # Queue, LifoQueue, PriorityQueue
from bisect import * #bisect, insort
from collections import * #deque, Counter,OrderedDict,defaultdict
#set([]) 
import math
import copy
import itertools
import string
import sys
myread = lambda : map(int,raw_input().split())
def solver():
    N = int(raw_input())
    K = int(raw_input())
    X = int(raw_input())
    Y = int(raw_input())
    if N <= K:
        print N * X
    else:
        print K * X + (N-K) * Y 




if __name__ == "__main__":
    solver()
    


Measured memory_bytes: 3292
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		String s = next();
		int count = 0;
		for(int i = 0; i < s.length(); i++){
			count += Integer.parseInt(s.substring(i, i + 1));
		}
		myout((count % 9 == 0) ? "Yes" : "No");
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 45912
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var ab = ReadSplitInt();
            Func<int, int, string> func = (x, y) =>
            {
                var a = new List<int>();
                for (int i = 0; i < y; i++)
                    a.Add(x);

                return string.Join("", a);
            };
            Println(ab[0] < ab[1] ? func(ab[0], ab[1]) : func(ab[1], ab[0]));
        }

        static List<long> ReadLines(long n)
        {
            var l = new List<long>();
            for (long i = 0; i < n; i++)
            {
                l.Add(ReadLong());
            }
            return l;
        }

        static void YESOrNO(bool e) => Println(e ? "YES" : "NO");

        static void YesOrNo(bool e) => Println(e ? "Yes" : "No");

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int SumDigits(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static long Gcd(long a, long b) => b == 0 ? a : Gcd(b, a % b);
        static long Lcm(long a, long b) => a / Gcd(a, b) * b;

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());
        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}



Measured memory_bytes: 13396
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define repp(i, m, n) for(int i = m; i < n; i++)
#define reps(i, n) for(int i = 1; i <= n; i++)
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;



int main()
{
	int R, C, m, x, y, z, w;
	ll p1, p2;
	cin >> R >> C >> m;
	int n=0;
	pair<ll, int> e[200010];
	rep(i, m)
	{
		cin >> x >> y;
		if(x==0 || x==R || y==0 || y==C)
		{
			if(x==0)
			{
				if(y==0) p1=0;
				else p1=2*(R+C)-y;
			}
			else if(x==R) p1=R+y;
			else if(y==0) p1=x;
			else p1=R+C+R-x;
			p2=p1;
			cin >> x >> y;
			if(x==0 || x==R || y==0 || y==C)
			{
				if(x==0)
				{
					if(y==0) p1=0;
					else p1=2*(R+C)-y;
				}
				else if(x==R) p1=R+y;
				else if(y==0) p1=x;
				else p1=R+C+R-x;
				if(p1>p2) swap(p1, p2);
				e[n]=make_pair(p1, i);
				n++;
				e[n]=make_pair(p2, i);
				n++;
			}
		}
		else cin >> x >> y;
	}
	sort(e, e+n);
	stack <int> st;
	int tmp, muri=0;
	int sude[100010]={};
	rep(i, n)
	{
		tmp=e[i].second;
		if(sude[tmp]==0)
		{
			st.push(tmp);
			sude[tmp]=1;
		}
		else
		{
			if(tmp!=st.top())
			{
				muri=1;
				break;
			}
			else st.pop();
		}
	}
	if(muri==0) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 3968
import java.util.Scanner;

public class Main {
	static final long mod = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 0;
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		int[] color = new int[3];

		if(a[0] == 0) {
			ans = 3;
			color[0] = 1;
			int x = 0;
			boolean flag = true;
			for (int i = 1; i < n; i++) {
				x = 0;
				flag = true;
				for(int j = 0; j < 3; j++) {
					if(color[j] == a[i]) {
						x++;
						if(flag) {
							color[j]++;
							flag = false;
						}
					}
				}
				ans = (x*ans)%mod;
			}

		}else {
			ans = 0;
		}

		System.out.println(ans);
		sc.close();
	}
}

Measured memory_bytes: 50604
import sys
from math import pi
# import bisect
# from collections import deque

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7

# def ncr(n, r, p): 
#     # initialize numerator 
#     # and denominator 
#     num = den = 1 
#     for i in range(r): 
#         num = (num * (n - i)) % p 
#         den = (den * (i + 1)) % p 
#     return (num * pow(den,  
#             p - 2, p)) % p 
  
n,k=  Ri()
n+=1
pre = [0]*(n)
for i in range(n):
    if i==0:
        pre[i] = i
    else:
        pre[i] = pre[i-1]+i
suf = [0]*(n)
for i in range(n-1,-1,-1):
    if i ==n-1:
        suf[i] = n-1
    else:
        suf[i] = suf[i+1]+i
summ = 0
for i in range(k,n+1):
    dif =suf[n-i]-pre[i-1]+1
    # print(dif)
    summ+=dif
    summ = summ%MOD
print(summ)


Measured memory_bytes: 69068
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>

using namespace std;

int main()
{
	int n;
	cin >> n;
	for(int i=1;i<10;i++)
		for(int j=1;j<10;j++)
			if(i*j==n)
			{
				cout << "Yes" << endl;
				return 0;
			}

	cout << "No" << endl;


}


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

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;++i){
        cin>>v[i];
    }
    vector<int>vv=v;
    sort(v.begin(),v.end());
    int a=2e9,ans=0;
    for(int i=0;i<n-1;++i){
        int so=v[n-1]-v[i];
        int sa=abs(v[i]-so);
        if(a>sa){
            ans=v[i];
            a=sa;
        }
    }
    cout<<v[n-1]<<" "<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
import collections

# デバッグ用
DEBUG = False
# DEBUG = True

# 宣言
result = 'No'

# 入力部
if DEBUG:
    N = '99'
else:
    N = input()

# 処理部
if N.find('9') >= 0:
    result = 'Yes'
else:
    result = 'No'

# 出力部
print(result)

Measured memory_bytes: 3444
#include<iostream>
#include<complex>
#include<algorithm>
#include<cmath>

#define EPS (1e-10)
#define fs first
#define sc second

using namespace std;

typedef complex<int> P;
typedef pair<P,P> L;

//for vector

int dot(P x,P y){return real(conj(x)*y);}

int cross(P x,P y){return imag(conj(x)*y);}

double dis(P x, P y){
  return sqrt( (real(x)-real(y))*(real(x)-real(y)) 
	       + (imag(x)-imag(y))*(imag(x)-imag(y)) );
}

double norm(P x){return sqrt(real(x)*real(x) + imag(x)*imag(x) );}

//for line(segment)
int ccw(P a,P b,P c){
  b -= a;c -= a;
  if (cross(b,c)>EPS) return 1;   //counter clockwise
  if (cross(b,c)<-EPS) return -1; //clockwise
  if (dot(b, c)<-EPS) return 2;   //c--a--b on line
  if (norm(b)<norm(c)) return -2;   //a--b--c on line
  return 0;                       //on segment
}

double seg_dis(L a,P x){
  if(dot(a.sc-a.fs,x-a.fs)<EPS)return dis(x,a.fs);
  if(dot(a.fs-a.sc,x-a.sc)<EPS)return dis(x,a.sc);
  return abs((double)cross(a.sc-a.fs,x-a.fs))/dis(a.sc,a.fs);
}

bool is_cp(L a,L b){
  if(ccw(a.fs,a.sc,b.fs)*ccw(a.fs,a.sc,b.sc)<=0)
    if(ccw(b.fs,b.sc,a.fs)*ccw(b.fs,b.sc,a.sc)<=0)return true;
  return false;
}

double seg_close(L a, L b){
  double res = 1e10;
  res = min(res, seg_dis(a,b.first));
  res = min(res, seg_dis(a,b.second));
  res = min(res, seg_dis(b,a.first));
  res = min(res, seg_dis(b,a.second));
  return res;
}

int main(){
  int n,sx,sy,ex,ey;
  int x1,y1,x2,y2,h;

  while(cin >> n ,n){
    cin >> sx >> sy >> ex >> ey;
    L l = L(P(sx,sy),P(ex,ey));

    double r = 100000.0;
    for(int i=0;i<n;i++){
      cin >> x1 >> y1 >> x2 >> y2 >> h;
      if(r<EPS)continue;

      if(x1>x2)swap(x1,x2);
      if(y1>y2)swap(y1,y2);
      L A = L(P(x1,y1),P(x1,y2));
      L B = L(P(x1,y2),P(x2,y2));
      L C = L(P(x2,y2),P(x2,y1));
      L D = L(P(x2,y1),P(x1,y1));

      if(is_cp(l,A))r = 0.0;
      else if(is_cp(l,B))r = 0.0;
      else if(is_cp(l,C))r = 0.0;
      else if(is_cp(l,D))r = 0.0;
      else if(x1<=sx && sx<=x2 && y1<=sy && sy<=y2)r = 0.0;
      else{
	double dis = min(min(seg_close(l,A),seg_close(l,B)),
			 min(seg_close(l,C),seg_close(l,D)));
	if(dis<h)r = min(r,dis);
	else r = min(r,(h*h+dis*dis)/(2*h));
      }
    }
    cout << r << endl;
  }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vll vector<ll>
#define vbool vector<bool>
#define INF 1000000009
using P = pair<int,int>;
 
int main() {
  int n;
  cin >> n;
  vint A(n);
  vint B(n);
  rep(i,n) cin >> A[i];
  rep(i,n) cin >> B[i];
  ll ans = 0;
  rep(i,n){
    if(A[i] < B[i]){
      ans += (B[i] - A[i])/2;
    }
    else{
      ans -= A[i] - B[i];
    }
  }
  if(ans < 0) cout << "No" << endl;
  else cout << "Yes" << endl;
}

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

int main() {
  
  string S;
  cin >> S;
  
  if (S.at(5) == '0' && S.at(6) == '1') {
    cout << "Heisei" << endl;
  }
  else if (S.at(5) == '0' && S.at(6) == '2') {
    cout << "Heisei" << endl;
  }
  else if (S.at(5) == '0' && S.at(6) == '3') {
    cout << "Heisei" << endl;
  }
  else if (S.at(5) == '0' && S.at(6) == '4') {
    cout << "Heisei" << endl;
  }
  else {
    cout << "TBD" << endl;
  }

return 0;
}

Measured memory_bytes: 3572
def main():
    dam = int(input())
    water = list(map(int, input().split()))
    answer = [0] * dam
    answer[0] = sum(water) - 2 * sum(water[1::2])
    for i in range(1, dam):
        answer[i] = 2 * water[i - 1] - answer[i - 1]
    print(" ".join(map(str, answer)))


if __name__ == '__main__':
    main()



Measured memory_bytes: 19092
import numpy as np
import sys
input = sys.stdin.readline
N, W = map(int, input().split())
vmax = 1000*100+1
wmax = 100*10**9
dp = np.ones(vmax, dtype='int64') * wmax
dp[0] = 0

for i in range(N):
    wi, vi = map(int, input().split())
    dp[vi:] = np.fmin(dp[vi:], dp[:-vi] + wi)

print(np.where(dp<=W)[0][-1])



Measured memory_bytes: 23772
//Compiler optimization
#pragma GCC optimize("Ofast")

//include
#include <bits/stdc++.h>
using namespace std;

//typedef
typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef string S;
typedef queue<int> qi;
typedef pair<ll,ll> P;
typedef vector<P> vp;
typedef vector<vl> mat;

//macro
#define reverse(a) reverse(a.begin(),a.end())
#define unique(a) a.erase(unique(a.begin(),a.end()),a.end())
#define fr(i,n)for(ll i=0;i<(n);i++)
#define ifr(i,n)for(ll i=(n)-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define each(x, v) for (auto &x : v)

//abbreviation
#define pb push_back
#define elif else if
#define mp make_pair
#define endl '\n'

//debug
#define debug(x) cerr << #x << ": " << x << endl
#define v_debug(v) cerr << #v << endl;fr(i,v.size()) cerr << i << ": " << v[i] << endl

//const
const  ll INF = 1e18;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << setprecision(20);
    int n,k;cin >> n >> k;
    vl p(n);
    fr(i,n)cin >> p[i];
    sort(all(p));
    v_debug(p);
    ll ans = 0;
    fr(i,k)ans+=p[i];
    cout << ans << endl;
}

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

using namespace std;

#define ll long long
#define ld long double
#define P pair<ll, ll>

#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

#define all(v) v.begin(), v.end()

#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

#define cout(n) cout << fixed << setprecision(n)

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

class Combination {
 public:
  Combination(ll _max_n, ll mod_val = LLONG_MAX) : max_n(_max_n), dp(max_n + 1, std::vector<ll>(max_n + 1)) {
    // Pascal's triangle
    for (ll n = 0; n <= max_n; n++) {
      dp[n][0] = 1; // nC0
      dp[n][n] = 1; // nCn
    }
    for (ll n = 2; n <= max_n; n++) {
      for (ll k = 1; k < n; k++) {
        dp[n][k] = (dp[n - 1][k - 1] + dp[n - 1][k]) % mod_val;
      }
    }
  }

  // return nCk
  ll get(ll n, ll k) {
    return dp[n][k];
  }

 private:
  ll max_n;
  std::vector<std::vector<ll>> dp;
};

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

  ll n, k;
  cin >> n >> k;

  const ll r = n - k;
  // ans = (r+1)Ci * (k-1)C(i-1)

  Combination combination(n, mod);

  REP(i, k + 1) {
    ll ans = combination.get(r + 1, i) * combination.get(k - 1, i - 1);
    ans %= mod;
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 31616
//なんかcharがアレだからstringだけでがんばるやつやりたいあとでいつか

#include<bits/stdc++.h>
using namespace std;

int main(){
  int h,w;
  cin >>h >>w;
string temp;
  
  
  vector<vector<char>> s(h,vector<char>(w));
  
  for(int i=0;i<h;i++){
    cin >>temp;
  for(int j=0;j<w;j++){
  s.at(i).at(j)=temp.at(j);
    
  }
  }

  
  /*　入力をみたい

  for(int i=0;i<h;i++){
  for(int j=0;j<w;j++){

    if(j==w-1){
    cout <<s.at(i).at(j)<<endl;}
    else{cout <<s.at(i).at(j);}
  }
  }
*/
  
  
  
  int c=0;
    for(int i=0;i<h;i++){
  for(int j=0;j<w;j++){
    
    if(s.at(i).at(j)!='#'){
      
    
  if(i-1>=0 && j-1>=0){
    if(s.at(i-1).at(j-1)=='#'){c++;}}
      
    if(i-1>=0 && j>=0){
    if(s.at(i-1).at(j)=='#'){c++;}}

      if(i-1>=0 && w>j+1){
    if(s.at(i-1).at(j+1)=='#'){c++;}}

      if(j-1>=0){
    if(s.at(i).at(j-1)=='#'){c++;}}

      

      if(i>=0 && w>j+1){
    if(s.at(i).at(j+1)=='#'){c++;}}
      
      if(h>i+1 && j-1>=0){
    if(s.at(i+1).at(j-1)=='#'){c++;}}
      
      if(h>i+1){
    if(s.at(i+1).at(j)=='#'){c++;}}
      
      if(h>i+1 && w>j+1){
    if(s.at(i+1).at(j+1)=='#'){c++;}}
                  
      
 /*     string temp;
      temp=to_string(c);
    s.at(i).at(j)=temp;
*/                                
      s.at(i).at(j)='0'+c;

                                  c=0;
                                }
  }
  }

  for(int i=0;i<h;i++){
  for(int j=0;j<w;j++){

    if(j==w-1){
    cout <<s.at(i).at(j)<<endl;}
    else{cout <<s.at(i).at(j);}
  }
  }

  
                    }

Measured memory_bytes: 256
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    BigDecimal a = new BigDecimal(sc.next());
    BigDecimal b = new BigDecimal(sc.next());
    b = b.multiply(a);
    long p = b.longValue();

    System.out.println(p);
  }
}

Measured memory_bytes: 35888
# https://atcoder.jp/contests/agc022/tasks/agc022_b

N = int(input()) - 3

L = [2, 3, 25]
A = L[:]
i = 2
while N >= 2:
    if i not in L and any(i % l == 0 for l in L):
        A += (30000 - i, i)
        N -= 2
    i += 1

if N == 1:
    A.append(30000)

print(*A)


Measured memory_bytes: 4448
import sys
input = sys.stdin.readline

S = list(input())
S.pop(-1)

Month_first_flag = 1
Month_next_flag = 1

if S[0] != '0' and S[0] != '1':
    Month_first_flag = 0

if S[0] == '0':
    if S[1] == '0':
        Month_first_flag = 0

if S[0] == '1':
    if S[1] != '0' and S[1] != '1' and S[1] != '2':
        Month_first_flag = 0

if S[2] != '0' and S[2] != '1':
    Month_next_flag = 0

if S[2] == '0':
    if S[3] == '0':
        Month_next_flag = 0

if S[2] == '1':
    if S[3] != '0' and S[3] != '1' and S[3] != '2':
        Month_next_flag = 0

if Month_first_flag == 1 and Month_next_flag == 1:
    print("AMBIGUOUS")
    sys.exit(0)
if Month_first_flag == 1 and Month_next_flag == 0:
    print("MMYY")
    sys.exit(0)
if Month_first_flag == 0 and Month_next_flag == 1:
    print("YYMM")
    sys.exit(0)
else:
    print("NA")

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

int main() {
	ll h,w;
	cin>>h>>w;
	if(h==1||w==1){
		cout << 1;
	}
	else{
		cout << (h*w+1)/2;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 3552
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long 
int F[2100010];

int Mul(int a, int b) {
	return ((a % mod) * (b % mod)) % mod;
}

void fact(void) {
	F[0] = 1;
	F[1] = 1;
	for (int i = 2; i <= 2100000; i++) {
		F[i] = Mul(i, F[i - 1]);
	}
}
int square(int x) {
	return (x * x) % mod;
}

int power(int x, int y) {
	if (y == 0) return 1;
	else if (y == 1) return x % mod;
	else if (y % 2 == 0) return square(power(x, y / 2)) % mod;
	else return square(power(x, y / 2)) * x % mod;
}

int Div(int a, int b) {
	return Mul(a, power(b, mod - 2));
}
int P(int n, int r) {
	if (n < r || n < 0 || r < 0) return 0;
	return Div(F[n], F[n - r]);
}

int C(int n, int r) {
	if (n < r || n < 0 || r < 0) return 0;
	int ret;
	ret = Div(F[n], Mul(F[n - r], F[r]));
	return ret;
}
int H(int n, int r) {
	if (n == 0 && r == 0) return 1;
	return C(n + r - 1, r);
}

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    fact();
    cin >> n >> k;
    rep(i, k) {
        cout << Mul(C(n - k + 1, i + 1), Div(F[k - 1], Mul(F[i], F[k - i - 1]))) << endl;
        //cout << C(n - k + 1, i + 1) << " " << Div(F[k - 1], Mul(F[i], F[k - i - 1])) << endl;
    }



    return 0;
}
// o x o x o  | C(3, 1) * oo
// o x o x o  | C(3, 2) * |o
// ||v

Measured memory_bytes: 16640
#include <iostream>
#include <vector>
using namespace std;
int main(){
  int a,b,i,j;
  while(1){
  cin>>a;
  if(a==0) break;
  vector<char>from(a);
  vector<char>to(a);
  for(i=0;i<a;i++){
    cin>>from[i]>>to[i];
  }
  cin>>b;
  vector<char>v(b);
  for(i=0;i<b;i++){
    cin>>v[i];
    for(j=0;j<a;j++){
      if(v[i]==from[j]){
        v[i]=to[j];
        break;
      }
    }
  }
  for(i=0;i<b;i++){
    cout<<v[i];
  }
  cout<<"\n";
}
return 0;
}

Measured memory_bytes: 3084
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>

using namespace std;

int main(){
    int n, ans = 0;
    cin >> n;
    multiset<long long> ms;
    for(int i = 0; i < n; i++){
        long long x;
        cin >> x;
        ms.insert(x);
    }
    auto itr = --ms.end();
    long long t = 1;
    while(*itr >= t) t <<= 1;
    while(!ms.empty()){
        itr = --ms.end();
        long long x = *itr;
        ms.erase(itr);
        while(2 * x < t) t >>= 1;
        auto itr2 = ms.find(t - x);
        if(itr2 != ms.end()){
            ans++;
            ms.erase(itr2);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 9600
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int n = sc.nextInt();
			int m = sc.nextInt();
			int s = sc.nextInt();
			int g1 = sc.nextInt();
			int g2 = sc.nextInt();
			if(n==0 && m==0 && s==0 && g1==0 && g2==0) break;
			
			int[][] cost = new int[n+1][n+1];
			for(int i=1;i<=n;i++){
				for(int j=1;j<=n;j++){
					cost[i][j] = Integer.MAX_VALUE;
				}
			}
			for(int i=0;i<m;i++) cost[sc.nextInt()][sc.nextInt()] = sc.nextInt();
			for(int i=1;i<=n;i++) cost[i][i] = 0;
			
			for(int i=1;i<=n;i++){
				for(int j=1;j<=n;j++){
					for(int k=1;k<=n;k++){
						if(cost[j][i]!=Integer.MAX_VALUE && cost[i][k]!=Integer.MAX_VALUE){
							cost[j][k] = Math.min(cost[j][k], cost[j][i]+cost[i][k]);
						}
					}
				}
			}
			
			int min = Integer.MAX_VALUE;
			for(int i=1;i<=n;i++){
				if(cost[s][i]!=Integer.MAX_VALUE && cost[i][g1]!=Integer.MAX_VALUE && cost[i][g2]!=Integer.MAX_VALUE){
					min = Math.min(min, cost[s][i] + cost[i][g1] + cost[i][g2]);
				}
			}
			System.out.println(min);
		}	
	}	
}

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

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const lint MOD   = 1e9 + 7;
const double EPS = 1e-10;

int main() {
    lint N, A, B;
    cin >> N >> A >> B;
    lint ans = 0ll;
    ans += A * (N / (A + B));
    N = N % (A + B);
    if (A <= N)
        ans += A;
    else
        ans += N;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
        int n,i,j,fst,sec,fs;

        scanf("%d",&n);

        int a[n];

        for(i=0;i<n;i++)
                scanf("%d",&a[i]);

        fst=0;sec=0;fs=0;
        for(i=0;i<n;i++){
                if(a[i]>fst){ fst=a[i]; fs=i;}
                else if(a[i]>sec) sec=a[i];
        }
        for(i=0;i<n;i++){
                if(fs==i) printf("%d\n",sec);
                else printf("%d\n",fst);
        }
        return 0;
}


Measured memory_bytes: 2304
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
a = -1
b = -1

N_list = [i for i in range(1, N+1)]

permutations = list(itertools.permutations(N_list, N))

for i in range(len(permutations)):
    if P == permutations[i]:
        a = i + 1

for j in range(len(permutations)):
    if Q == permutations[j]:
        b = j + 1

print(abs(a-b))


Measured memory_bytes: 8052
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAX = 10005;
const int MOD = 1e9+7;
const int INF = 0x3f3f3f3f;

bool cmp(int a, int b)
{
    return a > b;
}
int main()
{
    int n, k;
    int a[55];
    int len = 0;
    cin >> n >> k;
    for(int i = 0; i < n; ++i)
        cin >> a[i];
    sort(a, a+n,cmp);
    for(int i = 0; i < k; ++i)
        len += a[i];
    cout <<len <<endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<P,ll> PPI;
typedef pair<ll,P> PIP;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
#define PQ(T) priority_queue<T,vector<T>,greater<T>>
#define PQ2(T) priority_queue<T>
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) ((x)=min((x),(y)))
#define chmax(x,y) ((x)=max((x),(y)))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
#define DEBUG(x) cerr<<"line ("<<__LINE__<<")  "<<#x<<": "<<x<<endl;
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	ll a, b, c, x;
	cin>>a>>b>>c>>x;
	ll res = 0;
	rep(i, a+1) rep(j, b+1) rep(k, c+1)
		if(i*500+j*100+k*50==x) res++;
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define N 5002
using namespace std;
long long n,a,b,i,j,f[N],sl,ma,p[N];
int main()
{
   // freopen("ntu.inp","r",stdin);
   // freopen("ntu.out","w",stdout);
    cin>>n>>a>>b;
    for(i=1;i<=n;i++) cin>>p[i];
    p[n+1]=n+1;
    for(i=1;i<=n+1;i++)
    {
        ma=-1; sl=0; f[i]=round(1e18);
        for(j=i-1;j>=0;j--)
            if(p[j]>p[i]) sl++;
            else
            {
                if(ma<p[j]) f[i]=min(f[i],f[j]+sl*a+(i-j-1-sl)*b);
                ma=max(ma,p[j]);
            }
    }
    cout<<f[n+1];
}


Measured memory_bytes: 384
use input::Input;

fn main() {
    let mut input = Input::default();

    let mut t = input.parse::<String>().chars().collect::<Vec<char>>();

    for i in 0..t.len() {
        if t[i] == '?' {
            t[i] = 'D';
        }
        print!("{}", t[i]);
    }
    println!("");
}

#[allow(dead_code)]
pub mod input {
    #[derive(Default)]
    pub struct Input(Vec<String>);

    impl Input {
        pub fn read_line(&mut self) -> String {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).ok().expect("read error");
            s
        }
        pub fn parse<T: std::str::FromStr>(&mut self) -> T {
            let x = if let Some(x) = self.0.pop() {
                x
            } else {
                let s = self.read_line();
                self.0 = s.split_whitespace().map(String::from).rev().collect();
                self.0.pop().expect("reached EOF")
            };
            x.parse().ok().expect("parse error")
        }
    }
}


Measured memory_bytes: 3152
#include<bits/stdc++.h>
using namespace std;
#define MOD ((int)(1e9+7))
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define float long double
#define LLONG_MAX 1e15
int lower_then_left_right(vector<int>&A,vector<int>&B,int x)
{
	int c=LLONG_MAX;
	auto it=upper_bound(A.begin(),A.end(),x);
	
		it--;
		int y=*it;
		auto it2=upper_bound(B.begin(),B.end(),y);
		auto it3=lower_bound(B.begin(),B.end(),y);
		{
			it2--;
			int z=*it2;
			c=min(c,abs(x-y)+abs(y-z));
		}
		{
			
			int z=*it3;
			c=min(c,abs(x-y)+abs(y-z));
		}
	
	return c;
}

int upper_then_left_right(vector<int>&A,vector<int>&B,int x)
{
	int c=LLONG_MAX;
	auto it=lower_bound(A.begin(),A.end(),x);
	
		int y=*it;
		auto it2=upper_bound(B.begin(),B.end(),y);
		auto it3=lower_bound(B.begin(),B.end(),y);
		{
			it2--;
			int z=*it2;
			c=min(c,abs(x-y)+abs(y-z));
		}
		
		{
			
			int z=*it3;
			c=min(c,abs(x-y)+abs(y-z));
		}
	return c;
}
		
	
		
int32_t main()
{
	IOS
	int n,m,q;cin>>n>>m>>q;
	vector<int>A(n),B(m);
	for(int i=0;i<n;i++)cin>>A[i];
	for(int i=0;i<m;i++)cin>>B[i];
	A.push_back(1e15);
	A.push_back(-1e15);
	B.push_back(1e15);
	B.push_back(-1e15);
	sort(A.begin(),A.end());
	sort(B.begin(),B.end());
	while(q--)
	{
		int x;cin>>x;
		int c1=lower_then_left_right(A,B,x);
		int c2=lower_then_left_right(B,A,x);
		int c3=upper_then_left_right(A,B,x);
		int c4=upper_then_left_right(B,A,x);
		cout<<min({c1,c2,c3,c4})<<endl;
	}
		
}
	
			
	
	
	
	
	

	

	

	
		


Measured memory_bytes: 2912
#include<bits/stdc++.h>
#pragma GCC optimize("O3")
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define mod 1000000007

using namespace std;

typedef long long ll;

string a, b;

int st[2050];
int dr[2050];

int mx1[2050];
int mx2[2050];
int getans()
{
    int n = a.size(), i, j;

    for(i = 0; i < n; i++)
        if(b[i] == '1')
            break;

    if(i >= n)
    {
        for(i = 0; i < n; i++)
            if(a[i] == '1')
                return (1<<30);
        return 0;
    }

    for(i = 0; i < n; i++)
    {
        for(j = i; ; j--)
            if(b[(j + n) % n] == '1')
                break;
        st[i] = j;
        for(j = i; ; j++)
            if(b[j%n] == '1')
                break;
        dr[i] = j;
    }

    int rv = (1<<30);
    for(i = 0; i < n; i++)
    {
        vector <pair<int, int> > Vu;
        int x = i;
        for (j = 0; j < n; j++)
        {
            if(a[j] == b[(j - i + n) % n])
                continue;
            x++;
            int s = -i + j, e = j;
            if(st[e] >= s)
                continue;
            Vu.pb({dr[e] - e, (s+n)%n - st[(s+n)%n]});
        }
        sort(Vu.begin(), Vu.end());

        mx1[0] = 0;
        for(j = 0; j < Vu.size(); j++)
            mx1[j + 1] = max(mx1[j], Vu[j].first);
        mx2[Vu.size()] = 0;
        for(j = (int)Vu.size() - 1; j >= 0; j--)
            mx2[j] = max(mx2[j + 1], Vu[j].second);

        for(j = 0; j <= Vu.size(); j++)
            rv = min(rv, x + 2 * (mx1[j] + mx2[j]));
    }
    return rv;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> a;
    cin >> b;
    int n = a.size();
	int ans = getans();
	reverse(a.begin(), a.end());
	reverse(b.begin(), b.end());
	ans = min(ans, getans());
	if(ans == (1<<30))
        cout << -1;
    else
        cout << ans;
    return 0;
}


Measured memory_bytes: 384
using System;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var s = Console.ReadLine();

            var redNum = 0;
            foreach (var item in s)
            {
                if (item == 'R')
                {
                    redNum++;
                }
            }

            var output = (redNum > N / 2) ? "Yes" : "No";
            Console.WriteLine(output);
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using i64 = long long;
using P = std::pair<i64, i64>;

template <typename T>
T dist(T a, T b, T c, T d) {
    return (a - c) * (a - c) + (b - d) * (b - d);
}

template <typename T>
T dist(std::pair<T, T> &a, std::pair<T, T> &b) {
    return dist(a.first, a.second, b.first, b.second);
}

int main() {
    int n;
    std::cin >> n;
    std::vector<std::pair<i64, i64>> v;
    for (int i = 0; i < n; i++) {
        i64 x, y;
        std::cin >> x >> y;
        v.emplace_back(x, y);
    }

    double ret = 1000000000;
    for (int i = 0; i < n; i++) for (int j = 0; j < i; j++) {
        double x = (v[i].first + v[j].first) / 2., y = (v[i].second + v[j].second) / 2.;
        double d = dist<double>(x, y, v[i].first, v[i].second);
        bool flg = true;
        for (int k = 0; k < n; k++) if (k != i && k != j) {
            if (dist<double>(x, y, v[k].first, v[k].second) - d > 1e-6) flg = false;
        }
        if (flg) ret = std::min(ret, d);
    }

    for (int i = 0; i < n; i++) for (int j = 0; j < i; j++) for (int k = 0; k < j; k++) {
        bool flg = true;
        i64 a = dist(v[j], v[k]), b = dist(v[k], v[i]), c = dist(v[i], v[j]);
        i64 p = a * (b + c - a), q = b * (c + a - b), r = c * (a + b - c);
        i64 deno = p + q + r;
        double x = (p * v[i].first + q * v[j].first + r * v[k].first) / (double)deno,
            y = (p * v[i].second + q * v[j].second + r * v[k].second) / (double)deno;
        double d = dist<double>(x, y, v[i].first, v[i].second);
        if (d >= ret) continue;
        for (int index = 0; index < n; index++) {
            if (index == k || index == j || index == i) continue;
            double dd = dist<double>(x, y, v[index].first, v[index].second);
            if (dd - d > 1e-6) {
                flg = false;
                break;
            }
        }
        if (flg) ret = std::min(ret, d);
    }

    std::cout << std::fixed << std::setprecision(10) << std::sqrt(ret) << std::endl;

    return 0;
}


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

int main()
{
    int d;
    cin>>d;
    if(d==25)
        cout<<"Christmas";
    if(d==24)
        cout<<"Christmas Eve";
    if(d==23)
        cout<<"Christmas Eve Eve";
    if(d==22)
        cout<<"Christmas Eve Eve Eve";

}



















Measured memory_bytes: 3644
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
typedef long long ll;
const int maxn = 1005;
const int mod = 1000000007;



int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
   int x,y;
   cin>>x>>y;
   cout<<(x<=y?"unsafe":"safe")<<endl;
  return 0;
}

Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <queue>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define fr(i,k,N) for(ll i=k; i<N;i++)
#define rep(i,N) for(ll i=0; i<N;i++)
#define alll(v) v.begin(),v.end()
using namespace std;
template <class X> void pr(X test){cout<<test<<endl;}
template <class X> void prr(X test){for(auto it:test){cout<<it;}cout<<endl;}


int main() {
    ll k;
    cin>>k;
    vector<ll> v,vv;
    rep(i,1000){
        v.push_back(i);
    }
    ll y = 1;
    rep(p, 15){
        for(auto it:v){
            vv.push_back(it*y + (y-1));
        }
        y*=10;
    }
    sort(alll(vv));
    vv.erase(std::unique(alll(vv)), vv.end());
    sort(alll(vv));
    double g = 1000000000000001;
    vector<ll> vvv;
    rep(i, vv.size()){
        ll tmp = vv[vv.size()-1-i];
        string s = to_string(tmp);
        ll summer = 0;
        rep(j, s.size()) summer+=(s[j]-'0');//?
        double aaa = ((double) tmp )/((double) summer);
//        pr(aaa);
//        pr(tmp);
//        pr(g);
//        pr("");
//        pr(s);
//        pr(s[0]);
//        pr((ll)s[0]);
        if(aaa <= g){
            g=aaa;
            vvv.push_back(tmp);
        }
    }
//    for x in range(100000009,0,-1):
//        s = str(x)
//        t = x/sum([int(y) for y in list(s)])
//        if(t <= g):
//            g = min(g,t)
//            print(s,g,t,sep='\t')
//
//    pr(vvv.size());
    sort(alll(vvv));
//    unique(alll(vvv));
    rep(i, k) pr(vvv[i]);
    
    
}



Measured memory_bytes: 512
#include <cstdio>

int main()
{
    int n;
    scanf("%d", &n);
    auto tot = 1LL;
    auto odd = 1LL;
    for (int i = 0; i < n; ++ i) {
        int a;
        scanf("%d", &a);
        tot *= 3;
        if (~a & 1) {
            odd *= 2;
        }
    }
    printf("%lld\n", tot - odd);
}


Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <cstdlib>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <functional>
#define rep(i,j,n) for(i=j;i<(n);i++)
#define rrep(i,j,n) for(i=j;i>(n);i--)
typedef long long int lli;
#define N 1000000007

using namespace std;

//lli gcd(lli a,lli b){
//    lli x,y;
//    x=max(a,b);
//    y=min(a,b);
//    if(x%y==0){
//        return y;
//    }
//    else{
//        return gcd(y,x%y);
//    }
//}
//
//lli lcm(lli a,lli b){
//    lli x,y;
//    x=max(a,b);
//    y=min(a,b);
//    return x*y/gcd(x,y);
//}

int main(){
    lli n,k,p;
    double ans=0.0,a,b;
    vector<double> vec,rui;
    lli i,j;
    cin>>n>>k;
    rep(i,0,n){
        cin>>p;
        a=(1+p)*p/2;
        b=p;
        vec.push_back(a/b);
    }
    rui.push_back(vec[0]);
    rep(i,1,n){
        rui.push_back(rui[i-1]+vec[i]);
    }
    rep(i,k-1,n){
        a=rui[i]-rui[i-k];
        ans=max(ans,a);
    }
    cout<<fixed<<setprecision(10)<<ans<<endl;
}


Measured memory_bytes: 4848
import itertools


def main():
    N, M = map(int, input().split())
    connect = [set() for _ in range(N)]
    for i in range(M):
        tmp = list(map(int, input().split()))
        for s in tmp[1:]:
            connect[s-1].add(i)
    P = list(map(int, input().split()))
    ans = 0
    for x in itertools.product([True, False], repeat=N):
        cnt = [0] * M
        for i in range(N):
            if x[i]:
                for c in connect[i]:
                    cnt[c] += 1
        ok = True
        for i in range(M):
            if cnt[i] % 2 != P[i]:
                ok = False
        if ok:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 41840