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

#define trace(...) __f( #__VA_ARGS__ , __VA_ARGS__ )
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
        cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* na, Arg1&& arg1, Args&&... args) {
        const char* c = strchr(na + 1, ',');
        cerr.write(na, c - na) << " : " << arg1 << " , ";
        __f(c + 1, args...);
}
#define endl "\n"
#define all(V) V.begin(),V.end()
#define Unique(V) sort(all(V)), V.erase(unique(all(V)), V.end())
typedef pair <int,int> pii;
typedef long long LL;
const double pi = acos(-1.0);
const double eps = 1e-9;
const int inf = 1e9;
const long long INF = 1e18;
const int N = 2e5 + 5;

LL f[ N ];

int traill(LL x) {
    int cnt = 0;
    while (x%10 == 0) cnt++, x/= 10;
    return cnt;
}
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    #ifdef LOCAL
        //freopen("input.txt", "r", stdin);
    #endif // LOCAL
//    for (int i = 0; i <= 33; i++) {
//        if (i < 2) f[i] = 1;
//        else f[i] = i * f[i - 2];
//    }
//    for (int i = 0; i <= 33; i++) {
//        cout << i << " " << f[i] << " " << traill(f[i]) << endl;
//    }
    LL n;
    cin >> n;
    if (n%2 == 1) cout << 0 << endl;
    else {
        LL ans = 0;
        n /= 2;
        for (LL i = 5; n/i > 0; i *= 5) {
            ans += n/i;
        }
        cout << ans << endl;
    }
    return 0;
}







Measured memory_bytes: 256
#include <stdio.h>


int main(){
	char palavra[100];
	for(int i=0; i<100; ++i)
		palavra[i]=0;
	
	scanf("%s", palavra);

	for( int i= 0; i<100; ++i){
		if(palavra[i]!=0)
			printf("x");

	}
	printf("\n");
	return 0;
	
}

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

main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin>>n;
	vector<ll>h(n);
	vector<ll>dp(n);
	for(int i=0;i<n;i++)
	{
		cin>>h[i];
		dp[i]=INT_MAX;
	}
	dp[0]=0;
	for(int i=1;i<n;i++)
	{
		for(int j=i;j>-1 && i-j<=2;j--)
		{
			dp[i]=min(dp[i],dp[j]+abs(h[i]-h[j]));
		}
	}
	cout<<dp[n-1];
}

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

int main(void)
{
	int n;
	string instr;

	while(cin >> instr, !cin.eof()){
		if(instr.length() % 2){
			cout << "NA"  << endl;
			continue;
		}
		bool cannot = false;
		for(int i = 0; i < instr.length()-1; i+= 2){
			if(instr[i] < '1' || instr[i] > '6' || instr[i+1] < '1' || instr[i+1] > '5'){
				cannot = true;
				break;
			}
		}
		if(cannot){
			cout << "NA" << endl;
			continue;
		}
		for(int i = 0; i < instr.length()-1; i+=2){
			int a = instr[i]-'0', b = instr[i+1]-'0';
			int c = b+(a-1)*5;
			if(c <= 26)
				cout << (char)(c - 1+'a');
			else {
				switch(c%26){
					case 1:
						cout << '.';
						break;
					case 2:
						cout << '?';
						break;
					case 3:
						cout << '!';
						break;
					default:
						cout << ' ';
						break;
				}
			}

		}
		cout << endl;
			
	}

	return 0;
}

	

Measured memory_bytes: 1176
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
ll bpow(ll b, ll p, ll m) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
ll a[200005], b[200005];
ll psuma[200005], psumb[200005];
int main() {
  IOS;
  int n, m;
  cin >> n >> m;
  ll k;
  cin >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    psuma[i] = psuma[i - 1] + a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    psumb[i] = psumb[i - 1] + b[i];
  }
  int p1 = 0, p2 = 0, ans = 0;
  ll tmp = 0;
  int p = m;
  for (int i = 1; i <= n; i++) {
    tmp += a[i];
    if (psuma[i] > k)
      continue;
    while (psumb[p] > k - tmp && p > 0)
      p--;
    ans = max(ans, i + p);
  }
  p = n;
  for (int i = 1; i <= m; i++) {
    tmp = psumb[i];
    if (psumb[i] > k)
      continue;
    while (psuma[p] > k - tmp && p > 0)
      p--;
    ans = max(ans, i + p);
  }
  cout << ans << endl;
}

Measured memory_bytes: 9900
S = gets.to_s.split('')
able = 0
for i in 0..S.count
	if S[i] == "C" then
		for j in i..S.count
			if S[j] == "F" then
				able = 1
			end
		end
	end
end
if able == 1 then
	puts "Yes"
else
	puts "No"
end


Measured memory_bytes: 1788
#include <iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(void)
{
  int stoneNum;
  string stones;
  cin >> stoneNum >> stones;
  
  int iterW,iterR;
  int cntR = 0;
  int ans = 0;
  
  rep(i,stoneNum)
  {
    if(stones[i] == 'R')
    {
      cntR++;
    }
  }
  rep(i,cntR)
  {
    if(stones[i] == 'W')
    {
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3400
#include<stdio.h>
#include<iostream>
using namespace std;

int N;
string S;
int main (){
    cin >> N >> S;
    int a[100] = {0};
    int ans = 0;
    for(int i=1; i<N-1; i++){
        int d = 0;
        for(int j=0; j<i; j++){
        a[S[j]-'0'] = 1;
        }
        for(int k=i; k<N; k++){
            if ( a[S[k]-'0'] == 1 ){
                d++;
                a[S[k]-'0'] = 0;
            }
        }
        ans = max(d,ans);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
open Printf open Scanf
module MyInt = struct let (+) = (+) let (-) = (-) let (/) = (/) let ( * ) = ( * ) let (mod) = (mod) let (%) = (mod) let (+=) r v = r := !r + v let (-=) r v = r := !r - v let ( *=) r v= r := !r * v let (/=) r v = r := !r / v end
module MyInt64 = struct
	let (+$) = (+) let (-$) = (-) let (/$) = (/) let ( *$) = ( * ) let (+) p q = Int64.add p q let (-) p q = Int64.sub p q let ( * ) p q = Int64.mul p q let (/) p q = Int64.div p q let (+=) r v = r := !r + v let (-=) r v = r := !r - v let ( *=) r v= r := !r * v let (/=) r v = r := !r / v let labs p = if p < 0L then -1L*p else p let (~|) p = Int64.to_int p let (~~|) p = Int64.of_int p let input_i64_array n = Array.init (~| n) (fun _ -> Scanf.scanf " %Ld" (fun v -> v)) let get_i64 _ = Scanf.scanf " %Ld" (fun v -> v) let get_2_i64 _ = Scanf.scanf " %Ld %Ld" (fun u v -> u,v) let get_3_i64 _ = Scanf.scanf " %Ld %Ld %Ld" (fun u v w -> u,v,w) let get_4_i64 _ = Scanf.scanf " %Ld %Ld %Ld %Ld" (fun u v w x -> u,v,w,x) let get_5_i64 _ = Scanf.scanf " %Ld %Ld %Ld %Ld %Ld" (fun u v w x y -> u,v,w,x,y) let print_i64_endline n = n |> Int64.to_string |> print_endline let (mod) m n = m - (m/n) * n let (%) = (mod) let rec gcd m n = match m,n with | m,0L -> m | m,n -> gcd n (m mod n) let lcm m n = (m*n) / gcd m n let rep from_ to_ fbod = let i,f = ref ~|from_,ref true in while !i <= ~|to_ && !f do match fbod ~~| !i with | `Break -> f := false | _ -> i := !i +$ 1; done
	let string_of_list ?(separator=" ") f ls = let rec f0 a s = match a with | [] -> s | [h] -> s ^ (f h) ^ separator | h::t -> f0 t (s ^ (f h) ^ separator) in f0 ls "" let char_list_of_string str = let rec f0 i a = if i<0 then a else f0 (i-$1) (str.[i]::a) in f0 (String.length str -$ 1) [] let string_of_char_list ls = List.fold_left (fun u v -> u ^ (String.make 1 v)) "" ls
	let (@@@) = (@) let (@) a i = a.(~|i) let (<@) a (i,v) = a.(~|i) <- v
	let ceildiv m n = (m+n-1L) / n
end open MyInt64
module SSet = Set.Make(String)
let () =
	let n = get_i64 0 in
	let a = Array.init (~|n) (fun _ -> scanf " %s" (fun v -> v))
	in
	let st = SSet.of_list (a |> Array.to_list)
	in let siz = SSet.fold (fun _ u -> u+$1) st 0
	in
	(if siz <> Array.length a then "No" else
	Array.fold_left (fun (f,c) v ->
		let ct = v.[String.length v -$ 1] in
		if v.[0] = c then (f,ct)
		else (false,ct)
	) (true,a.(0).[0]) a
	|> (fun (f,_) -> if f then "Yes" else "No")
	)
	|> print_endline

Measured memory_bytes: 384
import bisect
K, N = map(int, input().split())
a = list(map(int, input().split()))

ans = min(a[-1] - a[0], K - a[-1] + a[-2])
for i in range(1, N - 1):
    ans = min(ans, K - a[i] + a[i - 1])

print(ans)

Measured memory_bytes: 26444
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		String str[] = br.readLine().split(" ");
		int sum = 0;

		for (int i = 0; i < n - 1; i++) {

			if(i != 0) {
				sum += Math.min(Integer.parseInt(str[i]), Integer.parseInt(str[i - 1]));
			}
			else {
				sum += Integer.parseInt(str[i]);
			}
		}
		sum += Integer.parseInt(str[n - 2]);



		System.out.println(sum);
	}
}


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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using Pt = pair<int, int>;

void ABC123B()
{
	int A[5];
	for (int i = 0; i < 5; ++i)
		cin >> A[i];
	int x = 0;
	int z = 0;
	for (int i = 0; i < 5; ++i)
	{
		x += A[i];
		int y = x % 10;
		if (y != 0)
		{
			z = max(z, 10 - y);
			x += 10 - y;
		}
	}
	x -= z;
	cout << x << endl;
}


int main()
{
	ABC123B();
	return 0;
}

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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;


int main()
{
    ll i,j;
    ll h,w;
    cin >> h >> w;
    vector<string> a(h);
    map<char, ll> mp;
    for(i = 0;i < h;++i){
        cin >> a.at(i);
        rep(j,w){
            ++mp[a.at(i).at(j)];
        }
    }
    if(h%2 == 0 && w%2 == 0){
        for(auto x:mp){
            if(x.second%4){
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
        return 0;
    }else if(h*w % 2 == 0 && (h%2 || w%2)){
        ll tmp = 0;
        for(auto x:mp){
            if(x.second%4 != 0 && x.second%4 != 2){
                cout << "No" << endl;
                return 0;
            }
            if(x.second%4 == 2) ++tmp;
        }
        ll num;
        if(h%2 == 0) num = h;
        else num = w;
        if(tmp > num/2) cout << "No" << endl;
        else cout << "Yes" << endl;
        return 0;
    }else{
        ll tmp1 = 0;
        ll tmp2 = 0;
        for(auto x:mp){
            if(x.second%4 == 3){
                cout << "No" << endl;
                return 0;
            }
            if(x.second%4 == 1) ++tmp1;
            else if(x.second%4 == 2) ++tmp2;
        }
        if(tmp1 > 1 || tmp2 > h+w-1) cout << "No" << endl;
        else cout << "Yes" << endl;
        return 0;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{ int h,w ;
    string s;
    cin>>h>>w;

   for(int i=0; i<h ; i++){
        cin>>s;
        for(int j=0;j<w;j++){
            cout<<s[j];


        }
         cout<<endl;
        for(int j=0;j<w;j++){
            cout<<s[j];}
          cout<<endl;
   }
    return 0;
}


Measured memory_bytes: 256
package main

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

func main() {
	s := readS()
	if strings.Contains(s, "A") && strings.Contains(s, "B") {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

/*-----------Input utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const buf = 200100
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, buf), buf)
}

func debug() {
	testFile, err := os.Open("./test/sample-1.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readR() []rune {
	return []rune(readS())
}

func readI() int {
	i, _ := strconv.Atoi(readS())
	return i
}

func readF() float64 {
	f, _ := strconv.ParseFloat(readS(), 64)
	return f
}


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


void solve(long long A, long long B){
    cout << (A<=8 && B<=8 ? "Yay!" : ":(") << endl;
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
#include <string.h>
using namespace std;

int main() {
	int N,A[2][100]={},k=0,sum=0,ans=0;
	cin>>N;
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<N;j++)
		{
			cin>>A[i][j];
		}
	}
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<N;j++)
		{
			if(j==i){
				sum+=A[k][j];
				k++;
				}
			sum+=A[k][j];
		}
		ans=max(sum,ans);
		sum=0;
		k=0;
	}
	cout<<ans;
	}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final String n = sc.next();
        sc.close();
        String result = "hon";
        int tmp = Integer.parseInt(n.split("")[n.length() - 1]);
        if (tmp == 3) {
            result = "bon";
        } else if (tmp == 0 || tmp == 1 || tmp == 6 || tmp == 8) {
            result = "pon";
        }

        System.out.println(result);
    }
}

Measured memory_bytes: 35676
//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int 
#define lu long unsigned int 
#define ff first
#define ss second 
#define S size()
#define inf 1e8
#define clr(a) memset(a, 0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}  
//----------------------------------------START------------------------------------------
llu nextPowerOf2(llu n)   
{ 
    n--; 
    n |= n >> 1; 
    n |= n >> 2; 
    n |= n >> 4; 
    n |= n >> 8; 
    n |= n >> 16; 
    n++; 
    return n; 
} 
int main()
{
	char c;
	cin>>c;
	cout<<char(c+1)<<'\n';
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);++i)
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; }
int gcd(int a,int b) { return b ? gcd(b,a%b) : a;}
int lcm(int a,int b) { return a/gcd(a,b)*b;}
void printb(unsigned int v) {
  unsigned int mask = (int)1 << (sizeof(v) * CHAR_BIT - 1);
  do putchar(mask & v ? '1' : '0');
  while (mask >>= 1);
}
void putb(unsigned int v) {putchar('0'), putchar('b'), printb(v), putchar('\n');}
#define ALL(W) (W).begin(),(W).end()

signed main(){
  int N;
  cin >> N;
  int a[N]={};
  rep(i,N) cin >> a[i];
  for(int i=N-1;i>=0;i-=2) cout << a[i] << " ";
  int g;
  if(N%2==1) g=1;
  else g=0;
  for(int i=g;i<N;i+=2){
    if(i==N-2 || i==N-1){
      cout << a[i] << endl;
      break;
    }
    cout << a[i] << " ";
  }
  return 0;
}


Measured memory_bytes: 3712
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class D
{
	public static void Main() => (new Solver()).Solve();
}


public class Solver
{
	public void Solve()
	{
		int N = GetInt();
		long[] A = GetLongs(N);

		long ans = A[0] - 1;
		long p = 2;
		for(int i = 1; i < N; i++)
		{
			if(A[i] < p)
				continue;
			
			if(A[i] == p)
			{
				p++;
			}
			else if(A[i] % p == 0)
			{
				ans += (A[i] / p) - 1;
			}
			else
			{
				ans += A[i] / p;
			}
		}

		Console.WriteLine(ans);
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(int N) => Enumerable.Range(0, N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(int N) => Enumerable.Range(0, N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(int N) => Enumerable.Range(0, N).Select(_ => GetDouble()).ToArray();
	public static string[] GetStrings(int N) => Enumerable.Range(0, N).Select(_ => GetString()).ToArray();
}


Measured memory_bytes: 17748
#include <bits/stdc++.h>
#define fast_io()                \
    ios::sync_with_stdio(false); \
    std::cin.tie(0);
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
    fast_io();
    int n;
    cin >> n;
    int nums[100]{}, all;
    for (int i = 1; i <= n; i++) {
        int head = i / pow(10, int(log10(i)));
        int tail = i % 10;
        ++nums[head * 10 + tail];
    }
    for (int i = 11; i <= 100; i++) {
        if (i % 10 == 0) {
            continue;
        } else if (i % 10 == i / 10) {
            all += nums[i] * nums[i];
        } else {
            int tmp = (i % 10) * 10 + i / 10;
            all += 2 * nums[i] * nums[tmp];
            nums[i] = 0;
        }
    }
    cout << all;

    return 0;
}


Measured memory_bytes: 512
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
res = 0
for i in range(n):
    a = list(map(int,input().split()))
    cnt = c
    for i, j in zip(a, b):
        cnt += i * j
    res += cnt > 0
print(res)


Measured memory_bytes: 38384
#include <cstdio>
#include <algorithm>

using namespace std;

int v[100];

int main()
{
    //freopen("file.in","r",stdin);
    //freopen("file.out","w",stdout);
    long long n;
    int l=0,s=0,s1=0;
    scanf("%lld",&n);
    while(n>0)
    {
        v[++l]=n%10;
        n/=10;
    }
    for(int i=1;i<=l;i++) s+=v[i];
    for(int i=1;i<l;i++) s1+=9;
    s=max(s,s1);
    s1=v[l]-1;
    s1+=9*(l-1);
    printf("%d",max(s,s1));
    return 0;
}


Measured memory_bytes: 256
//According to all known laws of aviation, there is no way that a bee should be able to fly.
//Its wings are too small to get its fat little body off the ground. The bee, of course, flies anyway.
//Because bees don't care what humans think is impossible.
#include <bits/stdc++.h>
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define mod 1000000007
using namespace std ;
using bigint = long long int ;
using vi = vector<int> ;
using vll = vector<long long int> ;

int main(){
    FAST_IO ;
    char ch ; cin >> ch ;
    if( ch >= 'a' && ch <= 'z' )
       cout << "a" << endl ;
    else
        cout << "A" << endl ;
return 0 ;
}


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

int main(){
  int n,m;
  cin>>n>>m;
  queue<int> rest;
  vector<queue<int>> que(n);
  for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    a--; b--;
    que[a].push(b);
    que[b].push(a);
  }
  vector<int> ans(n,-1);
  rest.push(0);
  while(!rest.empty()){
    int x = rest.front();
    rest.pop();
    while(!que[x].empty()){
      int y=que[x].front();
      que[x].pop();
      if(ans[y]!=-1) continue;
      rest.push(y);
      ans[y]=x+1;
    }
  }
  cout<<"Yes"<<endl;
  for(int i=1;i<n;i++){
    cout<<ans[i]<<endl;
  }
}

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

const int N = 2e5 + 10;
#define ll long long

struct edge {
	int to, nxt;
	ll v;
}e[N<<1];
int head[N], cnt, n;

void ins(int u, int v, ll w) {
	e[++cnt] = (edge) {v, head[u], w};
	head[u] = cnt;
}

int ans[N];

void dfs(int u, int fa) {
	for(int i = head[u]; i; i = e[i].nxt) {
		int v = e[i].to;
		if(v == fa) continue;
		if(e[i].v % 2) ans[v] = ans[u] ^ 1;
		else ans[v] = ans[u];
		dfs(v, u);
	}
}

int main() {
	scanf("%d", &n);
	for(int i = 1; i < n; ++i) {
		int u, v; ll w;
		scanf("%d%d%lld", &u, &v, &w);
		ins(u, v, w); ins(v, u, w);
	}
	dfs(1, 0);
	for(int i = 1; i <= n; ++i) printf("%d\n", ans[i]);
}

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

const int INF=123456789;

int dp[5][4][101];
int nx[5][4][101];
int b[50500];

inline void init()
{
    memset(b,-1,sizeof(b));
    rep(i,5)rep(j,4)rep(k,101) dp[i][j][k]=INF;
}

int main()
{
    int n;
    while(cin >>n,n)
    {
        init();

        map<int,int> num;
        vector<int> P(n), T(n);
        rep(i,n)
        {
            scanf(" %d %d", &P[i], &T[i]);
            b[T[i]]=P[i];
            num[T[i]]=i;
        }

        int ans=-1;
        bool fail=false;
        dp[1][0][0]=0;
        for(int t=1; t<50500; ++t)
        {
            rep(w,4)
            {
                if(b[t]==-1)
                {
                    bool ok=(t-(w+1)>=0);
                    if(ok)
                    {
                        for(int i=t; i>t-(w+1); --i) if(b[i]!=-1) ok=false;
                    }

                    if(ok) dp[0][0][0]=min(dp[0][0][0],dp[w+1][w][1]+1);

                    for(int pos=1; pos<=100; ++pos)
                    {
                        dp[0][w][pos]=min(dp[0][w][pos],dp[1][w][pos]);
                        if(ok)
                        {
                            dp[0][w][pos]=min(dp[0][w][pos],dp[w+1][w][pos-1]+1);
                            if(pos+1<=100) dp[0][w][pos]=min(dp[0][w][pos],dp[w+1][w][pos+1]+1);
                        }
                    }
                }
                else
                {
                    int b_idx=num[t];
                    int pos=b[t];
                    if(w<3)
                    {
                        dp[0][w+1][pos]=min(dp[0][w+1][pos],dp[1][w][pos]);

                        if( t-(w+1)>=0 && (b_idx==0 ||(b_idx>0 && t-(w+1)>=T[b_idx-1])) )
                        {
                            if(pos-1>=0) dp[0][w+1][pos]=min(dp[0][w+1][pos],dp[w+1][w][pos-1]+1);
                            if(pos+1<=100) dp[0][w+1][pos]=min(dp[0][w+1][pos],dp[w+1][w][pos+1]+1);
                        }
                    }
                }
            }

            if(b[t]!=-1)
            {
                // printf("  %d th balloon, (%d,%d)\n", num[t],P[num[t]],T[num[t]]);
                bool c=false;
                rep(j,4)
                {
                    // printf(" %d, %d\n",j,dp[0][j][b[t]] );
                    if(dp[0][j][b[t]]<INF) c=true;
                }
                if(!c)
                {
                    fail=true;
                    ans=num[t]+1;
                    break;
                }
            }

            for(int i=4; i>0; --i)rep(j,4)rep(k,101) dp[i][j][k]=dp[i-1][j][k];
            rep(i,4)rep(j,101) dp[0][i][j]=INF;
        }

        if(fail) printf("NG %d\n", ans);
        else printf("OK %d\n", dp[1][0][0]);
    }
    return 0;
}

Measured memory_bytes: 3276
<?php
$a = explode(' ', fgets(STDIN));
$m = (int)$a[0];
$n = (int)$a[1];

echo lcm($m, $n);

  function lcm($m, $n){
    return $m * $n / gcd($m, $n);
}

function gcd($m, $n){
    if($n > $m) list($m, $n) = array($n, $m);
     
    while($n !== 0){
        $tmp_n = $n;
        $n = $m % $n;
        $m = $tmp_n;
    }
    return $m;
}

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

using namespace std;

int cnt, mn = 10000000, mx;
string s;

int main() {
    cin >> s;
    for(int i = 0; i < s.size(); i++) {
        if(s[i] == 'A') {
            if(i < mn) {
                mn = i;
            }
        }
        if(s[i] == 'Z') {
            if(i > mx) {
                mx = i;
            }
        }
    }
    cout << mx - mn + 1;
    return 0;
}

Measured memory_bytes: 640
txt=input()
N=len(txt)
see=0
count=1
##最初に切るところと文字数
##最初は1文字切る
now=1
while(see<N-1):
##2文字切ったなら次は1文字切る
  if(now==2):
    now=1
 ##1文字切っていて、次の文字が一致なら2文字切る
  elif(txt[see+1]==txt[see]):
    now=2
 ##1文字切っていて、次の文字が一致しないなら1文字切る
  else:
    now=1
  count=count+1
  see=see+now
if (now==2):
  if(see==N and txt[-1]==txt[-2]):
    count=count-1
print(count)

Measured memory_bytes: 40432
#include<stdio.h>
int main(){
	int n,a,b,pc,kc[100],i,j,temp,max=0,cnt=0,u;
	scanf("%d",&n);
	scanf("%d %d",&a,&b);
	scanf("%d",&pc);
	for(i=0;i<n;i++){
		scanf("%d",&kc[i]);
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			if(kc[i]<kc[j]){
				temp=kc[i];
				kc[i]=kc[j];
				kc[j]=temp;
			}
		}
	}
	for(i=0;i<n;i++){
		cnt+=kc[i];
		u=(pc+cnt)/(a+b*(i+1));
		if(max<u){
			max=u;
		}
	}
	printf("%d\n",max);
	return 0;
}

Measured memory_bytes: 596
#include<cstdio>
#define M 200002
#define N 100001
inline int max(int x,int y){return x<y?y:x;}
int a[N],b[M],c[M],f[N],g[N],h[N],l,n,q[N],r,t,x,y;char d[N];bool e[N];
int i,u,v;
int main()
{
	for(scanf("%d",&n),i=q[l=1]=1;i<n;i++)scanf("%d%d",&u,&v),b[++t]=a[u],c[a[u]=t]=v,b[++t]=a[v],c[a[v]=t]=u;
	for(scanf("%s",d+1),r=2,t=n;l<r;)for(i=a[u=q[l++]];i;i=b[i])if(c[i]!=f[u])g[f[q[r++]=c[i]]=u]++;
	for(i=n;i;i--)if(!g[q[i]]&&d[q[i]]=='B')g[f[q[i]]]--,e[q[i]]=true;
	for(*e=true,i=1;i<=n;i++)if(e[f[q[i]]]&&g[q[i]]==1&&d[q[i]]=='B')e[q[i]]=true;
	for(i=1,t=0;i<=n;i++)if(!e[q[i]])q[++t]=q[i];
	if(!t)return 0*puts("0");
	else if(t==1)return 0*puts("1");
	for(g[q[1]]--,i=1;i<=t;g[q[i]]=d[q[i]]=='W'?y++,g[q[i]]?2:1:0,i++)if(~g[q[i]]&1)d[q[i]]=d[q[i]]=='B'?'W':'B';
	for(i=t;i>1;i--)h[q[i]]+=g[q[i]],x=max(x,h[f[q[i]]]+h[q[i]]+g[f[q[i]]]),h[f[q[i]]]=max(h[f[q[i]]],h[q[i]]);
	return 0*printf("%d\n",(t-1<<1)+y-(x+1&~1));
}

Measured memory_bytes: 3840
package main

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

var (
	sc = bufio.NewReader(os.Stdin)
)

// 17:10
func main() {
	N, K := scanInt(), scanInt()
	P := make([]int, N)
	C := make([]int, N)
	for i := 0; i < N; i++ {
		P[i] = scanInt()
	}
	for i := 0; i < N; i++ {
		C[i] = scanInt()
	}

	ans := -1000000001
	for i := 0; i < N; i++ {
		v := i
		cycleSum := 0
		cycleCnt := 0

		for {
			cycleCnt++
			cycleSum += C[v]
			v = P[v] - 1
			if v == i {
				break
			}
		}

		path := 0
		cnt := 0

		for {
			cnt++
			path += C[v]

			if cnt > K {
				break
			}

			num := (K - cnt) / cycleCnt
			score := path + max(0, cycleSum)*num
			if ans < score {
				ans = score
			}

			v = P[v] - 1
			if v == i {
				break
			}
		}
	}
	fmt.Println(ans)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func abs(a int) int         { return int(math.Abs(float64(a))) }
func scan(a ...interface{}) { _, err := fmt.Fscan(sc, a...); pnc(err) }
func scanStr() (s string)   { scan(&s); return }
func scanInt() int          { i, err := strconv.Atoi(scanStr()); pnc(err); return i }
func scanFloat() float64    { f, err := strconv.ParseFloat(scanStr(), 64); pnc(err); return f }
func pnc(err error) {
	if err != nil {
		panic(err)
	}
}


Measured memory_bytes: 2212
#include <bits/stdc++.h>
#define inf 2000000000
using namespace std;

int n, m;
int c[20] = {0};
int x[20005] = {0};
// dp[i][j][k] x[i], use c[j] minans
int dp[20005][300] = {0};

int solve();

int main() {
  int i, j, k;
  while(1) {
    cin >> n >> m;
    if(n + m == 0) break;
    for(i = 0; i < m; ++i) cin >> c[i];
    for(i = 0; i < n; ++i) cin >> x[i];
    for(i = 0; i < 300; ++i)
      for(j = 0; j < n; ++j) dp[j][i] = inf;
    cout << solve() << endl;
  }
  return 0;
}

int solve() {
  int i, j, k, now, ans = inf, bf;
  for(i = 0; i < n; ++i) {
    for(j = 1; j < 255; ++j)
      for(k = 0; k < m; ++k) {
        now = j - c[k];
        if(now < 0 || now > 255 ||
           (i != 0 && dp[i - 1][now] == inf) ||
           (i == 0 && now != 128))
          continue;
        if(i == 0)
          bf = 0;
        else
          bf = dp[i - 1][now];
        dp[i][j] =
            min(dp[i][j], bf + (j - x[i]) * (j - x[i]));
        if(i == n - 1) ans = min(ans, dp[i][j]);
      }
    for(k = 0; k < m; ++k)
      for(j = 0; j < 256; ++j) {
        now = j + c[k];
        if(now <= 0) {
          if(i == 0 && j != 128) continue;
          if(i == 0)
            bf = 0;
          else
            bf = dp[i - 1][j];
          dp[i][0] = min(dp[i][0], bf + x[i] * x[i]);
          if(i == n - 1) ans = min(dp[i][0], ans);
        }
        else if(now >= 255) {
          if(i == 0 && j != 128) continue;
          if(i == 0)
            bf = 0;
          else
            bf = dp[i - 1][j];
          dp[i][255] = min(
              dp[i][255], bf + (255 - x[i]) * (255 - x[i]));
          if(i == n - 1) ans = min(ans, dp[i][255]);
        }
      }
  }

  return ans;
}


Measured memory_bytes: 26604
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int h, n, sum = 0; cin>>h>>n;
    int a[n];
    for(int i = 0; i < n; i++) cin>>a[i], sum += a[i];
    if(sum >= h) cout<<"Yes"<<'\n';
    else cout<<"No\n";
    return 0;
}

Measured memory_bytes: 640
H,W,N = map(int, input().split())
sr, sc = map(int, input().split())
S = input()
T = input()

l = 1
r = W
d = H
u = 1
ans = "YES"
for i in range(N-1, -1, -1):
    if T[i] == "L":
        r = min(W, r+1)
    elif T[i] == "R":
        l = max(1, l-1)
    elif T[i] == "D":
        u = max(1, u-1)
    else:
        d = min(H, d+1)
    if S[i] == "L":
        l += 1
    elif S[i] == "R":
        r -= 1
    elif S[i] == "D":
        d -= 1
    else:
        u += 1
    if l > r or u > d:
        ans = "NO"
        break
        
if sr < u or d < sr or sc < l or r < sc:
    ans = "NO"
    
print(ans)

Measured memory_bytes: 48332
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
const ll MOD = 1000000007;

int main() {
    int n;
    cin >> n;
    vector<double> v(n);
    REP(i, n)
        cin >> v[i];
    sort(ALL(v));
    REP(i, n-1)
        v[i+1] = (v[i] + v[i+1])/2;
    cout << v[n-1] << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 9003372036854775807LL
#define mod 1000000007
#define fixed fixed<<setprecision(12)
#define abs(x,y) (max(x,y)-min(x,y))
#define lol long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
using pii=pair<int, int > ;
lol a[300010];
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  lol n,m,k,r,x,y,z;
  cin >>s;
  lol ans=0;
  lol sum=0;
  for(int i=0;i<s.size();i++){
    if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') sum++,ans=max(ans,sum);
    else sum=0;
  }
  cout <<ans<<'\n';
  return (0);
}


Measured memory_bytes: 256
//辞書
using System;
using System.Collections.Generic;
using System.Text;

namespace tst
{
    class Program
    {
        public static void Main()
        {
            //命令数
            int n = int.Parse(Console.ReadLine());
            //辞書
            HashSet<string> D = new HashSet<string>();//for add  contains
            //結果保存用の配列
            StringBuilder ans = new StringBuilder(); //for appendline
            //命令の読み込み
            for (int i = 0; i < n; i++)
            {
                string text = Console.ReadLine();
                string[] C = text.Split(' ');
                //コマンドを読み取る
                switch (C[0])
                {
                    case "insert":
                        D.Add(C[1]);
                        break;
                    case "find":
                        if (D.Contains(C[1]))
                        {
                            //true
                            ans.AppendLine("yes");
                        }
                        else 
                        {
                            //false
                            ans.AppendLine("no");
                        };
                        break;
                }
            }
            Console.Write(ans);

        }

    }
}


Measured memory_bytes: 51720
#include <iostream>
#include <cmath>
#include <bits/stdc++.h>

using namespace std;

int main() {

    int n;
    cin >> n;
    long long arr[n];
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    long long ans[n];
    ans[0] = 0;
    ans[1] = abs(arr[0] - arr[1]);
    for (int i = 2; i < n; i++) {
        ans[i] = min((ans[i - 2] + abs(arr[i] - arr[i - 2])), (ans[i - 1] + abs(arr[i] - arr[i - 1])));
    }
    cout << ans[n - 1];

    return 0;
}


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

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }
template <typename T = string> inline void eputs(T s) {
    cout << s << "\n";
    exit(0);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}

typedef long long ll;
typedef unsigned long long ul;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, VL, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18 + 1;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

ll N;
vector<VL> G;
VL d;
vector<bool> used;

void dfs(ll now, ll dist) {
    d[now] = dist;
    FOREACH(to, G[now]) {
        if(!used[to]) {
            used[to] = true;
            dfs(to, dist + 1);
            used[to] = false;
        }
    }
}
signed main() {
    cin >> N;
    G.resize(N);
    d.resize(N);
    REP(i, N - 1) {
        LCIN(a, b);
        G[--a].emplace_back(--b);
        G[b].emplace_back(a);
    }
    ll root = 0;
    REP(loop, 2) {
        used.assign(N, false);
        used[root] = true;
        dfs(root, 0);
        root = max_element(All(d)) - d.begin();
    }
    ll dia = d[root];
    cout << (dia % 3 == 1 ? "Second" : "First") << "\n";
}

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

int main(){
  map<int,int> mymap;
  int n, q, x, sum=0;
  cin >> n;
  while(n--){
    cin >> x;
    mymap[x] = 1;
  }

  cin >> q;
  while(q--){
    cin >> x;
    if(mymap.find(x) != mymap.end())
      sum++;
  }

  cout << sum << endl;
  return 0;
}

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

int main() {
	
	int a, b, c;
	cin >> a >> b >> c;

	int cnt = 0;

	for (int i = a; i <= b; i++) {
		if (c % i == 0) {
			cnt++;
		}
	}

	cout << cnt << endl;

	return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vl;
typedef vector< vl > vvl;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< string > vs;
typedef vector< double > vd;
typedef vector< vd > vvd;

template< class T1, class T2 >
int upmin( T1 &x, T2 v ){
  if( x > v ){
    x = v;
    return 1;
  }
  return 0;
}

template< class T1, class T2 >
int upmax( T1 &x, T2 v ){
  if( x < v ){
    x = v;
    return 1;
  }
  return 0;
}

const int INF = 0x3f3f3f3f;

const string msg[] = { "First", "Second" };
string S;

void solve(){
  cin >> S;
  cout << msg[ ( S.size() % 2 == 0 ) ^ ( S.front() == S.back() ) ] << endl;
}

signed main(){
  ios::sync_with_stdio( 0 );
  // init();
  // preprocess();
  solve();
  return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define ai64(v) (v).begin(), (v).end()
#define eb emplace_back

struct mint{
    using i64 = int_fast64_t;
    i64 x;
    const i64 MOD = 1000000007;

    mint(const i64 y = (i64)0) noexcept : x(y) { if(x >= MOD) x %= MOD; }
    mint operator+() const noexcept {return x;}
    mint operator-() const noexcept {return -x;}

    mint operator+(const mint y) const noexcept {return (mint)*this += y; }
    mint operator-(const mint y) const noexcept {return (mint)*this -= y; }
    mint operator*(const mint y) const noexcept {return (mint)*this *= y;}
    mint operator/(const mint y) const noexcept {return (mint)*this /= y;}
    mint& operator=(const int y) noexcept {
        x = y;
        return *this; 
    }

    mint& operator+=(const mint y) noexcept {
        x += y.x; 
        if(x >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint y) noexcept {
        x -= y.x;
        if(x < 0) x += MOD;
        return *this;
    }
    mint& operator*=(const mint y) noexcept {
        x *= y.x;
        if(x >= MOD) x %= MOD;
        return *this;
    }
    mint& operator/=(mint y) noexcept {
        i64 exp = MOD - 2;
        while(exp){
            if(exp & 1) *this *= y;
            y *= y;
            exp /= 2;
        }
        return *this;
    }
    friend std::ostream& operator<< (std::ostream& os, const mint& m);
    friend std::istream& operator>> (std::istream& in, mint& m);
};
std::ostream& operator<<(std::ostream& os, const mint& m){
    os << m.x;
    return os;
}
std::istream& operator>> (std::istream& in, mint& m){
    in >> m.x; 
    if(m.x < 0) m.x += 1000000007;
    if(m.x >= 1000000007) m.x %= 1000000007;
    return in; 
}

mint POW(mint x, i64 n){
    mint res = 1;
    while(n){
        if(n&1) res *= x; 
        x *= x;
        n >>= 1;
    }
    return res;
}

int main(){
    i64 N, A, B;
    cin >> N >> A >> B;
    mint sum(POW(mint(2), N) - 1);
    auto comb = [](i64 n, i64 k) -> mint {
        mint res = 1;
        for(int i = 0; i < k; i++) {
            res *= mint(n-i) / mint(k-i);
        }
        return res;
    };
    cout << sum - comb(N, A) - comb(N, B) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>


using namespace std;
typedef long long ll;
typedef long double ld;
const int MX=5e5+9;
const long double eps=-0.00000001;
const ll mod = 1e9+7;


ll po ( ll a, ll b )
{
    if ( b==0 ) { return 1; }
    ll x = po ( a , b/2 )%mod;
    x *= x;
    if ( b%2 ) { return x*a; }
    return x;
}

int get ( string x )
{
    int c=0;
    for ( int i=0  ;i<x.size() ; i++ )
    {
        c = c*10 + x[i]-'0';
    }
    return c;
}


int main()
{
    ll a,b,c;
    cin>>a>>b>>c;

    if ( a%2==0 || b%2==0 || c%2==0 ) { cout<<0; return 0; }

    ll ans = min ( 1ll*a*b , min ( 1ll*a*c , 1ll*b*c ) );

    cout<<ans;






    return 0;
}


Measured memory_bytes: 256
from heapq import heappush, heappop
from operator import itemgetter
N, K = map(int, input().split())
a = []
aa = []
for i in range(N):
    ta,tb = map(int, input().split())
    a.append([i,ta,tb])
    aa.append(tb)
a = sorted(a, key=itemgetter(2), reverse=True)
aa.append(0)
aa.sort()
b = max(a, key=itemgetter(1))[1]
n = K//b+1
res = 0

while K>0:
    t = aa.pop()
    if t > b:
        K -= t
        res+=1
    else:
        res +=-(-K//b)
        K = 0
        break
print(res)

Measured memory_bytes: 25936
package main

import "fmt"

func main() {
	var N, i, sum int
  	fmt.Scan(&N)
  	b := make([]int, N-1)
  	for i = range b {
		fmt.Scan(&b[i])
	}

	a:= make([]int, N)
	a[0] = b[0]
	a[N-1] = b[N-2]
	for i = 0; i < N-2; i++ {
		if b[i] < b[i+1] {
			a[i+1] = b[i]
		} else {
			a[i+1] = b[i+1]
		}
	}

	for k := 0; k < N; k++ {
		sum += a[k]
	}
	fmt.Println(sum)
}


Measured memory_bytes: 512
using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = l[0], M = l[1];

            var A = new Queue<string>();
            var B = new string[M];

            for (var i = 0; i < N; i++) A.Enqueue(Console.ReadLine());
            for (var i = 0; i < M; i++) B[i] = Console.ReadLine();
            
            var count = 0;
            for (var i = 0; i < M; i++)
            {
                if (A.Peek().IndexOf(B[i]) >= 0)
                {
                    count++;
                    A.Dequeue();
                }
                else
                    count = 0;

                if (count == M)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            Console.WriteLine("No");
        }
    }
}


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

using namespace std;

typedef long long ll;
#define int ll
typedef long double ld;

typedef pair<int,int> pii;
#define x first
#define y second

const int D=365,A=26,K=4;

int d;
int c[A],s[D][A],last[A];

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin>>d;
    for(int j=0;j<A;j++)
        cin>>c[j],
        last[j]=-1;
    for(int i=0;i<d;i++)
        for(int j=0;j<A;j++)
            cin>>s[i][j];
    for(int i=0;i<d;i++)
    {
        int best=0;
        for(int j=0;j<A;j++)
            if(s[i][j]+c[j]*(i-last[j])*min(K,d-i)>
               s[i][best]+c[best]*(i-last[best])*min(K,d-i))
                best=j;
        last[best]=i;
        cout<<best+1<<"\n";
    }
}


Measured memory_bytes: 3728
N,M = map(int,input().split())

ans = 0

lis = [ [] for i in range(N) ]

for i in range(M):

    tmp = list(map(int,input().split()))
    tmp = tmp[1:]

    for j in tmp:
        lis[j-1].append(i)

p = list(map(int,input().split()))

for i in range(2**N):

    now = [0] * M

    for j in range(N):
        if i & (2**j) > 0:
            for k in lis[j]:
                now[k] += 1

    flag = True
    for i in range(M):
        if now[i] % 2 != p[i]:
            flag = False
            break
    if flag:
        ans += 1

print (ans)
            


Measured memory_bytes: 41328
N = int(raw_input())
A = map(int, raw_input().split())
ans = []
sum_all = sum(A) / 2

ic = sum_all
for i in range(1, N, 2):
    ic -= A[i]
ans.append(ic*2)

for i in range(0, N-1):
    ans.append((A[i] - ans[i]/2)*2)

print(' '.join(map(str, ans)))


Measured memory_bytes: 18124
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N = I()
    A=LI()
    *cumsum, = accumulate(A)
    l = 0
    r = 1
    ans = inf
    def calc_abs_left(mid,l):
        a,b = cumsum[l], cumsum[mid]-cumsum[l]
        return abs(a-b)
    def calc_abs_right(mid,r):
        a,b = cumsum[r]-cumsum[mid], cumsum[-1]-cumsum[r]
        return abs(a-b)
    for mid in range(1,N-1):
        while calc_abs_left(mid, l) > calc_abs_left(mid, l+1) and l<mid:
            l += 1
        while calc_abs_right(mid, r) > calc_abs_right(mid, r+1) and r<N-1:
            r += 1
        B = [cumsum[l], cumsum[mid]-cumsum[l], cumsum[r]-cumsum[mid], cumsum[-1]-cumsum[r]]
        ans = min(ans, max(B)-min(B))
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 116980