akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Main
{
    public static class Program
    {

        static void Main(string[] arg)
        {
            ulong answer = 0;
            ulong sum = 0;
            var line = GetUlongList(Console.ReadLine());
            var lines = new List<LineList>();

            for (ulong i = 0; i < line[0]; i++)
            {
                var ABList = GetUlongList(Console.ReadLine());
                lines.AddRange(new List<LineList>()
                {
                    new LineList(ABList[0],ABList[1])
                });
            }
            List<LineList> sortlist = new List<LineList>(lines.OrderBy(value => value.Money));

            int k = 0;
            while(sum < line[1])
            {
                if(sum + sortlist[k].Times < line[1])
                {

                    sum += sortlist[k].Times;
                    answer += ulong.Parse((sortlist[k].Times * sortlist[k].Money).ToString());

                }
                else
                {
                    sum = line[1] - sum;

                    answer += ulong.Parse((sortlist[k].Money * sum).ToString());
                    sum = line[1];
                }
                k++;
            }


            Console.WriteLine(answer);
            Console.ReadLine();

        
        }
        
        #region libraries
        private static int[] GetIntList(string line)
        {
            return line.Split(' ').Select(x => int.Parse(x)).ToArray();

        }
        private static double[] GetDoubleList(string line)
        {
            return line.Split(' ').Select(x => double.Parse(x)).ToArray();

        }
        private static ulong[] GetUlongList(string line)
        {
            return line.Split(' ').Select(x => ulong.Parse(x)).ToArray();
        }
        private static int SearchNearest(this IEnumerable<int> list, int target)
        {
            var min = list.Min(c => Math.Abs(c - target));
            return list.First(c => Math.Abs(c - target) == min);
        }
        public static int Gcd(int a,int b)
        {
            if(a < b)
            {
                Gcd(b, a);
            }
            while (b != 0)
            {
                var rm = a % b;
                a = b;
                b = rm;
            }
            return a;
        }
        #endregion
    }
    class LineList
    {
        public ulong Money;
        public ulong Times;
        public LineList(ulong money, ulong times)
        {
            this.Money = money;
            this.Times = times;
        }
    }
}


Measured memory_bytes: 28196
<?php
class In {
    private $array = [];
    private $length = 0;
    private $count = 0;

    function __construct()	{
		$str = trim(fgets(STDIN));
        $this->array = explode(' ', $str);
        $this->length = count($this->array);
    }
    
    public function get(int $i){
        $this->array[$i];
    }

    public function next() {
        return $this->array[$this->count++];
    }
    public function hasNext() {
        return $this->count < $this->length;
    }
    public function nextInt() {
        return (int)$this->next();
    }
    public function nextDouble() {
        return (double)$this->next();
    }
    public function nextString() {
        return (string)$this->next();
    }
}

class Out {
    public static function line($str = "") {
        echo $str . PHP_EOL;
    }
}

$in = new In();
if($in->nextInt() * $in->nextInt() % 2 == 1){
    Out::line("Yes");
}else{
    Out::line("No");
}


Measured memory_bytes: 4728
#include<stdio.h>
#include<string.h>
#include<algorithm>
#define LL long long
using namespace std;

int n;
char a[303030];
LL bank[2560];

LL getPair(LL q)
{
    return (q*(q-1))/2;
}

LL solve()
{
    LL ans = getPair(n)+1;
    for(int i ='a';i<='z';i++) bank[i] = 0;
    for(int i=0;i<n;i++) bank[a[i]]++;
    for(int i ='a';i<='z';i++)
    {
        if(bank[i]<2) continue;
        ans -= getPair(bank[i]);
    }
    return ans;
}

int main()
{
    scanf("%s",a);
    n = strlen(a);
    LL ans = solve();
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define rep(i,st,ed) for (int i=st;i<=ed;++i)

const int N=100005;

struct edge {int y,next;} e[N*2];

int f[N],ls[N],edCnt;

int read() {
	int x=0,v=1; char ch=getchar();
	for (;ch<'0'||ch>'9';v=(ch=='-')?(-1):(v),ch=getchar());
	for (;ch<='9'&&ch>='0';x=x*10+ch-'0',ch=getchar());
	return x*v;
}

void add_edge(int x,int y) {
	e[++edCnt]=(edge) {y,ls[x]}; ls[x]=edCnt;
	e[++edCnt]=(edge) {x,ls[y]}; ls[y]=edCnt;
}

void dfs(int x,int d,int fa) {
	f[x]=0;
	for (int i=ls[x];i;i=e[i].next) {
		if (e[i].y==fa) continue;
		dfs(e[i].y,d+1,x);
		f[x]^=f[e[i].y]+1;
	}
}

int main(void) {
	int n=read();
	rep(i,2,n) add_edge(read(),read());
	dfs(1,1,0);
	puts(f[1]?"Alice":"Bob");
	return 0;
}

Measured memory_bytes: 7168
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static readonly long Mod = 1000000000 + 7;

        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var S = ReadLine();
            var keyence = "keyence";
            // 場合分け
            //  ・最初か最後が"keyence"
            //  ・最初がk～末尾に残り
            //  他の場合、一つの部分列の削除では"keyence"にならない
            // 最初か最後が"keyence"
            if (S.Substring(0, keyence.Length) == keyence || S.Substring(S.Length - keyence.Length) == keyence)
            {
                WriteLine("YES");
                return;
            }
            // 最初がkで残りが末尾
            if (S[0] == keyence[0])
            {
                var cnt = 0;
                while (S[cnt] == keyence[cnt])
                    ++cnt;
                if (keyence.Substring(cnt) == S.Substring(S.Length - (keyence.Length - cnt)))
                {
                    WriteLine("YES");
                    return;
                }
            }
            WriteLine("NO");

            //Out.Flush();
        }
    }
}

Measured memory_bytes: 11092
const main = arg => {
  const ary = arg.split('');
  ary.pop();
  const sum = ary.reduce((a, b) => Number(a) + Number(b));
  console.log(sum % 9 === 0 ? 'Yes' : 'No');
};
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 34312
N,K = gets.chomp.split.map(&:to_i)
sum = N**2
if K >= 1
	sum -= N*(K-1)
	sum -= (N-K+1)*K
end
((K+1)..N).each do |n|
	sum -= (N-K)/n*K+[(N-K)%n-n+K+1,0].max
end
p sum

Measured memory_bytes: 1788
#include <iostream>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <numeric> // accumulate(begin,end,初期値)

typedef long long ll;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define print(x) cout<<x<<endl;
#define rep(i,n) for(ll i = 0;i < n;++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SUM(vec) accumulate(all(vec),0);

const ll INF = 1e9+7;

// 各桁の和
template<typename T>
T digit(T num){
  T sum = 0;
  while(num){
    sum += num % 10;
    num /= 10;
  }
  return sum;
}

int main(){
  int N,K;
  cin>>N>>K;
  vector<ll> h(N);
  rep(i,N)cin>>h[i];
  vector<ll> dif(N,INF);
  
  sort(all(h));
  
  for(int i = K-1;i < N;++i){
    dif[i] = h[i] - h[i - K+1];
  }
  sort(all(dif));
  print(dif[0])
  return 0;
}


Measured memory_bytes: 1792
def calc(x1, x2, x3, x4, x5)
    if x1 == 0 then
        return 1
    elsif x2 == 0 then
        return 2
    elsif x3 == 0 then
        return 3
    elsif x4 == 0 then
        return 4
    else
        return 5
    end
end

x1, x2, x3, x4, x5 = gets.split.map(&:to_i)
puts calc(x1, x2, x3, x4, x5)

Measured memory_bytes: 14400
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

using namespace std;
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;

#define INF (1e9)

ll N, K;
ll MOD = 1000000007;
vvi G;
vi A;

void dfs(int v, int p, ll c) {
    c = max(c - 1, K - 2);
    for (int i : G[v]) {
        if (i == p) continue;
        A[i] = c;
        dfs(i, v, c);
        c--;
    }
    return;
}

int main() {
    cin >> N >> K;

    G = vvi(N);
    int a, b;
    for (int i = 0; i < N - 1; i++) {
        cin >> a >> b;
        a--;
        b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    A = vi(N, -1);
    A[0] = K;
    dfs(0, -1, K);

    ll ans = 1;
    for (int i = 0; i < N; i++) {
        ans *= A[i];
        ans %= MOD;
    }

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


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

int main(){
  int n;
  cin >> n;
  vi ans(100000);
  for(int x=1;x<100;x++){
      for(int y=1;y<100;y++){
          for(int z=1;z<100;z++){
            ans[x*x+y*y+z*z+x*y+y*z+z*x]++;
  }
  }
  }
  rep(i,n) cout << ans[i+1] << "\n";
  
  return 0;
}

Measured memory_bytes: 3704
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTriangularRelationship solver = new CTriangularRelationship();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTriangularRelationship {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextInt(), k = in.nextInt();

            long answer = 0;

            answer += cube(n / k);

            if (k % 2 == 0) {
                long k2 = k / 2;
                answer += cube((n + k2) / k);
            }

            out.println(answer);
        }

        static long cube(long x) {
            return x * x * x;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



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

#define int long long
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define yn(x) ((x) ? "YES" : "NO")

typedef pair <int, int> ii;
typedef pair <int, ii> iii;

const int siz = 2e5 + 10;
const int SIZ = 1e6 + 10;
const int mod = 1e9 + 7;
const int maxx = 2e9;
const int MAXX = 1e18;
const string file = "2";

int a[siz], b[siz];

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

//    freopen ((file + ".INP").c_str(), "r", stdin);
//    freopen ((file + ".OUT").c_str(), "w", stdout);

    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i] >> b[i];
    }

    sort (a + 1, a + 1 + n);
    sort (b + 1, b + 1 + n);

    if (n % 2 == 1) {
        int p = (n + 1) / 2;
        return cout << b[p] - a[p] + 1 << "\n", 0;
    }
    else {
        int p1 = n / 2;
        int p2 = n / 2 + 1;

        double m1 = (b[p1] - a[p1]) / 2.0;
        double m2 = (b[p2] - a[p2]) / 2.0;

        cout << (int)((m2 + m1) / 0.5 + 1) << "\n";
    }

//    cerr << "Time: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";

    return 0;
}


Measured memory_bytes: 6696
#include "bits/stdc++.h"

using namespace std;

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define int long long
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int,int>
#define INF LLONG_MAX
#define EPS 1e-9
#define all(v) (v).begin(),(v).end()
#define sq(x) ((x)*(x))
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)


#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
 
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
 
typedef long double dbl;
bool codejam = 0;

const int MOD = 1000*1000*1000 + 7;
const int NMAX = 1000*1000 + 11;

int n,m,p,q,k,a,b,c,ans;
string s,str;
char ch;
vector<vector<int> > gr;
bool vis[NMAX];
int dp[NMAX][2];

void dfs(int cur){
    vis[cur]=1;

    dp[cur][0] = 1;
    dp[cur][1] = 1;

    for(auto ch:gr[cur]){
        if(!vis[ch]){
            dfs(ch);
            dp[cur][1] *= dp[ch][1] + dp[ch][0];
            dp[cur][0] *= dp[ch][1];
            dp[cur][1] %= MOD;
            dp[cur][0] %= MOD;
        }
    }

    // if(dp[cur][0] == 0 and dp[cur][1] == 0){
    // }
    return;
}
void solve()
{
    cin>>n;
    gr.resize(n + 1);

    for(int i = 0; i < n; i++){
        cin>>a>>b;
        gr[a].pb(b);
        gr[b].pb(a);
    }

    dfs(1);

    cout<<(dp[1][1] + dp[1][0])%MOD;
}

int32_t main(){ fio;
    int t = 1;
    int cs = 1;
    // cin>>t;
    while(t--){
        if(codejam){
            cout<<"Case #"<<cs<<": ";
        }
        cs++;
        solve();
        cout<<"\n";
    }
}


Measured memory_bytes: 13568
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <complex>
#include <iomanip>
#include <iostream>
#include <limits>
#include <inttypes.h>
#include <map>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

[[maybe_unused]] constexpr ll LL_MAX = numeric_limits<ll>::max();
[[maybe_unused]] constexpr ll LL_MIN = numeric_limits<ll>::min();
[[maybe_unused]] constexpr ull ULL_MAX = numeric_limits<ull>::max();

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrep(i, a, b) for (ll i = (a)-1; i >= (b); i--)

template<typename T>
void chmin(T& x, T y) {
    x = min(x, y);
}

template<typename T>
void chmax(T& x, T y) {
    x = max(x, y);
}

ll csum(ll x, ll y) {
    if (x > 0 && y > 0 && x > LL_MAX - y) {
        return LL_MAX;
    }
    if (x < 0 && y < 0 && x < LL_MIN - y) {
        return LL_MIN;
    }
    return x + y;
}

ll readl() {
    ll ret;
    scanf("%" PRId64 "", &ret);
    return ret;
}

vector<ll> readvl(ll n) {
    vector<ll> ret(n);
    rep(i, 0, n) { ret[i] = readl(); }
    return ret;
}

void writel(ll x) {
    printf("%" PRId64 "\n", x);
}

template<typename T>
vector<T> make_vec_nd(T init, ll size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, ll size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

struct Mod {
	static uint64_t PRIME;
	struct LocalPrime {
		uint64_t backup;
		LocalPrime(uint64_t prime) { backup = exchange(Mod::PRIME, prime); }
		~LocalPrime() { Mod::PRIME = backup; }
	};
	uint64_t value = 0;
	Mod()
	: value(0) {}
	Mod(ll v) {
		if (v >= 0) {
			value = v % PRIME;
		} else {
			value = PRIME - (-v) % PRIME;
		}
	}
	Mod operator+(const Mod& rhs) const { return Mod(*this) += rhs; }
	Mod& operator+=(const Mod& rhs) {
		value += rhs.value;
		if (value >= PRIME) {
			value -= PRIME;
		}
		return *this;
	}
	Mod operator-(const Mod& rhs) const { return Mod(*this) -= rhs; }
	Mod& operator-=(const Mod& rhs) {
		if (value < rhs.value) {
			value += PRIME;
		}
		value -= rhs.value;
		return *this;
	}
	Mod operator*(const Mod& rhs) const { return Mod(*this) *= rhs; }
	Mod& operator*=(const Mod& rhs) {
		value = (value * rhs.value) % PRIME;
		return *this;
	}
};
uint64_t Mod::PRIME = 1000000007;

int main() {
	ll K = readl();
	Mod::PRIME = K;
	Mod a = 0;
	rep(i,1,K+1) {
		a = a * 10 + 7;
		if (a.value == 0) {
			writel(i);
			return 0;
		}
	}
	writel(-1);
}



Measured memory_bytes: 3204
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
int main(){
  tuple<int,int,int> p;
  map<tuple<int,int,int>,int> s;
  int ans=0,n,a[5],i,j;
  scanf("%d\n",&n);
  for(i=0;i<n;i++){
    for(j=0;j<3;j++){
      scanf("%d ",&a[j]);
    }
    sort(a,a+3);
    get<0>(p)=a[0],get<1>(p)=a[1],get<2>(p)=a[2];
    if(s[p]==0){
      s[p]=1;
    }
    else{
      ans++;
    }
  }
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 3316
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
#define P pair<int,int>
//printf("%.12Lf\n",);
int keta(int x){
	rep(0,i,30){
		if(x<10){
			return i+1;
		}
		x=x/10;
	}
}
int gcd(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return bb;
		}	
		bb=bb%aa;
		if(bb==0){
			return aa;
		}
	}
}	
int lcm(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return x/bb*y;
		}	
		bb=bb%aa;
		if(bb==0){
			return x/aa*y;
		}
	}
}
bool p(int x){
	if(x==1)return false;
	rep(2,i,sqrt(x)+1){
		if(x%i==0&&x!=i){
			return false;
		}
	}	
	return true;
}
int max(int a,int b){
	if(a>=b)return a;
	else return b;
}
int min(int a,int b){
	if(a>=b)return b;
	else return a;
}	
int n2[41];		
int nis[41]; 
int nia[41];
int mody[41];
int nn;
int com(int n,int y){
	int ni=1;
	for(int i=0;i<41;i++){
		n2[i]=ni;
		ni*=2;
	}
	int bunsi=1,bunbo=1;
	rep(0,i,y)bunsi=(bunsi*(n-i))%mod;
	rep(0,i,y)bunbo=(bunbo*(i+1))%mod;
	mody[0]=bunbo;
	rep(1,i,41){
		bunbo=(bunbo*bunbo)%mod;
		mody[i]=bunbo;
	}
	rep(0,i,41)nis[i]=0;
	nn=mod-2;
	for(int i=40;i>=0;i-=1){
		if(nn>n2[i]){
			nis[i]++;
			nn-=n2[i];
		}
	}
	nis[0]++;
	rep(0,i,41){
		if(nis[i]==1){
			bunsi=(bunsi*mody[i])%mod;
		}
	}
	return bunsi;
}
int yakuwa(int n){
	int sum=0;
	rep(1,i,sqrt(n+1)){
		if(n%i==0)sum+=i+n/i;
		if(i*i==n)sum-=i;
	}
	return sum;
}	
bool hei(int n){
	rep(0,i,100){
		if(i*i==n){
			return true;
		}
	}
	return false;
}
int pow(int b,int a){	
	int aa=1;
	rep(0,i,a)aa*=b;	
	return aa;
}
int sankaku(int a){
	return a*(a+1)/2;
} 
int XOR(int a,int b){
	int ni=1;
	rep(0,i,41){
		n2[i]=ni;
		ni*=2;
	}
	rep(0,i,41)nis[i]=0;
	for(int i=40;i>=0;i-=1){
		if(a>=n2[i]){
			nis[i]++;
			a-=n2[i];
		}
		if(b>=n2[i]){
			nis[i]++;
			b-=n2[i];
		}	
	}
	int sum=0;
	rep(0,i,41)sum+=(nis[i]%2*n2[i]);
	return sum;
}
int a[114514];
signed main(){
	ic(n) 
	rep(0,i,n)cin>>a[i];
	int ans=0;
	rep(0,i,n){
		ans+=a[i]/2;
		a[i]-=a[i]/2*2;
		if(a[i]==1&&a[i+1]>0){
			ans++;
			a[i]=0;
			a[i+1]-=1;
		}
	}
	c(ans)
}	

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main () {
  int A, B, K;
  cin >> A >> B >> K;
  for(int i = 0; i < B - A + 1; i++) {
    if(i + A <= A + K - 1 || i + A >= B - K + 1) cout << i + A << endl;
  }
  return 0;
}

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

bool ini(int *in){
	bool conti = false;
	
	for(int i = 0; i < 6; i++){
		scanf("%d",&in[i]);
		if(in[i] != 0)
			conti = true;
	}
	
	return conti;
}

int main()
{
	int in[6],medal;
	
	while(ini(in))
	{
		medal = 100;
		medal -= in[5]*3;
		medal += in[0]*5+in[1]*3+in[4]*3;
		medal += in[0]*(15 + 15*5);
		medal += in[1]*(15 + 15*3);
		medal += in[2]*7;
		medal += in[3]*2;
		
		printf("%d\n",medal);
	}
	
	return 0;
}

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

using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

const int IINF = 2002002002;
const ll LINF = 9009009009009009009LL;

//===



int main()
{
	int N;
	cin >> N;
	Vi h(N);
	int hmax = 0;
	for (int i = 0; i < N; i++) {
		int hi;
		cin >> hi;
		h[i] = hi;
		hmax = max(hmax, hi);
	}

	int ans = 0;
	for (int i = 1; i <= hmax; ++i) {
		bool flag = false;
		for (int j = 0; j < N; ++j) {
			if (h[j] < i) {
				if (flag) ++ans;
				flag = false;
			}
			else {
				flag = true;
			}
		}
		if (flag) ++ans;
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
typedef vector<int>vi;
typedef pair<int,int>pi;
typedef vector<pi>vpi;
typedef vector<vi>vvi;
#define double long double
#define pow powl
#define sqrt sqrtl
#define cbrt cbrtl
#define floor floorl
#define ceil ceill
#define pb push_back
#define ep emplace_back
#define PB pop_back
#define pf push_front
#define ef emplace_front
#define PF pop_front
#define mp make_pair
#define ub(a,b) upper_bound(all(a),b)-a.begin()
#define lb(a,b) lower_bound(all(a),b)-a.begin()
#define bs(a,b) binary_search(all(a),b)
#define mem(a,b) memset(a,b,sizeof(a))
#define in(a,n) FOR(i,0,n-1) cin>>a[i]
#define in1(a,n) FOR(i,1,n) cin>>a[i]
#define ff first
#define ss second
#define out(a,n) FOR(i,0,n-1) cout<<a[i]<<" ";cout<<endl;
#define out1(a,n) FOR(i,1,n) cout<<a[i]<<" ";cout<<endl;
#define clr(a) a.clear()
#define pow2(a) (1LL<<a)
#define all(a) a.begin(),a.end()
#define all1(a) a.begin()+1,a.end()
#define rall(a) a.rbegin(),a.rend()
#define rall1(a) a.rbegin(),a.rend()
#define sz(a) ((int)a.size())
#define FOR(i,a,b) for(auto i=a;i<=b;i++)
#define NFOR(i,a,b) for(auto i=a;i>=b;i--)
const int mod=1e9+7;

inline int add(int a,int b){return (a%mod + b%mod)%mod;}
inline int sub(int a ,int b){return (a%mod - b%mod + mod)%mod;}
inline int mul(int a,int b){return (a%mod * b%mod)%mod;}
inline int power(int a,int b,int MOD){int res=1;while(b){if(b&1){res*=a;res%=MOD;}a=a*a;a%=MOD;b>>=1;}return res;}

#define trace(x) cout<<#x<<" :: "<<x<<endl;
#define trace2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define trace3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define trace4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
clock_t time_p = clock();
void time()
{
  time_p = clock() - time_p;
  cerr << "Time elapsed : " << (double)(time_p)/CLOCKS_PER_SEC <<endl;
}
signed main()
{
     SPEED;
     int n,m;
     cin>>n>>m;
     bool edge[n+1][n+1];
     memset(edge,false,sizeof(edge));
     for(int i=0;i<m;i++)
     {
     	   int u,v;
     	   cin>>u>>v;
     	   edge[u][v]=true;
     	   edge[v][u]=true;
     }
     vector<int>v;
     for(int i=2;i<=n;i++)
     	v.emplace_back(i);
     int res=0;
     do
     {
         if(!edge[1][v[0]])
         	continue;
         bool okay=false;
         for(int i=1;i<n-1;i++)
         	if(!edge[v[i]][v[i-1]])
         	{
         		okay=true;break;
         	}
         if(okay)
         	continue;
         res++;
     }while(next_permutation(v.begin(),v.end()));
     cout<<res<<endl;
     time();
     return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();
        long K = sc.nextLong();
        long now = 0;
        long min = N;

        now = N % K;
        do{
            now = Math.abs(now - K);
            if(min > now) {
               min = now;
            }
        }while(N % K != now);
        System.out.println(min);
    }
}

Measured memory_bytes: 21844
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)

divisible = [False for _ in range(int(1e6+1))]
cnt = defaultdict(int)

for a in A:
    cnt[a] += 1
    if divisible[a] == False and cnt[a] <= 1:
        for i in range(a+a, len(divisible), a):
            divisible[i] = True
ans = 0
for a in A:
    if divisible[a] is False and cnt[a] <= 1:
        ans += 1
print(ans)


Measured memory_bytes: 199652
/*input
1000000000
*/

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


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long n;
    cin >> n;
    long long ans=0;
    ans = (n/500)*1000ll;
    n = n%500;
    ans += (n/5)*5;
    cout << ans;


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int dy[4] = {0, 0, 1, -1};
const int dx[4] = {-1, 1, 0, 0};
int main(void) {
  int h, w;
  cin >> h >> w;
  vector<string> s(h);
  int white = 0;
  for (int i = 0; i < h; i++) {
    cin >> s[i];
    for (int j = 0; j < w; j++) {
      if (s[i][j] == '.') white++;
    }
  }
  vector<vector<int> > dist(h, vector<int>(w, -1));
  queue<pair<int, int> > q;
  q.push(make_pair(0, 0));
  dist[0][0] = 1;
  while (!q.empty()) {
    pair<int, int> current_pos = q.front();
    int current_y = current_pos.first;
    int current_x = current_pos.second;
    q.pop();
    for (int dir = 0; dir < 4; dir++) {
      int next_y = current_y + dy[dir];
      int next_x = current_x + dx[dir];
      if (next_y < 0 || next_y >= h || next_x < 0 || next_x >= w) continue;
      if (s[next_y][next_x] == '#') continue;
      if (dist[next_y][next_x] >= 0) continue;
      dist[next_y][next_x] = dist[current_y][current_x] + 1;
      q.push(make_pair(next_y, next_x));
    }
  }
  if (dist[h - 1][w - 1] == -1) {
    cout << -1 << endl;
  } else {
    cout << white - dist[h - 1][w - 1] << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int R, C, K;
    cin >> R >> C >> K;
    vector<vector<vector<ll>>> dp(R + 1,
                                  vector<vector<ll>>(C + 1, vector<ll>(4, 0)));
    vector<vector<ll>> value(R, vector<ll>(C, 0));
    rep(i, K) {
        int r, c, v;
        cin >> r >> c >> v;
        r--, c--;
        value[r][c] = v;
    }

    for(int i = 0; i < R; i++) {
        for(int j = 0; j < C; j++) {
            for(int k = 0; k < 4; k++) {
                if(value[i][j]) {
                    if(k < 3)
                        dp[i][j + 1][k + 1] =
                            max(dp[i][j + 1][k + 1], dp[i][j][k] + value[i][j]);
                    dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k]);
                    if(k < 3)
                        dp[i + 1][j][0] =
                            max(dp[i + 1][j][0], dp[i][j][k] + value[i][j]);
                    dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k]);
                } else {
                    dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k]);
                    dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k]);
                }
            }
        }
    }
    ll res = 0;
    rep(i, 4) { res = max(res, dp[R - 1][C][i]); }
    rep(i, 4) { res = max(res, dp[R][C - 1][i]); }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 706992
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed
#define endl '\n'

const ll MOD = 1e9 + 7;
struct mint {
    ll x;
    mint() : x(0) {}
    mint(ll x) : x((x % MOD + MOD) % MOD) {}
    mint& operator+=(const mint& r) { if ((x += r.x) >= MOD) { x -= MOD; } return *this; }
    mint& operator-=(const mint& r) { if ((x -= r.x) < 0) { x += MOD; } return *this; }
    mint& operator*=(const mint& r) { if ((x *= r.x) > MOD) { x %= MOD; } return *this; }
    mint& operator++() { if ((++x) >= MOD) { x -= MOD; } return *this; }
    mint operator++(int) { mint ret = x; if ((++x) >= MOD) { x-= MOD; } return ret; }
    mint& operator--() { if ((--x) < 0) { x += MOD; } return *this; }
    mint operator--(int) { mint ret = x; if ((--x) < 0) { x += MOD; } return ret; }
    mint operator+(const mint& r) { mint ret; return ret = x + r.x; }
    mint operator-(const mint& r) { mint ret; return ret = x - r.x; }
    mint operator*(const mint& r) { mint ret; return ret = x * r.x; }
    mint operator-() { return mint() - *this; }
    bool operator<(const mint& a) { return x < a.x; }
    bool operator>(const mint& a) { return x > a.x; }
    bool operator<=(const mint& a) { return x <= a.x; }
    bool operator>=(const mint& a) { return x >= a.x; }
    bool operator==(const mint& a) { return x == a.x; }
    bool operator!=(const mint& a) { return x != a.x; }
};
ostream& operator<<(ostream& os, const mint& r) { os << r.x; return os; }
ostream& operator>>(ostream& os, const mint& r) { os >> r.x; return os; }

char field[1001][1001];
mint dp[1001][1001];

void solve(istream& cin, ostream& cout) {
  int h, w;
  cin >> h >> w;
  REP(i, h) REP(j, w) cin >> field[i][j];
  dp[0][0] = 1;
  REP(i, h) {
    REP(j, w) {
      if (i == 0 && j == 0) continue;
      if (field[i][j] == '#') dp[i][j] = 0;
      else {
        if (i == 0) dp[i][j] = dp[i][j - 1];
        else if (j == 0)
          dp[i][j] = dp[i - 1][j];
        else
          dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      }
    }
  }
  cout << dp[h - 1][w - 1] << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
}
#endif


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

void solve()
{
    long long t,n,m,i,j,k=0,kk=0,x,y,z=0,mn=0,mx,a[10],cnt=0;
    string s;

    cin >> s;

    x = ((s.size()+3)/2)-1;

    for(i=x;i<(s.size()+x)/2;i++)
    {
        if(s[i]!=s[((s.size()+x))-i-1])
        {
            k=1;
        }
    }

        for(i=0;i<s.size()/2;i++)
        {
            if(s[i]!=s[s.size()-1-i])
            {
                k=1;
            }
        }

   if(k==1)
   {
       cout << "No" << endl;
   }
   else
   {
       cout << "Yes" << endl;
   }

}

int main()
{
     long long t,n,m,i,j,k=0,kk=0,x,y,z=0,mn,mx;

     ios_base::sync_with_stdio(false);
     cin.tie(NULL);

     //cin >> t;

     //while(t--)
     solve();

}


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

using ll = long long;

// Disjoint Set
template<typename T>
class UnionFind {
 public:
  // n要素で生成
  explicit UnionFind(T n) : _size{n}, _parent{vector<T>(n, -1)} {}
  // 木の根を求める
  T find(T x) {
    if (x < 0 || x >= _size) return x;
    if (_parent[x] < 0) return x;
    return _parent[x] = find(_parent[x]);
  }
  // xとyの属する集合を併合する
  bool unite(T x, T y) {
    if (x < 0 || x >= _size || y < 0 || y >= _size) return false;
    x = find(x), y = find(y);
    if (x == y) return false;
    // xのほうが少なかったらswapして常に大きい集合に加算（集合サイズはマイナス値であることに注意）
    if (_parent[x] > _parent[y]) swap(x, y);
    _parent[x] += _parent[y];
    _parent[y] = x;
    return true;
  }
  // xとyが同じ集合に属するか
  bool same(T x, T y) { return find(x) == find(y); }
  // xの属する集合の個数を求める
  T size(T x) {
    if (x < 0 || x >= _size) return 1;
    return -_parent[find(x)];
  }
  // 全体の個数を求める
  T size() { return _size; }
 private:
  T _size;
  vector<T> _parent; // 親の番号（親自身はー（マイナス）集合要素の個数）
};

constexpr int MAX_N = 1e5;
set<int> like[MAX_N];
int ans[MAX_N];

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  UnionFind<int> uf(N);
  for (int i{}; i < M; ++i) {
    int A, B;
    cin >> A >> B;
    --A, --B;
    like[A].insert(B), like[B].insert(A);
    uf.unite(A, B);
  }
  for (int i{}; i < K; ++i) {
    int C, D;
    cin >> C >> D;
    --C, --D;
    like[C].insert(D), like[D].insert(C);
  }

  for (int i{}; i < N; ++i) {
    int root = uf.find(i);
    ans[i] = uf.size(i) - 1;
    for (const auto &j : like[i]) {
      if (root == uf.find(j)) --ans[i];
    }
  }

  cout << ans[0];
  for (int i{1}; i < N; ++i) {
    cout << ' ' << ans[i];
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 25088
import math

N, K = map(int, input().split())
minNK = min(N, K-1)

sumA = 0

for i in range(1, minNK+1):
    c, k = 0, i
    while k < K:
        c, k = c+1, k*2
    #print(i, c, k)
    sumA += ( math.pow(0.5, c) / float(N))
#print(sumA)

if N >= K:
    sumA += (float(N - K + 1) / float(N))
print(sumA)

Measured memory_bytes: 3316
def main():
  while True:
    n = int(input())
    if not n:
      break
    ss = [s for s in input()[::-1]]
    for i in range(n):
      new = []
      app = new.append
      last = ss.pop()
      count = 1
      while ss:
        a = ss.pop()
        if a == last:
          count += 1
        else:
          app(str(count))
          app(last)
          last = a
          count = 1
      app(str(count))
      app(last)
      new = "".join(new)
      ss = [s for s in new[::-1]]
  #    print("".join(new))
    print("".join(new))

main()


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

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

#define REPR(i,n) for(int i =n; i >=0; --i)

#define REP_(i,m,n) for(int i =m; i <n; ++i)

#define INF 2e9

#define ll long long

//const ll MOD = 1000000007;

//const  long double PI=(acos(-1));

//const  long double EPS=0.0000000001;

int main(){
    ll n;cin >> n;
    vector<ll> a(n);
    ll sum = 0;
    REP(i,n){
        cin >> a[i];
        sum += a[i];
    }


    ll div = sum/2;


    ll cnt = 0;
    ll b = 0;
    REP(i,n){
        b += a[i];
        if(b > div){
            if( b == 0){
                cnt = 1;
            }
            else{
                cnt = i;
            }
            break;
        }
    }


    ll c = sum - b;
    ll ans1 =  abs(b - c) ;
    ll ans2 = abs((c + a[cnt]) - (b - a[cnt])) ;

    cout << min(ans1,ans2 ) << endl;
    return 0;
}

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

using ll = long long;

const int mod = 1000000007;
const int INF = 1000000000;
const double EPS = 1e-9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H, N;
    cin >> H >> N;
    int sum = 0;
    for (int i = 0; i < N; ++i) {
        int x;
        cin >> x;
        sum += x;
    }
    cout << (H - sum <= 0 ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
double dis(double ax,double ay,double bx,double by){
    return sqrt(abs(ax-bx)*abs(ax-bx)+abs(ay-by)*abs(ay-by));
}
int n,x[50],y[50];
int solve(double X){
    rep(i,n)for(int j=i+1;j<n;j++){
        double a=x[i],b=y[i],c=x[j],d=y[j];
        double mx=(a+c)/2,my=(b+d)/2,s=dis(a,b,mx,my);
        if(X<s) continue;
        double t=sqrt(X*X-s*s),dx=(d-b)/dis(a,b,c,d),dy=(a-c)/dis(a,b,c,d);
        double Ax=mx+dx*t,Ay=my+dy*t,Bx=mx-dx*t,By=my-dy*t;
        int Z=1;
        rep(k,n) if(k!=i&&k!=j&&dis(Ax,Ay,x[k],y[k])>X) Z=0;
        if(Z) return 1;
        Z=1;
        rep(k,n) if(k!=i&&k!=j&&dis(Bx,By,x[k],y[k])>X) Z=0;
        if(Z) return 1;
    }
    return 0;
}
double ok=1000,ng=0;
double search(){
    while(abs(ok-ng)>0.0000001){
        double mid=(ok+ng)/2;
        if(solve(mid)) ok=mid;
        else ng=mid;
    }
}
int main(){
    cin>>n;
    rep(i,n) cin>>x[i]>>y[i];
    search();
    cout<<setprecision(10)<<ok<<"\n";
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  private static void solve(int n, int[] m) {
    int[] sum = new int[n];
    for (int i = 0; i < n; i++) {
      sum[i] =  m[i] + (i > 0 ? sum[i - 1] : 0);
    }
    int minDiff = Integer.MAX_VALUE;
    for (int i = 1; i < n - 1; i++) {
      minDiff = Math.min(
        minDiff,
        Math.abs(sum[n - 1] - 2 * sum[i]));
    }
    System.out.println(minDiff);
  }
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.nextLine());
    String[] ms = sc.nextLine().split(" ");
    int[] m = new int[n];
    for (int i = 0; i < n; i++) m[i] = Integer.parseInt(ms[i]);
    solve(n, m);
  }
}


Measured memory_bytes: 23636
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <iomanip>
using namespace std;
int main(){
    int N,K;

    cin >> N >> K;
    double prob = 0.0;

    for (int i=0;i<N;i ++){
        float count = 0.0;
        for(int j=i+1; j<K;){
            
            count++;
            j = j*2; 
        }
        prob += (1.0 / double(N) ) * pow((1.0 / 2 ),count);
        
    }
    cout << setprecision(15)<<prob << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        String strA = "";
        String strB = "";
        for (int i = 0; i < b; i++) {
            strA += a;
        }
        for (int i = 0; i < a; i++) {
            strB += b;
        }
        System.out.println(a <= b ? strA : strB);
    }
}

Measured memory_bytes: 21460
#include <iostream>
using namespace std;
int main(void){
    char str[5];
    cin>>str;
    if(str[0]==str[1]&&str[1]==str[2]) cout<<"Yes";
    else if(str[1]==str[2]&&str[2]==str[3]) cout<<"Yes";
    else cout<<"No";
    return 0;
    
}


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

template <typename Arg1>
void pn(Arg1&& arg1)
{ cout<<arg1<<"\n";}
template <typename Arg1, typename... Args>
void pn(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<"\n"; pn(args...); }

template <typename Arg1>
void ps(Arg1&& arg1)
{ cout<<arg1<<" ";}
template <typename Arg1, typename... Args>
void ps(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<" "; ps(args...); }

template <typename Arg1>
void pvs(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)ps(arg1[i]); }
template <typename Arg1>
void pvn(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)pn(arg1[i]); }

ll lcm(ll a,ll b) 
{ return (a*b)/__gcd(a,b); }

ll mulmod(ll a,ll b,ll mod) 
{ ll res=0; a=a%mod; 
    while(b>0)
    { if(b%2==1) res=(res+a)%mod; 
      a=(a*2)%mod; b/=2; }
    return res % mod; } 

ll mulpow(ll x,ll y,ll p) 
{ ll res=1; x=x%p;
    while(y>0) 
    { if (y&1) res=(res*x)%p; 
      y=y>>1; x=(x*x)%p; } 
    return res; } 

ll modInverse(ll n, ll p) 
{ return mulpow(n, p-2, p); } 

ll log(ll n, ll b)
{ ll c=0;
	while(n>(b-1))
	{ c++; n/=b; } return c; }

ll fib(ll n) 
{ double phi=(1+sqrt(5))/2; 
  return round(pow(phi,n)/sqrt(5)); } 

vector<bool> prime;
void sieve(int n)
{ prime.resize(n,true);
	for(int p=2;p*p<=n;p++)
		if(prime[p])
			for(int i=p*p;i<=n;i+=p)
				prime[i]=false; }

#define MOD 1000000007 //10^9+7
#define pi 3.14159265358979323846
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<=n;i++)
#define fd(i,n) for(i=n-1;i>=0;i--)
#define fn(i,s,d) for(i=s;i<d;i++)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) a.size()
#define vl vector<ll>
#define vb vector<bool>
#define vd vector<double>
#define vvl vector<vl>
#define vs vector<string>
#define vvs vector<vs>
#define pl pair<ll,ll>
#define pd pair<double,double>
#define vpl vector<pl>
#define vpd vector<pd>
#define vvpl vector<vpl>
#define ff first
#define ss second
#define um unordered_map
#define dsort(v) sort(v); reverse(v);


void solve()
{
	ll i,j;
	vl dp(10001,0);
	ll x=1,y=1,z=1;
	f1(x,10000)
	{
		f1(y,10000)
		{
			z=1;
			while(true)
			{
				// ps(x,y,z);
				ll ans = x*x+y*y+z*z+x*y+x*z+y*z;
				// ps(ans);
				// cout<<endl;
				if(ans>=10001)
					break;
				dp[ans]++;
				z++;
			}
			if(z==1)
				break;
		}
	}
	ll n;
	cin>>n;
	f1(i,n)
	pn(dp[i]);
}

int main()
{
	#ifdef Deeksha
		freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    #endif
	std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	solve();/* 
	ll t;
	cin>>t;
	for(ll tt=1;tt<=t;tt++)
	{
		//cout<<"Case #"<<tt<<": ";
		solve();
	}
	//*/
}



Measured memory_bytes: 3692
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <assert.h>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <bitset>
#include <numeric>
#include <string.h>
#include <utility>

using namespace std;
#define IO                 \
	ios::sync_with_stdio(0); \
	cin.tie(0);              \
	cout.tie(0);
#define sz(x) (int)((x).size())
#define forn(i,n) for (int i=0; i < n; i++)
#define forse(i,s,e) for (int i=s; i < e; i++)
#define pb push_back 
#define pf push_front
#define rb pop_back
#define rf pop_front
#define mp make_pair
#define fi first
#define se second
#define all(vec) vec.begin(), vec.end()
#define time() ((double)clock() / CLOCKS_PER_SEC)
#define debug(x) cerr << (#x) << " is " << (x) << endl;

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll P=1e9+7;
double PI=3.141592653589793;
const int arrn = 2e5 + 1;


void solve(){
	int n,m,x;
	cin >> n >> m >> x;
	vector<vector<int>> vals(n,vector<int>(m));
	vector<int> cs(n);
	forn(i,n){
		cin >> cs[i];
		forn(j,m) cin >> vals[i][j];
	}
	int ans=(1<<30);
	forn(i,(1<<n)){
		vector<int> cur(m,0);
		int cst=0;
		forn(j,n){
			if(i&(1<<j)){
				cst+=cs[j];
				forn(t,m) cur[t]+=vals[j][t];
			}
		}	
		bool chk=1;
		forn(j,m){
			if(cur[j]<x) chk=0;
		}
		if(chk){
			ans=min(ans,cst);
		}
	}

	if(ans==(1<<30)) cout << -1;
	else cout << ans;
}

int main() {
	IO;
	int T=1;
//	cin >> T;
	forn(c,T){
		solve();
	}
}



Measured memory_bytes: 3628
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val values = readLine()!!.split(' ').map { it.toInt() }
    val costs = readLine()!!.split(' ').map { it.toInt() }

    var ans = 0

    for (i in (0 until n)) {
        if (values[i] > costs[i]) {
            ans += (values[i] - costs[i])
        }
    }

    println(ans)

}

Measured memory_bytes: 38124
#include <bits/stdc++.h>
using namespace std ;
int main()
{
    int a , b ;
    cin >> a  >>  b  ;
    if(a <= b)
    cout << "Yes" ;
    else if(a > b && a % 500 <= b)
    cout << "Yes" ;
    else
    cout << "No" ;


    return 0 ;
}


Measured memory_bytes: 256
import numpy as np
import collections

n=int(input())
v=list(map(int,input().split()))

e=np.array([v[i] for i in range(0,n,2)])
o=np.array([v[i] for i in range(1,n,2)])

se=set(e)
so=set(o)


lle=collections.Counter(e)
llo=collections.Counter(o)
le=[]
for k,v in lle.items():
    le.append([n//2-v,k])
lo=[]
for k,v in llo.items():
    lo.append([n//2-v,k])
le.sort()
lo.sort()

if(len(lle)==1 and len(llo)==1):
    if(e[0]==o[0]):print(n//2)
    else:print(0)
    exit()




if(len(se)==1):
    if(lo[0][1]!=le[0][1]):print(lo[0][0])
    else:print(lo[1][0])
elif(len(so)==1):
    if(lo[0][1]!=le[0][1]):print(le[0][0])
    else:print(le[1][0])
else:
    if(lo[0][1]!=le[0][1]):print(le[0][0]+lo[0][0])
    else:print(min(le[1][0]+lo[0][0],le[0][0]+lo[1][0]))

Measured memory_bytes: 42812
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double A = sc.nextDouble();
        double B = sc.nextDouble();
        double H = sc.nextDouble();
        double M = sc.nextDouble();
        // System.out.println((H/12.0+M/12.0/60.0-M/60.0));
        System.out.println(Math.sqrt(A*A+B*B-2.0*A*B*Math.cos(2.0*Math.PI*(H/12.0+M/12.0/60.0-M/60.0))));
    }
}

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

#define M1 1000000007
#define M2 1000000009
#define ll long long 
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define INF 1001001001
#define PI 3.1415926535897932384626
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define f0(i, n) for (int i = 0; i < (int)(n); ++i)
#define f1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define fc0(i,l,r) for(int i = (int)(l); i<(int)(r); ++i)
#define fc1(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i)
#define fr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define sz(a) int((a).size())
#define tr(c,i) for(typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef pair<int,int> ii; 
 
void init()
{
  #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
      freopen("error.txt", "w", stderr);
    #endif

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;
}
 
signed main()
{
    init();

    int n,c=0;
    cin>>n;
    int a[101];
    f0(i,n){cin>>a[i];if((i+1)%2!=0 && a[i]%2!=0)c++;}
    cout<<c<<endl;
    
    cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
    return 0;
}

Measured memory_bytes: 3760
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 998244353;

void solve() {
    int n;
    cin >> n;

    vector<int> d(n);
    for(int i = 0; i < n; i++)cin >> d[i];

    map<int,int> mp;
    for(auto x:d)mp[x]++;

    if(d[0] != 0){
        cout << 0;
        return;
    }
    int ans = 1;
    for(int i = 1; i < n; i++){
        ans = (ans * mp[d[i] - 1]) % MOD;
    }
    cout << ans << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}


Measured memory_bytes: 7296
N, T = map(int, input().split())

ct = []
for i in range(N):
    x = list(map(int, input().split()))
    ct.append(x)
    
min_cost = 10000
for i in range(N):
    if ct[i][0] < min_cost and ct[i][1] <= T:
        min_cost = ct[i][0]
        
if min_cost == 10000:
    print("TLE")
else:
    print(min_cost)

Measured memory_bytes: 3060