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

struct edge{
  int to;
  int64_t len;
};

int main(){
  int N;
  cin >> N;
  vector< vector<edge> > V(N+1);
  for(int i=0;i<N-1;i++){
    int u,v;
    int64_t w;
    cin >> u >> v >> w;
    V.at(u).push_back({v,w});
    V.at(v).push_back({u,w});
  }
  vector<int64_t> dist(N+1,-1);
  stack<int> st;
  st.push(1);
  dist.at(1)=0;
  while(!st.empty()){
    int a=st.top();
    st.pop();
    for(auto & e:V.at(a)){
      int b=e.to;
      if(dist.at(b)==-1){
        dist.at(b)=dist.at(a)+e.len;
        st.push(b);
      }
    }
  }
  for(int i=1;i<=N;i++){
    if(dist.at(i)%2==0){
      cout << 0 << endl;
    }else{
      cout << 1 << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 8704
n=io.read("n")
k=io.read("n")
h={}
for i=1,n do 
  h[i]=io.read("n")
end
table.sort(h)
t={}
for i=1,n-k+1 do
  t[i]=h[k]-h[i]
  k=k+1
end
table.sort(t)
print(t[1])
  


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

namespace ConsoleApp11
{
    class Class42
    {
        static void Main()
        {
            int H = int.Parse(Console.ReadLine());
            int W = int.Parse(Console.ReadLine());
            int N = int.Parse(Console.ReadLine());
            int B = Math.Max(H, W);
            int R = 0;
            int count = 0;
            for(int i=0; ; i++)
            {
                if (R < N)
                {
                    R += B;
                    count++;
                }
                else
                {
                    break;
                }
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
using namespace std;

signed main(){
    string s;
    int w;
    cin>>s>>w;
    for(int i=0;i<s.size();i+=w)cout<<s[i];
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
// package jp.atcoder.library.kotlin.dsu

import java.util.*

/**
 * Disjoint set union.
 */
class DSU(private val n: Int) {
    private val parentOrSize = IntArray(n)

    /**
     * Merge nodes.
     */
    fun merge(a: Int, b: Int): Int {
        if (a !in 0 until n) throw IndexOutOfBoundsException("a=$a")
        if (b !in 0 until n) throw IndexOutOfBoundsException("b=$b")
        var x = leader(a)
        var y = leader(b)
        if (x == y) return x
        if (-parentOrSize[x] < -parentOrSize[y]) {
            val tmp = x
            x = y
            y = tmp
        }
        parentOrSize[x] += parentOrSize[y]
        parentOrSize[y] = x
        return x
    }

    /**
     * True if two nodes are connected.
     */
    fun same(a: Int, b: Int): Boolean {
        if (a !in 0 until n) throw IndexOutOfBoundsException("a=$a")
        if (b !in 0 until n) throw IndexOutOfBoundsException("b=$b")
        return leader(a) == leader(b)
    }

    /**
     * Get its leader node.
     */
    fun leader(a: Int): Int {
        return if (parentOrSize[a] < 0) {
            a
        } else {
            parentOrSize[a] = leader(parentOrSize[a])
            parentOrSize[a]
        }
    }

    /**
     * A group's size.
     */
    fun size(a: Int): Int {
        if (a !in 0 until n) throw IndexOutOfBoundsException("" + a)
        return -parentOrSize[leader(a)]
    }

    /**
     * Group by leader.
     */
    fun groups(): ArrayList<ArrayList<Int>> {
        val leaderBuf = IntArray(n)
        val groupSize = IntArray(n)
        for (i in 0 until n) {
            leaderBuf[i] = leader(i)
            groupSize[leaderBuf[i]]++
        }
        val result = ArrayList<ArrayList<Int>>(n)
        for (i in 0 until n) {
            result.add(ArrayList(groupSize[i]))
        }
        for (i in 0 until n) {
            result[leaderBuf[i]].add(i)
        }
        result.removeIf { obj: ArrayList<Int> -> obj.isEmpty() }
        return result
    }

    init {
        Arrays.fill(parentOrSize, -1)
    }
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main(args: Array<String>) {
    val (n, q) = readInts()
    val uf = DSU(n)

    repeat(q) {
        val (t, u, v) = readInts()
        if (t == 0)
            uf.merge(u, v)
        else
            println(if (uf.same(u, v)) 1 else 0)
    }
}

Measured memory_bytes: 60508
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
namespace ABC82_C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(ReadLine());
            var a = ReadLine().Split().Select(long.Parse).ToArray();
            Array.Sort(a);
            var d = new Dictionary<long, long>();
            d[a[0]] = 1;
            for (int i = 1; i < n; i++)
            {
                if (!d.ContainsKey(a[i])) d[a[i]] = 1;

                if (a[i] == a[i - 1])
                {
                    d[a[i]] += 1;
                }
            }
            long count = 0;
            foreach (var item in d)
            {
                if (item.Key > item.Value)
                {
                    count += item.Value;
                }
                else
                {
                    count += Math.Abs(item.Key - item.Value);
                }
            }
            WriteLine(count);
        }
    }
}


Measured memory_bytes: 30560
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tl3;



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
//const ll MOD = 1e9 + 7;
const ll MOD = 998244353;
int h, w;


int main() {
	
	int h, w, m;
	cin >> h >> w >> m;
	
	vector<pii> sh(h);
	vector<pii> sw(w);


	vector<set<int>> b(h);
	for (int i = 0; i < m; i++) {
		int h0, w0;
		cin >> h0 >> w0;
		h0--;
		w0--;
		sh[h0].first++;
		sw[w0].first++;

		b[h0].insert(w0);

	}

	for (int i = 0; i < h; i++) {
		sh[i].second = i;
	}

	for (int i = 0; i < w; i++) {
		sw[i].second = i;
	}

	sort(sh.begin(), sh.end());
	sort(sw.begin(), sw.end());
	
	vector<int> vh;
	vector<int> vw;
	for (pii shi : sh) {
		if (shi.first == sh[h - 1].first) {
			vh.emplace_back(shi.second);
		}
	}

	for (pii swi : sw) {
		if (swi.first == sw[w - 1].first) {
			vw.emplace_back(swi.second);
		}
	}

	for (int vhi : vh) {
		for (int vwi : vw) {
			if (b[vhi].find(vwi) == b[vhi].end()) {
				cout << sh[h - 1].first + sw[w - 1].first << endl;

				
				return 0;
			}
		}
	}

	cout << sh[h - 1].first + sw[w - 1].first -1 << endl;
	return 0;
}


Measured memory_bytes: 40072
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

fn main() {
    input! {
        n: usize,
        k: usize,
        mut s: chars,
    }

    s[k-1] = (s[k-1] as u8 + ('a' as u8 - 'A' as u8)) as char;
    println!("{}", s.into_iter().collect::<String>());
}


Measured memory_bytes: 4352
#import <stdio.h>
int main() {
	int a,x;
	scanf("%d %d",&a,&x);
	int L = x-a+1;
	int R = x+a-1;
	for(int i=L;i<=R;i++){
		printf("%d",i);
		if(i<R) printf(" ");		
	}
	puts("");
}

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

int main()
{
	string A, B;
	cin >> A >> B;

	for (int i = 0; i < A.size(); i++)
	{
		cout << A[i];
		if (i < B.size())
		{
			cout << B[i];
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  int A, B, C;

  cin >> A;
  cin >> B;
  cin >> C;

  int day = 0;

  int sum = 0;

  while(1) {
    day++;
    sum += A;
    if (day % 7 == 0) {
      sum += B;
    } 

    if (sum >= C) {
      cout << day << endl;
      break;
    }
  }

  return 0;
}



Measured memory_bytes: 3104
/* AUTHOR :  SHIVANK JAIN */

#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false)
#define itt cin.tie(0)
#define now cout.tie(0)

using namespace std;

#define ll long long
#define li long int

#define pb push_back
#define rep(i,a,n) for(int i=a;i<n;i++)
#define reprev(i,n,a) for(int i=n;i>=a;i--)
#define endl "\n"

#define vi vector<int>
#define vll vector<ll>
#define vpi vector< pair<int , int> >
#define mapi map<int , int>
#define mapll map<ll ,ll >
#define seti set<int> 

#define fr first
#define se second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mp make_pair
#define sort(v) sort(v.begin() , v.end())

#define BIG 1000000007
int gcd(int a, int b) 
{ // builtin function __gcd(a,b)
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
int main(){

     fast;itt;now;
 
//    #ifndef ONLINE_JUDGE
//    // for getting input from input.txt
//    freopen("input.txt", "r", stdin);
//    // for writing output to output.txt
//     freopen("output.txt", "w", stdout);
//    #endif
    
     int n ;   cin>>n;
     set<string> s;
     rep(i,0,n){
     	string ss;
     	cin>>ss;
     	s.insert(ss);
	 }
	 cout<<s.size()<<endl;
}

Measured memory_bytes: 19200
import java.util.*;

import java.lang.*;

import java.math.*;



public class Main {

	Scanner sc = new Scanner(System.in);

	int[] mon = {

		0,31,28,31,30,31,30,31,31,30,31,30,31	

	};

	class date{

		int y;

		int m;

		int d;

		date(int q,int w,int e){

			y = q;

			m = w;

			d = e;

		}

		long serialValue(){

			long ret = 0;

			y -= 1;

			ret += y*365;

			ret += y/4;

			ret -= y/100;

			ret += y/400;

			for(int i = 0; i < m;i++){

				ret += mon[i];

			}

			y += 1;

			if(y%400 == 0 ||(y%100!=0&&y%4==0) ){

				if(m > 2){

					ret += 1;

				}

			}

			ret += d;

			return ret;

		}

	}

	void run(){

		for(;;){

			int [] in = new int[6];

			int flag = 0;

			for(int i= 0; i < 6;i++){

				in[i] = sc.nextInt();

				flag |= in[i];

			}

			if(flag < 0){

				break;

			}

			date a = new date(in[0],in[1],in[2]);

			date b = new date(in[3],in[4],in[5]);

			System.out.println(b.serialValue() - a.serialValue());

		}

	}

	public static void main(String[] args){

		Main m = new Main();

		m.run();

	}

}

Measured memory_bytes: 12000
import java.util.Scanner;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int sosu = 0;
        for(int i = 0; i < n; i++){
            int x = sc.nextInt();
        	sosu += sagyo(x);
        }
        System.out.println(sosu);
    }
	
	private static int sagyo(int x){
		int ruutox = (int)Math.sqrt(x);
		for(int i = 2; i <= ruutox; i++){
			int yakusu = 0;
			int x1 = x % i;
			if(x1 == 0){
				return 0;
			}
		}
		return 1;
	}
}


Measured memory_bytes: 41248
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    ($arg:expr) => (println!("{:?}",$arg));
}


#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}


use std::cmp;
use std::collections::HashMap;





fn main() {

    input! { 
       n: usize,
       a: [i64;n],
    }

    let mut ans = 0;

    let mut cache  = std::collections::HashMap::new();



    for i in 0..n{
        if(cache.contains_key(&a[i])){
            let p = cache.get(&a[i]).unwrap()+1;
            cache.insert(a[i], p);
        }
        else{
            cache.insert(a[i], 0);
        }

    }



    let mut tmp = vec![];
    for (k,v) in &cache{
        if(*v != 0){
            tmp.push(*v);
        }
        else{
            ans +=1;
        }
    }


    let sum = tmp.iter().fold(0,|x,y|{x+y});


    ans += if sum % 2 == 0 { tmp.len()  } else {tmp.len()-1};
    //ans = if sum % 2 == 0 { cache.len()  } else {cache.len()-1};
    
    
    //et mut ans2 = if cache.len()  % 2 ==0 {cache.len()-1} else {cache.len()};






    
    //println!("{} {}",ans,ans2);
    println!("{}",ans);


}


Measured memory_bytes: 14588
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a[3];
    while(~scanf("%d%d%d",&a[0],&a[1],&a[2]))
    {
        sort(a,a+3);
        printf("%d\n",a[0]+a[1]);
    }
    return 0;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
use std::collections::HashMap;
use std::collections::BTreeSet;
use std::collections::HashSet;
use std::cmp;
use std::f64::consts;

fn main() {
    let n: i32 = read();
    let vec: Vec<i32> = (0..n).map(|_| read()).collect();
    let mut count = 0;
    for &i in vec.iter() {
        let mut num = i;
        if num % 2 == 0 {
            while num % 2 == 0{
                num /= 2;
                count+=1;
            }
        }
    }
    println!("{}", count);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// 最大公約数
fn gcd(a: i32, b: i32) -> i32 {
    match b {
        0 => a,
        _ => gcd(b, a % b)
    }
}

// 最小公倍数
fn lcm(a: i32, b: i32) -> i32 {
    a * b / gcd(a, b)
}

// 階乗
fn kaijou(n: i32)->i32 {
    if n == 1 {
        return n;
    }
    return n * kaijou(n-1);
}

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

int main()
{
 int n;
  cin >> n;
  int arr[100010] = {};
  for (int i = 1;i <= n;i++)
  {
   int tmp;
    cin >> tmp;
    arr[tmp-1] = i;
  }
  
	for (int i = 0;i < n;i++)
      cout << arr[i] << " ";
  cout << endl;
}

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

#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex <ld> cd;
typedef vector <cd> vcd;
typedef vector <int> vi;

template<class T> using v2d = vector <vector <T> >;
template<class T> bool uin(T &a, T b)
{
    return a > b ? (a = b, true) : false;
}
template<class T> bool uax(T &a, T b)
{
    return a < b ? (a = b, true) : false;
}

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

const int maxN = 2e5 + 10;

int n, m, d[maxN];
vector <int> adj[maxN];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> m;
    while (m--)
    {
        int u, v;
        cin >> u >> v;
        adj[u].eb(v);
        adj[v].eb(u);
    }
    queue <int> q;
    q.push(1);
    fill(d + 1, d + n + 1, 1e9);
    d[1] = 0;
    while (!q.empty())
    {
        int u = q.front();
        q.pop();
        for (auto &v: adj[u])
        {
            if (d[v] > d[u] + 1)
            {
                d[v] = d[u] + 1;
                q.push(v);
            }
        }
    }
    cout << (d[n] <= 2 ? "POSSIBLE" : "IMPOSSIBLE");
    return 0;
}


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


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, A[3];
    cin >> N >> A[0] >> A[1] >> A[2];
    int l[8];
    rep(i, N) cin >> l[i];
    int ans = INF;
    int pattern = (1 << (N * 2));
    rep(k, pattern) {
        int cnt[3] = {};
        int bit = k;
        int sum[3] = {};
        rep(i, N) {
            int c = bit % 4;
            bit /= 4;
            if(c == 3) continue;
            cnt[c]++;
            sum[c] += l[i];
            
        }
        bool ok = true;
        int tmp = 0;
        rep(i, 3) {
            if(cnt[i] == 0) ok = false;
            tmp += (cnt[i] - 1) * 10;
            tmp += abs(A[i] - sum[i]);
        }
        if(!ok) continue;
        ans = min(ans, tmp);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3592
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int count=0;
		int genzai =1;
		for(int i=0;i<n;i++) {
			genzai=Math.min(genzai*2, genzai+k);
		}
		System.out.println(genzai);
	}
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
string s,t;
ll a[200500], b[200500], pa[200500], pbb[200500];

int main() {
    int n,m,x,i;
	cin >> n >> m >> x;
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
		pa[i+1] = pa[i] + a[i];
	}
	for (i = 0; i < m; i++)
	{
		cin >> b[i];
		pbb[i+1] = pbb[i] + b[i];
	}
	int ans = 0;
	for (i = 0; i <= n; i++)
	{
		if (pa[i] <= x)
		   ans = max(ans, i+(int)(upper_bound(pbb, pbb+m+1, x-pa[i])-pbb-1));
		else
			break;
	}
	cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9936
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
#include<iostream>
#include<cstdlib>
using namespace std;
const int maxn=1007;

double n,x,y,t,a[maxn];
char s[maxn];
int main(){
	cin>>n;
	cin>>x>>y;
	double k=y-x;
	int ans;
//	cout<<k<<endl;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(i==1){
			
		t=a[i];
		ans=i;
			}
		if(abs(k+a[i]*0.006)< abs(k+t*0.006)){
		t=a[i];
		ans=i;
		}
	}
	cout<<ans<<endl;
return 0;
}


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

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef pair<ll, ll> PLL;


//   0 1 2 3 4 5 6 7 8 9
// 0 x x o o o o o o o o
// 1 x x x o o o o o o o
// 2 o x x x o o o o o o
// 3 o o x x x o o o o o
// 4
// 5
// 6
// 7
// 8
// 9

signed main() {
    ll x,y;
    cin>>x>>y;
    if (abs(x-y)>1){
        cout<<"Alice"<<endl;
    }else{
        cout<<"Brown"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
template<class T> inline void chmin(T &a, T b){if(a>=b)a=b;}
template<class T> inline void chmax(T &a, T b){if(a<=b)a=b;}
typedef long long ll;

int D,G;


int main()
{
    cin >> D >> G;
    vector<int> p(D);
    vector<int> c(D);
    REP(i,D) cin >> p[i] >> c[i];

    int ans = 1e9;
    // 全部とく問題をbit全探索
    REP(bit,(1<<D)){
        int sum = 0; // 合計点
        int cnt = 0; // といた数
        int mxi = -1; // 全部とかない最大の問題
        REP(i,D){
            // ビットが立ってたら全部とく
            if(bit & (1<<i)){
                sum += 100*(i+1)*p[i] + c[i];
                cnt += p[i];
            } else {
                mxi = i;
            }
        }
        // 全部といてもまだ足りないなら、最大の点数をとく(全部はとかない)
        if(sum < G){
            // 最大の点数
            int mxp = 100 * (mxi + 1);
            // それがどれくらい必要か
            int rest = G - sum;
            int need = rest % mxp == 0 ? rest / mxp : rest / mxp + 1;
            if(need < p[mxi]) cnt += need;
            else continue;
        }
        chmin(ans,cnt);
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
    int n = 999999;
    vector<char> g (n + 1, true);
    g[0] = g[1] = false;
    for ( int i = 0; i < n; i ++ ){
        if (g[i]){
            if ( i * 1ll * i <= n ){
                for ( int j = i * i; j <= n; j += i ){
                    g[j] = false;
                }
            }
        }
    }
    int a;
    cin >> a;
    while ( g[a] == false ) a ++;
    cout << a;
    return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
const int INF = 1 << 20;

typedef long long ll;




int main(){
  ll h,w;
  cin >> h >> w;
  ll a,b;
  a = h/3;
  b = h/3;
  if(h%3 != 0)
    b++;
  ll mx = 1e10;
  if(a != 0)
    mx = min(mx,b*w-a*w);
  a = w/3;
  b = w/3;
  if(w%3 != 0)
    b++;
  if(a != 0)
    mx = min(mx,b*h-a*h);
  ll c = 0,d = 1e10;
  for(int i = 1;i < h;i++){
    a = w/2; 
    b = w/2;
    if(w%2 == 1)
      b++;
    c = max(b*(h-i),w*i);
    d = min(a*(h-i),w*i);
    mx = min(c-d,mx);
  }
  for(int i = 1;i < w;i++){
    a = h/2; 
    b = h/2;
    if(h%2 == 1)
      b++;
    c = max(b*(w-i),h*i);
    d = min(a*(w-i),h*i);
    mx = min(c-d,mx);
  }
  cout << mx << endl;
  
  return 0;
}


Measured memory_bytes: 256
// Template begins
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <math.h>
#include <iomanip>
#include <queue> 
#include <string.h>
#include <string>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define endl "\n"
#define lb lower_bound
#define ub upper_bound
#define fo(i,a,b) for(i=a;i<b;i++)
#define all(v) (v).begin(),(v).end()
#define sort0(v) sort(all(v))
#define lbb(a,b,arr,x) lower_bound(arr+a,arr+b+1,x)-arr
#define ubb(a,b,arr,x) upper_bound(arr+a,arr+b+1,x)-arr
#define freq(a,b,arr,x) upper_bound(arr+a,arr+b+1,x)-lower_bound(arr+a,arr+b+1,x)
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<endl
#define d6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<endl
#define max3(a,b,c) max(max((a),(b)),(c))
#define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))
#define ss second
#define ff first
#define pb push_back
#define mp make_pair
#define printp(x) cout << x.ff << " " << x.ss << endl

const ll mod=998244353;
#define inf 9999999999999
#define MAXN   100001 
  
// stores smallest prime factor for every number 
ll inv(ll i){if(i==1) return 1;return (mod-((mod/i)*inv(mod%i))%mod)%mod;}
ll gcd(ll a,ll b){if(a==0) return b;return gcd(b,b%a);}
inline void fastio(){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
// Template ends
const int MN = 2e5+7;






int main(){
    fastio();
    
    
        
        //write code here
        string s;
        cin>>s;
        int ans=0;
        int length=0;
        for(int i=0;i<s.length();i++){
            if(s[i]=='R'){
                length++;
            }else{
                ans=max(ans,length);
                length=0;
            }
        }
        ans=max(ans,length);
        cout<<ans<<endl;
        
    
    return 0;
}

 

Measured memory_bytes: 3196
import sys
read_=sys.stdin.buffer.readline

a,b,c,x,y=map(int,read_().split())

ans1=x*a+y*b
if max(x,y)==x:
    ans2=y*c*2+(x-y)*a
else:
    ans2=x*c*2+(y-x)*b
ans3=max(x,y)*2*c

print(min(ans1,ans2,ans3))

Measured memory_bytes: 3060
N = int(input())
number_list = list(map(int,input().split()))
count = 0
for i in range(N):
    if number_list[i]%6==0 or number_list[i]%10==0:
        count+=1
    elif number_list[i]%2==1:
        count+=1

if N == count:
    print("APPROVED")
else:
    print("DENIED")

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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair <ll,ll> pii;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rept(i,x,y) for(int i=x;i<=y;i++)
#define per(i,x,y) for(int i=x;i>=y;i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define fi first
#define se second
#define mes(a,b) memset(a,b,sizeof a)
#define mp make_pair
#define dd(x) cout<<#x<<"="<<x<<" "
#define de(x) cout<<#x<<"="<<x<<"\n"
#define debug() cout<<"I love Miyamizu Mitsuha forever.\n"
const int inf=0x3f3f3f3f;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin>>n;
	ll ans=0;
	rept(i,1,n)
	{
		ll cnt=n/i;
		ans+=(i+cnt*i)*cnt/2;
	}
	cout<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 3644
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

func parseProblem() (int, int) {
	n, m := scanInt(sc), scanInt(sc)
	return n, m
}

func resolve(n, m int) int {
	numUseS := min(n, m>>1)
	numLeftC := m - numUseS<<1
	return numUseS + numLeftC>>2
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


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

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int w, h, mini;
vector<vector<int>>fld;

void DepthSerch(int y, int x, int nowdepth) {
	if (nowdepth > mini)return;
	//4???????????¢?´¢
	rep(i, 4) {
		int ny = y, nx = x;
		//?¬????????????¨?????¢????????????1???????¬?????????????
		if (0 > ny+dy[i] || ny + dy[i] >= h || 0 > nx + dx[i] || nx + dx[i] >= w || fld[ny + dy[i]][nx + dx[i]] == 1) continue;
		while (true) {
			//?¬????????????¨?????¢?????§???????????¨????¢???????????????°???????????±???
			if (0 > ny + dy[i] || ny + dy[i] >= h || 0 > nx + dx[i] || nx + dx[i] >= w) break;
			//??????????????????
			ny += dy[i];
			nx += dx[i];
			//??´????????????
			if (fld[ny][nx] == 3) {
				mini = min(mini, nowdepth + 1);
				return;
			}
			//???????????????
			else if (fld[ny][nx] == 1) {
				//???????????´?£?
				fld[ny][nx] = 0;
				//??????????????´?£?????????????????????¶?????§DepthSerch?????????
				DepthSerch(ny - dy[i], nx - dx[i], nowdepth + 1);
				//??????????????´?£??????????????????¶????????????
				fld[ny][nx] = 1;
				break;
			}
		}
	}
}

int main() {
	//??\???
	int start_x, start_y, input;
	while (cin >> w >> h, w || h) {
		fld.clear();
		mini = 11;
		rep(i, h) {
			fld.push_back(vector<int>());
			rep(j, w) {
				cin >> input;
				fld[i].push_back(input);
				if (fld[i][j] == 2) {
					start_y = i;
					start_x = j;
				}
			}
		}
		//??????
		DepthSerch(start_y, start_x, 0);
		//??????
		if (mini == 11) {
			cout << -1 << endl;
		}
		else {
			cout << mini << endl;
		}
	}
}

Measured memory_bytes: 3084
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <cmath>

using namespace std;
void a_shiritori(void) {
	string a, b, c;
	cin >> a >> b >> c;

	if ((a[a.size() - 1] == b[0])&&(b[b.size()-1]==c[0])) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}


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

Measured memory_bytes: 3608
#include <iostream>

using namespace std;
long long a[100010],x[100010];
int main(){
	int i,n;
	cin >> n;
	for(i=1;i<=n;i++){
		cin >> a[i];
	}
	long long s = 0,t = 1;
	for(i=1;i<=n;i++){
		s += t*a[i];
		t *= -1;
	}
	x[1] = s/2;
	for(i=1;i<=n;i++){
		x[i+1] = a[i] - x[i];
	}
	for(i=1;i<=n;i++){
		cout << 2*x[i] << " ";
	}
	cout << endl;
}

Measured memory_bytes: 2816
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
using namespace std;

int x2000;
int r, d;
typedef long long ll;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
int dfs(int i){
  if(i == 0)  return x2000;

  int ans = r * dfs(i - 1) - d;
  cout << ans << endl;
  return ans;
}

int main(){
  cin >> r >> d >> x2000;

  dfs(10);
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define dll(x) scanf("%I64d",&x)
#define xll(x) printf("%I64d\n",x)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define gg(x) getInt(&x)
#define db(x) cout<<"== [ "<<x<<" ] =="<<endl;
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll powmod(ll a,ll b,ll MOD){ll ans=1ll;while(b){if(b&1)ans=ans*a%MOD;a=a*a%MOD;b>>=1;}return ans;}
inline void getInt(int* p);
const int maxn=1000010;
const int inf=0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
int n;
map<ll,int> st;
ll a[maxn];
ll bin[2334];
int main()
{
//	    freopen("C:\\Users\\DH_M\\Desktop\\code_io\\in.txt.txt","r",stdin);
	//    freopen("C:\\Users\\DH_M\\Desktop\\code_io\\out.txt.txt","w",stdout);
	gbtb;
	cin>>n;
	repd(i,1,n)
	{
		cin>>a[i];
		st[a[i]]+=1;
	}
	sort(a+1,a+1+n);
	bin[0]=1ll;
	repd(i,1,33)
	{
		bin[i]=bin[i-1]*2ll;
	}
	int ans=0;

    for(int j=33;j>=0;j--)
    {
        int l=1;
        int r=n;
        while(l<r)
        {
            if(a[l]==-1||(~a[r]&&a[l]+a[r]<bin[j]))
            {
                l++;
            }else if(a[r]==-1||(a[l]+a[r]>bin[j]))
            {
                r--;
            }
            else
            {
                ans++;
                a[l]=-1;
                a[r]=-1;
            }
        }

	}
	cout<<ans<<endl;

    return 0;
}

inline void getInt(int* p) {char ch;do {ch = getchar();}
while (ch == ' ' || ch == '\n');if (ch == '-') {*p = -(getchar() - '0');
while ((ch = getchar()) >= '0' && ch <= '9') {*p = *p * 10 - ch + '0';}}
else {*p = ch - '0';while ((ch = getchar()) >= '0' && ch <= '9')
{*p = *p * 10 + ch - '0';}}}


Measured memory_bytes: 14464
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
//二項係数の計算
int nCr(int A, int B) {
    ll ans = 1;
    for (int i = 0; i < B; i++) {
        ans *= A - i;
    }
    for (int i = 0; i < B; i++) {
        ans /= i + 1;
    }
    return ans;
}
int main() {
   int N;
   cin>>N;
   int c=0;
   int ans=0;
   vector<char>C(N);
   rep(i,N){
       cin>>C[i];
       if(C[i]=='R'){
           c++;
       }
   }
   rep(i,c){
       if(C[i]=='W'){
           ans++;
       }
   }
   cout<<ans<<endl;
}

Measured memory_bytes: 3580
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Optional;

class Stack {
    int top;
    int[] buf;
    int size;

    Stack() {
        top = 0;
        buf = new int[101];
        size = 101;
    }

    boolean isEmpty() {
        return top == 0;
    }

    boolean isFull() {
        return top >= size;
    }

    void push(int x) {
        if (isFull()) {
            throw new IllegalArgumentException("Stack is full");
        }
        top++;
        buf[top] = x;
    }

    int pop() {
        if (isEmpty()) {
            throw new IllegalArgumentException("Stack is empty");
        }
        top--;
        return buf[top + 1];
    }

    Optional<Integer> peek() {
        return Optional.ofNullable(buf[top]);
    }
}

public class Main {
    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
            String[] arr = in.readLine().split(" ");
            Stack stack = new Stack();
            for (int i = 0; i < arr.length; i++) {
                String s = arr[i];
                char c = s.charAt(0);
                if (Character.isDigit(c)) {
                    stack.push(Integer.parseInt(s));
                } else {
                    int y = stack.pop();
                    int x = stack.pop();
                    switch (c) {
                        case ('+'):
                            stack.push(x + y);
                            break;
                        case ('-'):
                            stack.push(x - y);
                            break;
                        case ('*'):
                            stack.push(x * y);
                            break;
                        case ('/'):
                            stack.push(x / y);
                            break;
                    }
                }
            }

            System.out.println(stack.pop());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


Measured memory_bytes: 24364
(defun solve (a b c)
  (when (= a b c)
    (if (oddp a)
      (return-from solve 0)
      (return-from solve -1)))
  (labels 
    ((proc (a b c num)
       (if (or (oddp a) (oddp b) (oddp c))
         (return-from proc num) 
         (proc (/ (+ b c) 2) (/ (+ c a) 2) (/ (+ a b) 2) (1+ num)))))
    (proc a b c 0)))
(princ (solve (read) (read) (read)))

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

#define maxn 100005
#define N 100000
#define inf (int) 2e9
#define ll long long
#define ii pair <int, int>
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define REP(i, a, b) for(int i = a; i >= b; i--)

int n, m, run = 1;
vector <int> g[maxn];
int cl[maxn], f1[maxn];

void dfs(int u) {
    cl[u] = run;
    for(auto &v : g[u]) {
        if(cl[v] != run) dfs(v);
        f1[u] = max(f1[u], f1[v] + 1);
    }
}

int main() {
    //freopen("main.inp", "r", stdin);
    cin >> n >> m;
    FOR(i, 1, m) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
    }
    FOR(i, 1, n)
        if(cl[i] != run) dfs(i);
    int ans = 0;
    FOR(i, 1, n) ans = max(ans, f1[i]);
    cout << ans;
}


Measured memory_bytes: 11884
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define REP(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define SZ(i) int(i.size())
#define eb emplace_back
#define ALL(i) i.begin(),i.end()
#define X first
#define Y second
#ifdef tmd
#define IOS()
#define debug(...) fprintf(stderr,"#%d: %s = ",__LINE__,#__VA_ARGS__),_do(__VA_ARGS__);
template<typename T> void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y){cerr<<x<<", ";_do(y...);}
template<typename It> ostream& _printRng(ostream &os,It bg,It ed)
{
    os<<"{";
    for(It it=bg;it!=ed;it++) {
        os<<(it==bg?"":",")<<*it;
    }
    os<<"}";
    return os;
}
template<typename T> ostream &operator << (ostream &os,vector<T> &v){return _printRng(os,v.begin(), v.end());}
template<typename T> ostream &operator << (ostream &os,set<T> &v){return _printRng(os,v.begin(), v.end());}
template<typename T> void pary(T bg, T ed){_printRng(cerr,bg,ed);cerr<<endl;}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define debug(...)
#define pary(...)
#endif

const int MAXN = 200005;
const ll MOD = 1000000007;

string cmd;
vector<int> cur;
ll dp[MAXN];
set<int> lf;
vector<int> mt;

/*********************GoodLuck***********************/
int main () {
    IOS();

    cin >> cmd;

    int n = SZ(cmd);
    ll ans = 0;
    REP (i, n) {
        int csz = SZ(cur);
        dp[csz] = 0;
        if (cmd[i] == '(') {
            cur.eb(i);
            lf.insert(csz);
        } else if (cmd[i] == ')') {
            cur.eb(i);

            if (SZ(lf) >= 1) {
                auto ed = prev(lf.end());

                dp[csz] = (*ed > 0 ? dp[(*ed)-1] : 0) + 1;
                mt.eb(*ed);
                lf.erase(ed);
                ans += dp[csz];
            } else {
                mt.eb(-1);
            }

        } else {
            if (cmd[cur.back()] == ')') {
                if (mt.back() != -1) {
                    lf.insert(mt.back());
                    ans -= dp[csz-1];
                }
                dp[csz-1] = 0;
                mt.pop_back();
            } else {
                lf.erase(csz-1);
            }
            cur.pop_back();
        }

        cout << ans << endl;
    }
}



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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n,k;
    cin>>n>>k;
    vll a(n);rep(i,n)cin>>a[i].F>>a[i].S;
    sort(all(a));
    ll sum=0;
    for(int i=0;i<n;++i){
        sum+=a[i].S;
        if(sum>=k){cout<<a[i].F;return 0;}
    }
}

Measured memory_bytes: 1792
// -*- coding: utf-8 -*-
//import java.awt.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    InputStream inputStream;
    if (args.length > 0 && args[0].equals("devTesting")) {
      try {
        inputStream = new FileInputStream(args[1]);
      } catch(FileNotFoundException e) {
        throw new RuntimeException(e);
      }
    } else {
      inputStream = System.in;
    }
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskA solver = new TaskA();
    solver.solve(1, in, out);
    out.close();
  }
  
  static class TaskA {    
    long a, b, c;
    
    void solve(int testNumber, InputReader in, PrintWriter out) {
      a = in.nextInt();
      b = in.nextInt();
      c = in.nextInt();
      long ans = (a - 2 * (a / 2)) * b * c;
      ans = Math.min(ans, (b - 2 * (b / 2)) * a * c);
      ans = Math.min(ans, (c - 2 * (c / 2)) * a * b);
      out.println(ans);
    }
    
  }
      
  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

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

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

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

    public long nextLong() {
      return Long.parseLong(next());
    }
    
    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public boolean hasInput() {
      try {
        if (tokenizer != null && tokenizer.hasMoreTokens()) {
          return true;
        }
        reader.mark(1);
        int ch = reader.read();
        if (ch != -1) {
          reader.reset();
          return true;
        }
        return false;
      } catch(IOException e) {
        throw new RuntimeException(e);
      }
    }
    
  }
}


Measured memory_bytes: 8148
#include <stdio.h>
int main(void){
   long long int x;
   long long int a = 100;
   int count = 0; 
   scanf("%lld", &x);
for(int i = 0; i < 3760; i++){
    a = a + a / 100;
    count++;
    if(x <= a){
        printf("%d", count);
        return 0;
    }
}

return 0;
}

Measured memory_bytes: 1732
from itertools import permutations

def warshall_floyd(n, d):
    for k in range(n):
        for i in range(n): #始点
            for j in range(n): #終点
                d[i][j] = min(d[i][j], d[i][k]+d[k][j])
    return d

n,m,R=map(int,input().split())
r=list(map(int,list(input().split())))
g=[[float("inf")]*n for _ in range(n)]
for i in range(m):
    a,b,c=map(int,input().split())
    g[a-1][b-1]=c
    g[b-1][a-1]=c
for i in range(n):
    g[i][i]=0
g=warshall_floyd(n,g)
ans=float("inf")
for p in list(permutations(r)):
    tmp=0
    for i in range(R-1):
        tmp+=g[p[i]-1][p[i+1]-1]
    ans=min(ans,tmp)
print(ans)


Measured memory_bytes: 65496
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


def main():
	a = int(input())
	s = input()
	if(a<3200):
		print('red')
	else:
		print(s)



def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()


Measured memory_bytes: 5196
import numpy as np
n, m, x = map(int, input().split())
refer = [list(map(int, input().split())) for _ in range(n)]

ans =[]
for i in range(2**n):
    skill = []
    money = 0

    for j in range(n):
        if (i >> j) & 1:
            skill.append(refer[j][1:])
            money += refer[j][0]
            a = np.array(skill)
            if np.all(np.sum(a, axis=0) >= x):
                ans.append(money)
if ans == []:
    print(-1)
else:
    print(min(ans))
        

Measured memory_bytes: 27724
#include <iostream>

using namespace std;

int main(void)
{
    int sunukes_count;
    int treats_kind;
    bool *has_treat;

    cin >> sunukes_count >> treats_kind;

    has_treat = new bool[sunukes_count];

    for(int i = 0; i < sunukes_count; i++){
        has_treat[i] = false;
    }

    for(int i = 0; i < treats_kind; i++){
        int posessers;
        cin >> posessers;
        for(int j = 0; j < posessers; j++){
            int posesser;
            cin >> posesser;

            has_treat[posesser - 1] = true;
        }
    }

    int posess_count = 0;
    for(int i = 0; i < sunukes_count; i++){
        if(!has_treat[i]){
            posess_count += 1;
        }
    }

    cout << posess_count << endl;

    return 0;
}

Measured memory_bytes: 3600