akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long

vector<int> ans[100010];
int main()
{
	int H, W, N, a[100010];
	cin >> H >> W >> N;
	for (int i = 0; i < N; i++)cin >> a[i];
	int k = 0, c = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < a[i]; j++) {
			if (c == W) {
				c = 0; k++;
			}
			c++;
			ans[k].push_back(i + 1);
		}
	}
	for (int i = 1; i < H; i += 2) {
		reverse(ans[i].begin(), ans[i].end());
	}
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cout << ans[i][j] << " ";
		}
		cout << endl;
	}
}


Measured memory_bytes: 2688
#include <stdio.h>
 
int a,b,c ;
 
int main(void){
    
    scanf ("%d%d%d",&a,&b,&c) ;
    
    if ( a+b==c || b+c==a || c+a==b ){
        printf ("Yes\n") ;
        
    } else {
        printf ("No\n") ;
        
    }
    
    return 0 ;
}

Measured memory_bytes: 128
import string
numbers = "0123456789"
alphabets = string.ascii_letters
characters = numbers + alphabets
n, k = map(int, input().split())

def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)

    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)

    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

m = base_cvt(n, k)
#print(m)
print(len(str(m)))


Measured memory_bytes: 4084
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_A main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 10;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif


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

    string S, T; cin >> S >> T;

    int ans = 0;
    REP(i,3) {
        if (S[i] == T[i]) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vll a(n);
    REP(i,n) cin >> a[i];
    map<ll, ll> mp;
    ll sum = 0;
    ll ans = 0;
    mp[0] = 1;
    REP(i,n){
        ans += mp[sum+a[i]];
        sum += a[i];
        mp[sum] = mp[sum]+1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 14336
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
	"unsafe"
)

func main() {
	KX := sc.nextInts()
	K := KX[0]
	X := KX[1]

	if K*500 >= X {
		yes()
	} else {
		no()
	}
}

/* template functions */
var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}
func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}
func (s *scanner) resetCur() {
	s.cur = 0
}
func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}
func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}
func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur],
		64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i],
			64)
	}
	s.resetCur()
	return res
}
func digits(x int) int {
	return len(strconv.Itoa(x))
}
func powInt(x, p int) (result int) {
	result = 1
	for i := 0; i < p; i++ {
		result *= x
	}
	return
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}
func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}
func abs(x int) int {
	return int(math.Abs(float64(x)))
}
func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}
func yes() {
	fmt.Println("Yes")
}
func no() {
	fmt.Println("No")
}


Measured memory_bytes: 640
N,K=map(int,input().split())
from math import factorial
mod=(10**9)+7
space = N-K+1
def comb(n,k):
  ret = 1
  mod=(10**9)+7
  k=min(n-k,k)
  for i in range(k):
    ret*=(n-i)%mod
    ret*=pow(i+1,mod-2,mod)
  ret%=mod
  return ret
 
for i in range(1,K+1):
  if space<i:
    print(0)
    continue
  ans = 1
  ans*=comb(space,i)
  ans*=comb(K-1,i-1)
  ans%=mod
  print(ans)

Measured memory_bytes: 43740
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = println(solve(new Scanner(System.in)))

  def solve(in: String): String = solve(new Scanner(in))

  def gcd(x: Int, y: Int): Int = {
    if (y == 0) x
    else gcd(y, x % y)
  }

  def gcd(seq: Seq[Int]): Int = {
    require(seq.nonEmpty)
    gcd(seq.head, seq.tail: _*)
  }

  def gcd(m: Int, ns: Int*): Int = m match {
    case 1 => m
    case _ =>
      ns match {
        case Nil => m.abs
        case n +: rest => gcd(gcd(m, n), rest: _*)
      }
  }

  def solve(sc: Scanner): String = {
    val N = sc.nextInt
    val X = sc.nextInt
    val x = (Array.fill(N)(sc.nextInt) :+ X).sorted

    val xd = for (i <- 1 to N) yield x(i) - x(i - 1)
    val result = gcd(xd)

    result.toString
  }
}


Measured memory_bytes: 76064
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <map>

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;


ll gcd(ll a, ll b) {
    if(a < b) return gcd(b, a);
    ll r;
    while ((r=a%b)) {
      a = b;
      b = r;
    }
    return b; //あまりが0ならそれが、最大公約数
}
//あまりが0になるまで a%b (a > bとする)
//あまりが0でなければ(あまりをrとし)、a = b; b = r         bと割ったあまり で　b%r する

ll lcm(ll a, ll b) {
    ll g = gcd(a,b);
    return a*b/g;
}

int main(){
    //N:sの最初の長さ
    ll N,M;
    cin >> N >> M;
    string s,t;
    cin >> s >> t;

    ll l = lcm(N,M);
    // l = a * N; 
    // l = b * M; 
    ll a = l / N;
    ll b = l / M;

    ll l2 = lcm(a,b);

    for(int i = 0; i < l / l2; ++i)
    {
        if(s[i * l2 / a] != t[i * l2 / b])
        {
            cout << -1 << endl;
            return 0;
        }
    }

    cout << l << endl;

    return 0;    
}



Measured memory_bytes: 512
temp = ""

in_keys = input().rstrip()

while(True):

    index = in_keys.find("B")
    if index == -1:
        break
    elif index == 0:
        temp = in_keys[1:]
    else:
        temp = in_keys[:index-1] + in_keys[index+1:]
        #print(in_keys[:index-1],in_keys[index+1:])

    in_keys = temp

print(in_keys)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define base 1000000007LL
#define ll long long
#define X first
#define Y second
#define pb push_back
#define MAXN 21010
#define Scan(a) scanf("%I64d", &a)
#define CLR(a) memset(a,0,sizeof(a))
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORE(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)

using namespace std;

typedef pair<int, int> II;
typedef vector<II> vi;

int main()
{
    ios::sync_with_stdio(0);
    //freopen("inp.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ll n;
    cin >> n;
    ll h = 0;
    FOR(i,1,100000) {
        h += i;
        if (h >= n) {
            cout << i;
            return 0;
        }
    }
    return 0;
}


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


string Shuffle(string Text,int h){
    //交換する関数
    string front=Text.substr(0,h);
    string back=Text.substr(h,Text.size()-h);
    return back+front;
}
int main(){
    string text;
    int value;
    int num;
    while(1){
       cin>>text;
       if(text== "-" ) break;
       cin>>value;
       for(int i=0;i<value;i++){
           cin>>num;
           text=Shuffle(text,num);
        }
        cout<<text<<endl;;
    }
    return 0;
} 


Measured memory_bytes: 3160
#include <bits/stdc++.h>
#define rep(var, start, end) for(int var = start; var < end; ++var)
#define all(container) begin(container), end(container)
#define eb(x)  emplace_back(x);
#define err(x) cout << #x << " : " << x << "\n";
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
const ll MOD = 1000000;

int main() {
	fast;
	int r; cin >> r; cout << r * r;
	return 0;
}



Measured memory_bytes: 256
use proconio::{input, fastout};

#[fastout]
fn main() {
    input! {
        n: usize,
        aa: [u64;n]
    }
    let mut m = aa[0];
    let mut res = 0;
    for a in aa.iter().skip(1) {
        if *a < m {
            res += m - a;
        } else if *a > m {
            m = *a;
        }
    }
    println!("{}", res);
}


Measured memory_bytes: 5704
#include <iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<set>
#include<map>
#define INF 1e8
using namespace std;
#define ll long long

#define MAX 100020
#include <iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<set>
#include<map>
#define INF 1e8
using namespace std;
#define ll long long

#define MAX 100020

int main(){
string week[7]{"SUN", "MON", "TUE", "WED", "THU", "FRI","SAT"};
string str;
  cin>>str;

int i;  
  for(i=0;i<7;i++)
  {
    if(str==week[i])
      break;
  }
  
  cout<<7-i;
}

Measured memory_bytes: 3184
using System;
using System.Collections.Generic;

namespace abc121_c
{
  class Program
  {
    static void Main(string[] args)
    {
      var n = CIn.ReadInt();
      var m = CIn.ReadInt();
      var l = new SortedDictionary<int, int>();
      var c = 0L;
      var d = 0;
      
      for (var i = 0; i < n; i++)
      {
        var key = CIn.ReadInt();

        if (!l.ContainsKey(key))
        {
          l[key] = 0;
        }

        l[key] += CIn.ReadInt();
      }

      foreach (var e in l)
      {
        var v = e.Value;
        while (v-- > 0)
        {
          c += e.Key;
          if (++d == m)
          {
            Console.WriteLine(c);
            return;
          }
        }
      }
    }
  }

  class CIn
  {
    private static readonly Queue<string> fieldBuffer = new Queue<string>();

    public static string Read()
    {
      if (fieldBuffer.Count == 0)
      {
        foreach (var field in Console.ReadLine().Split())
        {
          fieldBuffer.Enqueue(field);
        }
      }

      return fieldBuffer.Dequeue();
    }

    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());

    public static string[] ReadStringArray(long n)
    {
      var array = new string[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = Read();
      }

      return array;
    }

    public static int[] ReadIntArray(long n)
    {
      var array = new int[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadInt();
      }

      return array;
    }

    public static long[] ReadLongArray(long n)
    {
      var array = new long[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadLong();
      }

      return array;
    }
    public static double[] ReadDoubleArray(long n)
    {
      var array = new double[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadDouble();
      }

      return array;
    }
  }
}

Measured memory_bytes: 22156
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int n;
	cin >> n;
	string s1;
	cin >> s1;
	rep(i, 2) rep(j, 2){
		//only 4 possibilities, really
		//so guess sheep 1 and sheep 2
		string s = "";
		rep(k, n) s += '?';
		if(i) s[0] = 'S';
		else s[0] = 'W';
		if(j) s[1] = 'S';
		else s[1] = 'W';
		int f = 1;
		rep(k, n){
			int next = (k + 1) % n;
			int last = k - 1;
			if(last == -1) last += n;
			int f1 = (s1[k] == 'o');
			if(s[k] == 'W')  f1 ^= 1;
			if(f1){
				if(s[last] != '?' && s[next] != '?'){
					if(s[last] != s[next]){
						f = 0;
						break;
					}
					continue;
				}
				if(s[last] != '?') s[next] = s[last];
				else if(s[next] != '?') s[last] = s[next];
			}
			else{
				if(s[last] != '?' && s[next] != '?'){
					if(s[last] == s[next]){
						f = 0;
						break;
					}
					continue;
				}
				if(s[last] != '?'){
					if(s[last] == 'S') s[next] = 'W';
					else s[next] = 'S';
				}
				else if(s[next] != '?'){
					if(s[next] == 'S') s[last] = 'W';
					else s[last] = 'S';
				}
			}
		}
		if(f){
			cout << s << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Measured memory_bytes: 748
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    long long all=0;
    cin>>n;
    int a[n];
    long long x[n],mg=0,mk=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        all+=a[i];
        if(i%2)mg+=a[i];
        else if(i)mk+=a[i];
    }
    int lg=1,rg=0,lk=2,rk=1;
    for(int i=0;i<n;i+=2){//偶数山(g)
        x[i]=all-(mg*2);
        mg+=a[rg]-a[lg];
        rg+=2;
        lg+=2;
        if(lg>=n)lg-=n;
    }
    for(int i=1;i<n;i+=2){//奇数山(k)
        x[i]=all-(mk*2);
        mk+=a[rk]-a[lk];
        rk+=2;
        lk+=2;
        if(rk>=n)rk-=n;
        if(lk>=n)lk-=n;
    }
    for(int i=0;i<n;i++)cout<<x[i]<<endl;
    return 0;
}

Measured memory_bytes: 2432
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		char c=sc.next().charAt(0);
		System.out.println(c=='a'||c=='i'||c=='u'||c=='e'||c=='o'?"vowel":"consonant");
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
	
}


Measured memory_bytes: 21972
#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

int main(void) {
  string str;
  
  while(getline(cin, str)) {
    int cnt = 0;
    
    while(1) {
      for(int i=0; i<str.length(); i++)
	if(str[i] != ' ' && str[i] != '.') str[i] = (str[i]-'a' + 1)%26 + 'a';
      
      if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) {
      	cout << str << endl;
	break;
      }
    }
    
  }
  return 0;
}

Measured memory_bytes: 1176
#include<iostream>
#include<vector>
#include<set>
#include<functional>
#include<map>
#define MAX 10010
#include<queue>
using namespace std;
typedef pair<int,int> P;
int main(){
	int e,q,t,n,m,s,p;
	while(cin>>e>>q,e||q){
		vector<P> tab[MAX];
		cin>>p;
		for(int i=0;i<p;i++){
			cin>>t>>n>>m>>s;
			tab[m-1].push_back(P(t,s));
		}
		int now,t1,t2;
		cin>>n;
		for(int i=0;i<n;i++){
			cin>>t1>>t2>>m;
			now=t1;
			int ans=0,sum=0;
			int j;
			m--;
			for(j=0;j<tab[m].size()&&tab[m][j].first<t2;j++){
				if(!tab[m][j].second){
					if(sum>0&&tab[m][j].first>=t1&&tab[m][j].first<t2){
						ans+=tab[m][j].first-now;
					}sum--;
					if(tab[m][j].first>t1&&tab[m][j].first<t2)
					now=tab[m][j].first;
				}
				else if(tab[m][j].second){
					if(sum>0&&tab[m][j].first>t1&&tab[m][j].first<t2){
						ans+=tab[m][j].first-now;
					}sum++;
					if(tab[m][j].first>=t1&&tab[m][j].first<t2)
					now=tab[m][j].first;
				}
			}
			if(sum>0)
			ans+=t2-now;
			cout<<ans<<endl;
			
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<fstream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

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

    // input
    ll N, P;
    cin >> N >> P;


    ll odd = 0;
    ll even = 0;
    FOR(i, 0, N){
        ll a;
        cin >> a;
        if(a%2==0){
            even++;
        }else{
            odd++;
        }
    }

    cout << setprecision(15);

    if(odd==0){
        if(P==0){
            p(pow(2, N));
        }else{
            p(0);
        }
    }else{
        p(pow(2, N-1));
    }

    return 0;
}

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

int main()
{
  int n;
  cin >> n;
  int xy[15][15];
  for (int i = 0; i < n; i++)
  {
    for (int j = 0; j < n; j++)
    {
      xy[i][j] = -1;
    }
  }

  for (int i = 0; i < n; i++)
  {
    int a;
    cin >> a;
    for (int j = 0; j < a; j++)
    {
      int x, y;
      cin >> x >> y;
      --x;
      xy[i][x] = y;
    }
  }
  int ans = 0;
  for (int i = 0; i < (1 << n); i++)
  {
    vector<int> d(n);
    for (int j = 0; j < n; j++)
    {
      if (i >> j & 1)
      {
        d[j] = 1;
      }
    }
    int flg = 1;
    for (int j = 0; j < n; j++)
    {
      if (d[j])
      {
        for (int k = 0; k < n; k++)
        {
          if (xy[j][k] == -1)
          {
            continue;
          }
          if (xy[j][k] != d[k])
          {
            flg = 0;
          }
        }
      }
    }
    if (flg)
    {
      ans = max(ans, __builtin_popcount(i));
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;

ll GCD(ll a, ll b)
{
  if(b == 0) return a;
  else return GCD(b, a % b);
}

ll LCM(ll a, ll b)
{
  ll g = GCD(a,b);
  return a*(b/g);
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  ll ans = 1;
  REP(i,n){
    ll t;
    cin >> t;
    ans = LCM(ans,t);
  }
  cout << ans << '\n';
  return 0;
}

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

int main() {
  int W,H;
  cin>>H>>W;
  for(int i=0;i<H+2;i++){
    if(i==0||i==H+1){
      for(int j=0;j<W+2;j++){
        cout<<"#";
      }
    }else{
      for(int j=0;j<3;j++){
        if(j==0||j==2){
          cout<<"#";
        }else{
          string st;
          cin>>st;
          cout<<st;
        }
      }
    }
    cout<<endl;
  }
}
          
  
  
  
  
 
  
 
  



Measured memory_bytes: 3580
X = list(map(int,input().split()))
a = X[0]
b = X[1]
c = X[2]

count = 0
if a == b :
  count += 1

if a == c :
  count += 1

if b ==c :
  count += 1

if count == 1 :
  print('Yes')
else:
  print('No')
  

Measured memory_bytes: 3060
#include  <functional>
#include  <algorithm>
#include  <exception>
#include  <stdexcept>
#include  <streambuf>
#include  <iterator>
#include  <string.h>
#include  <stdlib.h>
#include  <typeinfo>
#include  <valarray>
#include  <iostream>
#include  <sstream>
#include  <istream>
#include  <stdio.h>
#include  <climits>
#include  <clocale>
#include  <complex>
#include  <csetjmp>
#include  <csignal>
#include  <cstdarg>
#include  <cstddef>
#include  <ctype.h>
#include  <cassert>
#include  <cstdlib>
#include  <utility>
#include  <cstring>
#include  <numeric>
#include  <ostream>
#include  <cwctype>
#include  <fstream>
#include  <iomanip>
#include  <math.h>
#include  <bitset>
#include  <cctype>
#include  <string>
#include  <vector>
#include  <limits>
#include  <memory>
#include  <cerrno>
#include  <time.h>
#include  <iosfwd>
#include  <cfloat>
#include  <cstdio>
#include  <cwchar>
#include  <cmath>
#include  <ctime>
#include  <deque>
#include  <queue>
#include  <stack>
#include  <ios>
#include  <map>
#include  <set>
#include  <new>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define pii pair<int,int>
using namespace std;
string s,t;
int main()
{
    cin>>s>>t;
    string now="";
    for(int i=0;i<s.size();i++)
    {
        if((s.substr(i,s.size()-i)+now)==t)
        {
            cout<<"Yes"<<endl;
            return 0;
        }
        now=now+s[i];
    }
    cout<<"No"<<endl;
    return 0;
}


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

using namespace std;

#define int 		long long
#define endl 		"\n"
#define mod 		1000000007
#define inf 		1e12
#define IOS 		ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

void addSelf(int& x, int y) {
	x += y;
	if (x > mod)
		x -= mod;
}

void subSelf(int& x, int y) {
	x -= y;
	if (x < 0)
		x += mod;
}

int32_t main() {

	IOS;

	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	vector<vector<int>> dp(n + 1, vector<int> (k + 1));

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

	for (int i = 0; i <= n; i++)
		dp[i][0] = 1;

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= k; j++)
			addSelf(dp[i - 1][j], dp[i - 1][j - 1]);

		for (int j = 1; j <= k; j++) {

			int l = j - min(a[i - 1], j), r = j;

			addSelf(dp[i][j], dp[i - 1][r]);
			if (l > 0)
				subSelf(dp[i][j], dp[i - 1][l - 1]);
		}
	}

	cout << dp[n][k];

	return 0;
}

Measured memory_bytes: 83036
object Main {
  def main(args:Array[String]) {
    val Array(a, b, x) = readLine().split(' ').map(_.toInt)
    val aab = a * a * b
    val h = x.toDouble / a.toDouble
    val degree = Math.toDegrees(Math.atan(
      if(a * b > h * 2) b * b / h / 2
      else (a * b - h) * 2 / a / a))
    println(degree)
  }
}


Measured memory_bytes: 27436
h,w=map(int,input().split())
inp=["#"*(2+w)]

cnt=0

for _ in range(h):
  temp=input()
  inp.append("#"+temp+"#")
  cnt+=temp.count(".")

inp.append("#"*(w+2))
result=[[-1 for _ in range(w+2)] for _ in range(h+2)]
result[1][1]=1

dx=[0,0,-1,1]
dy=[1,-1,0,0]

import queue
q=queue.Queue()
q.put([1,1])


while not q.empty():
  temp=q.get()
  i=0
  while i <len(dx):
    x=temp[1]+dx[i]
    y=temp[0]+dy[i]
   
    ##print(result)
    if inp[y][x]=="." and result[y][x]==-1:
      
    
      q.put([y,x])
      result[y][x]=result[temp[0]][temp[1]]+1
    i+=1
    
if result[h][w]==-1:
  print(-1)
else:
  print(cnt-result[h][w])

      

    

Measured memory_bytes: 43368
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
//aij郔湮硉岆min(Ai,Bj); 
int n,m;
int r[1000000+100];
int c[1000000+333];
int a[1005]; int b[1005];
int main(){
	cin >> n >> m;
	for (int i=1; i<=n; i++){
		cin >> a[i];
		r[a[i]]=i;
	}
	for (int i=1; i<=m; i++){
		cin >> b[i];
		c[b[i]]=i;
	}
	int r_c=0; int c_c=0;
	long long ans=1;
	for(int i=m*n; i>0;i--){
		if(r[i]&&c[i]){
			ans *= 1; 
			r_c++; c_c++;
		}else if(r[i] && !c[i]){
			ans *= c_c;
			r_c++;
		}else if(!r[i] && c[i]){
			ans *= r_c;
			c_c++;
		}else{
			ans *= (r_c*c_c- (m*n-i));
		}
		ans%=mod;
	}
	cout << ans;
}

Measured memory_bytes: 2304
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 998244353;

int powM(int x, int n){
    if(n == 0){
        return 1;
    }
    if(n % 2 == 0){
        return powM(x * x % MOD, n / 2);
    }
    return powM(x, n-1) * x % MOD;
}

int factM(int n){
    static vector<int> t = {1};

    if((int)t.size() > n){
        return t[n];
    }

    for(int i = t.size(); i <= n; i++){
        t.push_back(t[i-1] * i % MOD);
    }
    return t[n];
}

int comb(const vector<int>& t, int cn, int n, int k){
    if(n < k){
        return 0;
    }
    return cn * t[k] % MOD * t[n-k] % MOD;
}

vector<int> makeTable(int n){
    vector<int> t(n+1);
    t[n] = powM(factM(n), MOD-2);

    for(int i = n-1; i >= 0; i--){
        t[i] = t[i+1] * (i+1) % MOD;
    }
    return t;
}

signed main(){
    int n, a, b, k;
    cin >> n >> a >> b >> k;

    vector<int> table = makeTable(n);

    int aa = min(a, b);
    int bb = max(a, b);

    int x = k / aa;
    if(x > n){
        x = n;
    }

    int ans = 0;
    while(x >= 0){
        int r = k - x * aa;
        int y = r / bb;
        if(r % bb != 0){
            x--;
            continue;
        }

        int t1 = comb(table, factM(n), n, x);
        int t2 = comb(table, factM(n), n, y);
        int tmp = t1 * t2 % MOD;
        ans = (ans + tmp) % MOD;
        x--;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8816
#include <algorithm>
#include <vector>
#include <cfloat>
#include <string>
#include <cmath>
#include <set>
#include <cstdlib>
#include <map>
#include <ctime>
#include <iomanip>
#include <functional>
#include <deque>
#include <iostream>
#include <cstring>
#include <queue>
#include <cstdio>
#include <stack>
#include <climits>
#include <sys/time.h>
#include <cctype>

using namespace std;

typedef long long ll;

int includeTax(int a, int x) {
  return (int)(double(a)*(100.+double(x))/100.);
}

int main(int argc, char *argv[]) {
  char heap[80];
  int before_tax;
  int after_tax;
  int sum;
  int a, b;
  int a_x, b_x;

  while(1){
    scanf("%d %d %d", &before_tax, &after_tax, &sum);
    if(before_tax ==0 && after_tax == 0 && sum == 0) break;

    int ans = 0;
    for(a = 1; a <= sum-1; a++){
      for(b = a; b <= sum-1; b++){
	a_x = includeTax(a, before_tax);
	b_x = includeTax(b, before_tax);
	// if (includeTax(a, after_tax)+includeTax(b, after_tax) > sum) break;

	if (a_x+b_x == sum) {
	  ans = max(ans, includeTax(a, after_tax)+includeTax(b, after_tax));
	}
      }
    }

    std::cout << ans << std::endl;
  }
}

Measured memory_bytes: 1208
#include<stdio.h>

int main()
{
    int x,y;

    while(1) {
      scanf("%d %d", &x, &y);
      if(x==0 && y==0)  break;
      if(x>y) printf("%d %d\n", y, x);
      else    printf("%d %d\n", x, y);
    }

    return 0;
}



Measured memory_bytes: 2044
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#include "queue"
#include "functional"
#include "map"
#include "unordered_map"

#define lp(n) for (int i = 0; i < n; i++)
#define LP(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nya_n "(=^･ω･^=)"
typedef long long ll;
using namespace std;

/*
ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	ll g = gcd(x, y);
	return x / g * y;
}*/



ll pw(int x, int n) {
	ll y = 1;
	ll p = x;
	while (n != 0) {
		if (n % 2) {
			y = y*p%mod;
			n = n - 1;
		}
		else {
			p = p*p%mod;
			n = n / 2;
		}
	}
	return y;
}

ll modinv(ll x) {
	return pw(x, mod - 2);
}


int h, w, a, b;
ll f[200000], mf[200000], ans;

int main() {
	cin >> h >> w >> a >> b;
	f[0] = 1;
	lp(199999) {
		f[i + 1] = f[i] * (i + 1) % mod;
	}
	lp(200000) {
		mf[i] = modinv(f[i]);
	}
	ans = 0;
	lp(w - b) {
		ans = (ans + (((((f[h - a + b - 1 + i] * mf[h - a - 1] % mod) * mf[b + i] % mod)* f[w - b + a - 2 - i] % mod)* mf[a - 1] % mod)  * mf[w - b - i - 1]) % mod) % mod;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){

  int K,N;
  cin >> N >> K;
  vector<int> h(N);
  for(int i=0; i<N; i++){
    cin >> h.at(i);
  }
  sort(h.begin(), h.end());

  int sa=h.at(K-1)-h.at(0);
  for(int i=1; i<N-K+1; i++){
    if(sa > (h.at(i+K-1)-h.at(i)))
    sa = h.at(i+K-1)-h.at(i);
  }

  cout << sa << endl;
}


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

const int N = 100005;
int h[N];
vector<int> adj[N];

int n,m;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	cin>>n>>m;
	for(int i=1;i<=n;i++) cin>>h[i];
	for(int i=0;i<m;i++){
		int x,y;
		cin>>x>>y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	
	int ans = 0;
	for(int i=1;i<=n;i++){
		int mx = 0;
		for(int j:adj[i]){
			mx = max(mx,h[j]);
		}
		if(mx < h[i])ans++;
	}
	
	cout<<ans;
	
	return 0;
}


Measured memory_bytes: 9152
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>
#include <map>

#define INF 1000000000
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

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

  string s; cin>>s;
  string ans = "No";
  for(auto c: s) {
    if(c == '9') ans = "Yes";
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
# 素因数分解されたリストを返す
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr

def count_make_fact(n):
    count = 1
    while n - count >= 0:
        n -= count
        count += 1
    return count-1

n = int(input())

if n == 1:
    print(0)
else:
    factor_list = factorization(n)
    list = sum(map(count_make_fact,(map(lambda list: list[1],factor_list))))
    print(list)


Measured memory_bytes: 9484
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	string s;
	while(getline(cin,s)){
		string t="";
		set<string>out,no;
		rep(i,s.size())if(isalpha(s[i]))t+=toupper(s[i]);
		rep(i,t.size())loop(j,3,t.size()+1)if(i+j<=t.size()){
			string a=t.substr(i,j),b=a;
			reverse(all(b));
			if(a==b){
				out.insert(a);
				no.insert(t.substr(i+1,j-2));
			}
		}
		vector<string>ans;
		for(set<string>::iterator it=out.begin();it!=out.end();it++)
			if(no.find(*it)==no.end())
				ans.pb(*it);
		rep(i,ans.size()){
			if(i)cout<<" ";
			cout<<ans[i];
		}
		cout<<endl;
	}
}

Measured memory_bytes: 1256
#include <stdio.h>

int main (){
    int N = 0;
    int A[100] = {0};
    int tmp, minj, j, i, k=0;
   
    scanf("%d", &N);
    for(i=0; i<N; i++){
        scanf("%d", &A[i]);
    }
    
    for(i=0; i<=N-1; i++){
        minj = i;
        for(j=i; j<=N-1; j++){
            if(A[j] < A[minj]){
                minj = j;
                //k++;
            }
        }
        if(A[i] > A[minj]){
            tmp = A[i];
            A[i] = A[minj];
            A[minj] = tmp;
            k++;
        }
    }
    
    for(i=0; i<N-1; i++){
        printf("%d ", A[i]);
    }printf("%d\n%d\n", A[N-1], k);
    
    
return 0;
}


Measured memory_bytes: 2040
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
#define MAX 10000
#define INFTY 1000000000
#define WHITE 0
#define GRAY 1
#define BLACK 2

int num;
vector <pair<int,int> > adj[MAX]; //vector:動的に配列を確保する

void dijkstra(int s){
  priority_queue<pair<int,int> >PQ; 
  /*priority_queueとは
要素追加時 → 内部的に要素がソートされる
要素取出時 → 一番先頭にある要素が取り出される*/
  int i,u,v,j;
  int color[MAX],d[MAX];

  for(i=0; i<num; i++){
    color[i] = WHITE;
    d[i] = INFTY;
  }
  d[s] = 0;
  PQ.push(make_pair(0,0)); //pair使用時は型指定が必要だが、make_pairはそれを省略できる
  color[0] = GRAY;


  while(!PQ.empty()){
    pair<int,int> f = PQ.top(); //fに先頭をいれておき、popで取り出す
    PQ.pop();
    // .first: キーの値を取得    .second:実際の値を取得
    u = f.second;
    color[u] = BLACK;

    if(d[u] < f.first * (-1)) continue;

    for(j=0; j<adj[u].size(); j++){
      v = adj[u][j].first;
      if(color[v] == BLACK) continue;
      if(d[v] > d[u] + adj[u][j].second){
	d[v] = d[u] + adj[u][j].second;
	PQ.push(make_pair(d[v] * (-1),v));
	color[v] = GRAY;
      }
    }
  }

  for(i=0; i<num; i++){
    printf("%d ",i);
    if(d[i] == INFTY) printf("-1\n");
    else printf("%d\n",d[i]);
  }
}


int main(){
  int i,j,k,u,v,c;
  scanf("%d",&num);
  for(i=0; i<num; i++){
    scanf("%d%d",&u,&k);
      for(j=0; j<k; j++){
	scanf("%d%d",&v,&c);
	adj[u].push_back(make_pair(v,c));
      }
    }
  dijkstra(0);

  return 0;
}

Measured memory_bytes: 6288
// In The Name Of God
#include <iostream>
#include <string.h>
#include <algorithm>
#include <set>
#include <vector>
#include <climits>
#include <map>
#include <queue>
#include <math.h>
#include <iomanip>

#define sqr(A) ((A) * (A))
#define F first
#define S second
#define MP make_pair
#define BSZ  __builtin_popcount
#define ALL(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
const int MOD2 = 1e9 + 9;
const int PR = 727;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

const int N = 51;
string s[N], ans;
int n, cnt[N][300], q[N];

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
		for (char c : s[i])
			cnt[i][c]++;
	}
	for (int i = 0; i < 300; i++)
		q[i] = cnt[0][i];
	for (int i = 1; i < n; i++)
		for (int j = 0; j < 300; j++)
			q[j] = min(q[j], cnt[i][j]);
	for (int i = 0; i < 300; i++)
		while (q[i]--)
			ans += char(i);
	cout << ans << endl;
}















Measured memory_bytes: 384
date=input().rstrip().split(" ")
A=int(date[0])
B=int(date[1])
C=int(date[2])
D=int(date[3])
a=0
while a==0:
  C=C-B
  if C<=0:
    print("Yes")
    a=1
  else:
    A=A-D
    if A<=0:
      print("No")
      a=1

Measured memory_bytes: 9132
import math
n = int(input())
a = [0] * 2
b = [0] * 2
a[0] = 0
b[0] = 100

def koch(n, a, b):
    if n == 0:
        return
    
    s = [0] * 2
    t = [0] * 2
    u =[0] * 2
    
    s[0] = (2.0 * a[0] + 1.0 * b[0]) / 3.0
    s[1] = (2.0 * a[1] + 1.0 * b[1]) / 3.0
    t[0] = (1.0 * a[0] + 2.0 * b[0]) / 3.0
    t[1] = (1.0 * a[1] + 2.0 * b[1]) / 3.0
    u[0] = (t[0] - s[0]) * math.cos(math.pi/3) - (t[1] - s[1]) * math.sin(math.pi/3) + s[0]
    u[1] = (t[0] - s[0]) * math.sin(math.pi/3) + (t[1] - s[1]) * math.cos(math.pi/3) + s[1]
    
    koch(n - 1, a, s)
    print(s[0], s[1])
    koch(n - 1, s, u)
    print(u[0], u[1])
    koch(n - 1, u, t)
    print(t[0], t[1])
    koch(n - 1, t, b)

print(a[0], a[1])
koch(n, a, b)
print(b[0], b[1])


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

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i=0;i<n;i++) cin >> a[i];
    int cnt = a[0];
    for(int i=1;i<n;i++) cnt ^= a[i];
    for(int i=0;i<n;i++) cout << int(cnt^a[i]) << ' ';
    cout << endl;
}


Measured memory_bytes: 4324
import java.util.*;
import java.io.*;
public class Main{
	public static void main(String sp[])throws IOException{
		Reader sc = new Reader();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long diff = (Math.max(a,b)-Math.min(a,b));
		if(diff%2==0){
			long val = Math.max(a,b)-(diff/2l);
			System.out.println(val);
		
		}else System.out.println("IMPOSSIBLE");
		
	}
	static class Reader
		{
			final private int BUFFER_SIZE = 1 << 16;
			private DataInputStream din;
			private byte[] buffer;
			private int bufferPointer, bytesRead;
			BufferedReader br;
			public Reader()
			{
				din = new DataInputStream(System.in);
				buffer = new byte[BUFFER_SIZE];
				bufferPointer = bytesRead = 0;
				br = new BufferedReader(new InputStreamReader(System.in));
			}
	 
			public Reader(String file_name) throws IOException
			{
				din = new DataInputStream(new FileInputStream(file_name));
				buffer = new byte[BUFFER_SIZE];
				bufferPointer = bytesRead = 0;
			}
	 
			public String readLine() throws IOException
			{
				byte[] buf = new byte[64]; // line length
				int cnt = 0, c;
				while ((c = read()) != -1)
				{
					if (c == '\n')
						break;
					buf[cnt++] = (byte) c;
				}
				return new String(buf, 0, cnt);
			}
			
			
			
	 
			public int nextInt() throws IOException
			{
				int ret = 0;
				byte c = read();
				while (c <= ' ')
					c = read();
				boolean neg = (c == '-');
				if (neg)
					c = read();
				do
				{
					ret = ret * 10 + c - '0';
				} while ((c = read()) >= '0' && c <= '9');
	 
				if (neg)
					return -ret;
				return ret;
			}
	 
			public long nextLong() throws IOException
			{
				long ret = 0;
				byte c = read();
				while (c <= ' ')
					c = read();
				boolean neg = (c == '-');
				if (neg)
					c = read();
				do
				{
					ret = ret * 10 + c - '0';
				}
				while ((c = read()) >= '0' && c <= '9');
				if (neg)
					return -ret;
				return ret;
			}
	 
			public double nextDouble() throws IOException
			{
				double ret = 0, div = 1;
				byte c = read();
				while (c <= ' ')
					c = read();
				boolean neg = (c == '-');
				if (neg)
					c = read();
	 
				do
				{
					ret = ret * 10 + c - '0';
				}
				while ((c = read()) >= '0' && c <= '9');
	 
				if (c == '.')
				{
					while ((c = read()) >= '0' && c <= '9')
					{
						ret += (c - '0') / (div *= 10);
					}
				}
	 
				if (neg)
					return -ret;
				return ret;
			}
	 
			private void fillBuffer() throws IOException
			{
				bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
				if (bytesRead == -1)
					buffer[0] = -1;
			}
	 
			private byte read() throws IOException
			{
				if (bufferPointer == bytesRead)
					fillBuffer();
				return buffer[bufferPointer++];
			}
			StringTokenizer st;
			String next() {
				while (st == null || !st.hasMoreTokens()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (Exception r) {
						r.printStackTrace();
					}
				}
				return st.nextToken();
			}
	 
	 
			public void close() throws IOException
			{
				if (din == null)
					return;
				din.close();
			}
		}
}

Measured memory_bytes: 22484
#include<bits/stdc++.h>
#define ll long long 
#define ld long double
#define pb push_back
#define vl vector
#define ff first
#define ss second
using namespace std;
int main()
{
    ll a,b,i,j,n,t;
    cin>>n>>a>>b;
    a=min(n*a,b);
    cout<<a;
}

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

int K, S;
int N = 0;

void load_vars(){
  cin >> K >> S;
}

int main(){
  load_vars();
    
  for (int x = 0; x <= K; x++){
    for (int y = 0; y <= K; y++){
      int z = S - x - y;
      if (z >= 0 & z <= K) N++;
    }
  }
  
  /*
  if (S <= 2 * K){
    N = (S+2) * (S + 1) / 2;
  } else {
    N = (3 * K - S + 2) * (3 * K - S + 1) / 2; 
  }
  */
  cout << N;
}

Measured memory_bytes: 256
use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {a:usize,b:[u128;a]}
    let mut ans: u128 = 1;
    for i in &b {
        if i == &0 {
            println!("0");
            return;
        }
    }

    let max = 10_u128.pow(18);
    for i in &b {
        ans *= i;
        if ans > max {
            println!("-1");
            return;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 5320
def recurssion(A, possible, i, sum, size):
    if i == size:
        return
    else:
        possible.add(sum + A[i])
        recurssion(A, possible, i+1, sum, size)
        recurssion(A, possible, i+1, sum + A[i], size)

n = int(input())
A = list(map(int,input().split()))
q = int(input())
aim = list(map(int,input().split()))
possible = set()
recurssion(A, possible, 0, 0, n)
for i in range(q):
    if aim[i] in possible:
        print("yes")
    else:
        print("no")


Measured memory_bytes: 5652
#include <stdio.h>
int main(){
  int i,j,k;
  int n,m,l;
 long  int A[100][100]={};
  long int B[100][100]={};
  long long int C[100][100]={};

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

  for(i=0;i<n;i++){
    for(j=0;j<m;j++){
      scanf("%ld",&A[i][j]);
    }
  }
  
for(i=0;i<m;i++){
    for(j=0;j<l;j++){
      scanf("%ld",&B[i][j]);
     }
  }

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

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



Measured memory_bytes: 2088
#include <iostream>
#include <vector>
using namespace std;
//Dijkstra法(c[i][j]は節点iから節点jへのコスト，startは始点番号，nは節点数)
vector<double> Dijkstra(vector<vector<double>>c, int start, int n)
{
	int i, j, min_j;

	double min;

	vector<double> dist(n, 99999); //dist[i]はstartからiへの最短コスト
	vector<bool> u(n, true); //u[i]はstartから節点iへのコストが未確定か否かを示す
	vector<int> prev(n, 0);  //prev[i]は節点iへ繋ぐ節点番号を格納


	//すべての節点へのコストを無限大とする
	for(i=0; i<n; i++){
		dist[i]=99999;
	}

	//始点のコストは0
	//u[start]=false;
	dist[start]=0;
	for(i=0; i<n; i++){
		//節点コストが確定していない点の中で，startからのコストが最小の節点min_jを求める
		min=999999;
		for(j=0; j<n; j++){
			if(min>dist[j]&&u[j]==true){
				min=dist[j]; min_j=j;
			}
		}
		//節点min_jのコストを決定する
		u[min_j]=false;
		for(j=0; j<n; j++){
			if(dist[j]>dist[min_j]+c[min_j][j]&&u[j]==true){
				dist[j]=dist[min_j]+c[min_j][j];
				prev[j]=min_j;
			}
		}
	}
	return dist;
}
int main(void)
{
	int i, j, h, w;
	double ans=0;
	vector<vector<double>> c(10, vector<double>(10)), dist2(10, vector<double>(10));
	vector<double> dist(10);
	vector<vector<int>> a(200, vector<int>(200));

	cin>>h>>w;

	for(i=0; i<10; i++){
		for(j=0; j<10; j++){
			cin>>c[i][j];
		}
	}
	for(i=0; i<h; i++){
		for(j=0; j<w; j++){
			cin>>a[i][j];
		}
	}

	for(i=0; i<10; i++){
		dist=Dijkstra(c, i, 10);
		for(j=0; j<10; j++){
			dist2[i][j]=dist[j];
		}
	}

	for(i=0; i<h; i++){
		for(j=0; j<w; j++){
			if(a[i][j]!=-1&&a[i][j]!=1){
				ans+=dist2[a[i][j]][1];
			}
		}
	}
	cout<<(int)ans<<endl;
}

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

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define int ll

const ll MOD = 1000000007;
const ll INF_LL = (ll)1000000007 * 1000000007;
const int INF_INT = (int)1000000007;
const double PI = 3.14159265358979323846;

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define irep(itr, st) for (auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for (auto itr = (st).rbegin(); itr != (st).rend(); ++itr)

#define m0(x) memset((x), 0, sizeof((x)))
#define m1(x) memset((x), -1, sizeof((x)))

// xにはvectorなどのコンテナ
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define RALL(x) (x).rbegin(), (x).rend()  // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())     // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))  //最大値を求める
#define MIN(x) *min_element(ALL(x))  //最小値を求める
#define all(x) (x).begin(), (x).end()

//略記
#define pb emplace_back  // vectorヘの挿入
#define mp make_pair     // pairのコンストラクタ
#define F first          // pairの一つ目の要素
#define S second         // pairの二つ目の要素

#define BITCOUNT __builtin_popcount
#define BITCOUNT_LL(x) __builtin_popcountll(x)

#define perm(c)             \
  sort(all(c));             \
  for (bool c##p = 1; c##p; \
       c##p = next_permutation(all(c)))  //順列 123 132 213 231 312 321

#define BIT(n) (1LL << (n))

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ": " << (A) << std::endl;
#else
#define PRINT(A)
#endif

//入力高速化
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

signed main() {
  int N,X,T; cin >> N >> X >> T;
  int ans = (N+X-1)/X * T;
  cout << ans << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353
#define PI 3.14159265359

int main(){
	float r; cin >> r;
	cout << 2*r*PI << endl;
}

Measured memory_bytes: 3788
// A - Takahashi Calendar
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
	int m, d;
	cin >> m >> d;
	int ans = 0;
	for (int i = 1; i <= m; i++)
		for (int j = 10; j <= d; j++) {
			int d1 = j % 10, d2 = (j / 10) % 10;
			if (d1 >= 2 && d2 >= 2 && d1 * d2 == i) ans++;
		}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    A=INT()
    B=INT()
    C=INT()
    x=INT()
    ct=0
    for a in range(A+1):
        for b in range(B+1):
            for c in range(C+1):
                if a*500+b*100+c*50==x:
                    ct+=1
    print(ct)
    
if __name__ == '__main__':
    do()

Measured memory_bytes: 3188