akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define erep(i,n) for (int i = 1; i <= (n); ++i)
#define brep(i,n) for (int i = n; i >= 0; i--)
using namespace std;
using P = pair<int,int>;
using ll = long long;
using Graph = vector<vector<int> > ;

const double PI=3.14159265358979323846;
const int INF = 100005;
const int MAX_K = 55;
const int MAX_W = 200005; 
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
ll dp[100005];


// ユークリッド互除法
unsigned gcd(unsigned a, unsigned b) {
  while(1) {
    if(a < b) swap(a, b);
    if(!b) break;
    a %= b;
  }
  return a;
}

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

/*
int main() {
    // 前処理
    COMinit();

    // 計算例
    cout << COM(100000, 50000) << endl;
}
*/

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%MOD+MOD)%MOD){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime MOD
  mint inv() const { return pow(MOD-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}



int main(){
  ll k,n;
  cin >> n >> k;
  mint ans = 0;
  for(ll i = k; i <= n+1; i++){
    ans += n*i - i*i + i +1;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3508
#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <cstring>

using namespace std;

int main() {
	// your code goes here
	long long l,r;
	cin>>l>>r;
	
	vector<long long>nos;
	for(long long i= l ; i<= min( l +2018 , r ); i++){
		nos.push_back(i%2019);
	}
	
	long long ans = 2018;
	for(long long i=0;i<nos.size();i++){
		for(long long j= i+1 ;j<nos.size();j++ ){
			ans = min( ans, (nos[i]*nos[j])%2019 );
		}
	}

	cout<<ans<<endl;

	return 0;
}

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

int main()
{
    long long int p,multi=0,r;
    string q;
    cin>>p>>q;
    r=(q[0]-'0')*100+(q[2]-'0')*10+(q[3]-'0');
    multi=p*r;
    multi/=100;
    cout<<multi<<endl;
    return 0;
}



Measured memory_bytes: 3628
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // a[i]の取得
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = sc.nextLong();
            // ゼロがあった場合は，0を返して終了
            if(a[i]==0){
                System.out.println(0);
                return;
            }
        }
        // ゼロがない場合，回答を求める
        long ans = 1L;
        long upper = 1000000000000000000L;
        for(int j=0; j<n; j++){
            // 10^18を超えたら-1にしてループを抜ける
            if(a[j] > upper/ans){
                ans = -1;
                break;
            }
            // 乗算を行う
            ans *= a[j];
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 60984
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(0);
	int v[3];
	cin >> v[0] >> v[1] >> v[2];
	sort(v,v+3);
	int ans = 0;
	int diff1 = v[2] - v[0];
	int diff2 = v[2] - v[1];
	ans += diff1 / 2;
	ans += diff2 /2;
	diff1 %= 2;
	diff2 %= 2;
	if(diff1 && diff2)
		ans++;
	else if( diff1 || diff2)
	{
		ans += 2;
	}
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 256
use proconio::input;
use proconio::marker::{Bytes, Chars};

// use std::cmp::*;
use std::collections::HashMap;

fn main() {
    input! {
        sa:Chars,
        sb:Chars,
        sc:Chars,
    }

    let mut idx: [usize; 3] = [0, 0, 0];
    let mut map: HashMap<char, usize> = HashMap::new();
    let inputs = [sa, sb, sc];
    map.insert('a', 0);
    map.insert('b', 1);
    map.insert('c', 2);

    let mut n = 'a';
    loop {
        let i: usize = idx[map[&n]];
        let s = &inputs[map[&n]];
        if s.len() <= i {
            println!("{}", n.to_uppercase());
            return;
        }
        idx[map[&n]] += 1;
        n = s[i];
    }
}


Measured memory_bytes: 2144
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
  int h,w;
  while(1) {
    cin >> h >> w;
    if(h == 0 && w == 0) break;
    REP(i,h) {
      REP(j,w) {
        cout << "#";
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}



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

#define MAXSIZE 100

int H, W;
int countType;
char plants[MAXSIZE][MAXSIZE];
int flags[MAXSIZE][MAXSIZE];
char temp;

void DFS(int i, int j) {
	flags[i][j] = 1;
	if (i + 1< H && temp == plants[i+1][j] && flags[i+1][j] != 1)
	{
		DFS(i + 1, j);
	}
	if (i - 1 >= 0 && temp == plants[i-1][j] && flags[i-1][j] != 1)
	{
		DFS(i - 1, j);
	}
	if (j + 1 < W && temp == plants[i][j+1] && flags[i][j+1] != 1)
	{
		DFS(i, j + 1);
	}
	if (j - 1>= 0 && temp == plants[i][j-1] && flags[i][j-1] != 1)
	{
		DFS(i, j - 1);
	}
}
int main() {
	while (cin >> H >> W && H!=0 && W!=0 )
	{
		countType = 0;
		for (int i = 0; i < H; i++)
		{
			for (int j = 0; j < W; j ++)
			{
				cin >> plants[i][j];
				flags[i][j] = 0;
			}
		}

		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				if (flags[i][j] != 1)
				{
					temp = plants[i][j];
					DFS(i, j);
					countType++;
				}
				else
				{
					continue;
				}
			}
		}
		cout << countType << endl;
	}
	return 0;
}

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

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define SQ(x) ((x) * (x))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main() {
    int money;
    bool f = false;
    while (cin >> money, money) {
        vi coin(4);
        int n = 0;
        REP(i, 4) {
            cin >> coin[i];
            n += coin[i];
        }

        vi res(4);
        int mi = 100;
        REP(i, coin[0]+1)
        REP(j, coin[1]+1)
        REP(k, coin[2]+1)
        REP(l, coin[3]+1) {
            int pay = 10*i + 50*j + 100*k + 500*l;
            if (money <= pay) {
                int m = n-i-j-k-l;
                pay -= money;
                m += pay / 500;
                pay %= 500;
                m += pay / 100;
                pay %= 100;
                m += pay / 50;
                pay %= 50;
                m += pay / 10;
                if (mi > m) {
                    mi = m;
                    res = {i, j, k, l};
                }
            }
        }

        if (f) cout << endl;

        if (res[0] > 0) cout << 10 << " " << res[0] << endl;
        if (res[1] > 0) cout << 50 << " " << res[1] << endl;
        if (res[2] > 0) cout << 100 << " " << res[2] << endl;
        if (res[3] > 0) cout << 500 << " " << res[3] << endl;

        f = true;
    }
}

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

const int N = 1e5 + 7;

int cnt[N];
int red[N];

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        if ( i == 1) {
            red[i] = 1;
            cnt[i] = 1;
        } else {
            cnt[i] = 1;
        }
    }
    while (m--) {
        int x, y;
        cin >> x >> y;
        if (red[x]) {
            red[y] = 1;
            cnt[x]--;
            cnt[y]++;
            if (!cnt[x]) {
                red[x] = 0;
            }
        } else {
            cnt[x]--;
            cnt[y]++;
        }
    }
    int ans = 0;
    for (int i = 1; i <=  n; i++) ans += red[i];
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
 
using namespace std;
 
int main()
{
	string s, t;
	cin >> s >> t;
	sort(s.begin(), s.end());
	sort(t.begin(), t.end());
	reverse(t.begin(), t.end());
	
	if(s < t){
		cout << "Yes";
	}else{
		cout << "No";
	}
	return 0;
}

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

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
const int N = 1e5+5;

ll n , m;
vector<ll> a;
vector< pair<ll,ll> > b;

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

    cin >> n >> m;
    for(int i=1; i<=n; i++)
    {
        int x;
        cin >> x;
        a.push_back(x);
    }

    for(int i=1; i<=m; i++)
    {
        int x,y;
        cin >> x >> y;
        b.push_back({y,x});
    }

    sort(b.begin() , b.end()) , sort(a.begin() , a.end() , greater<ll>() );

    ll ans = 0;
    while(b.size())
    {
        ll cnt = b.back().s , tmp = b.back().f;
        while(cnt > 0 && a.size() && a.back() < tmp)
        {
            cnt--;
            ans += tmp;
            a.pop_back();
        }
        b.pop_back();
    }
    while(a.size())
    {
        ans += a.back();
        a.pop_back();
    }
    cout << ans << '\n';
	//
  
    return 0;
}

Measured memory_bytes: 6060
package main

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

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

type Store struct {
	price, num int
}

type ByPrice []Store

func (a ByPrice) Len() int           { return len(a) }
func (a ByPrice) Less(i, j int) bool { return a[i].price < a[j].price }
func (a ByPrice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	N, M := sc.nextInt(), sc.nextInt()
	stores := make([]Store, N)
	for i := 0; i < N; i++ {
		stores[i] = Store{sc.nextInt(), sc.nextInt()}
	}
	sort.Sort(ByPrice(stores))
	count := 0
	total := 0
	for _, s := range stores {
		if M <= count+s.num {
			total += s.price * (M - count)
			break
		} else {
			total += s.price * s.num
			count += s.num
		}
	}
	fmt.Println(total)
}


Measured memory_bytes: 3840
s = list(input())
ans_list = []

for i in range(len(s)):
  if s[i] == '0':
    ans_list.append('0')
  if s[i] == '1':
    ans_list.append('1')
  if ans_list == []:
    pass
  else:
    if s[i] == 'B':
      ans_list.pop(-1)

ans = ''.join(ans_list)
print(ans)

Measured memory_bytes: 3060
BIG_NUM = 2000000000

N = int(input())

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

maximum = -BIG_NUM
minimum = BIG_NUM
total = 0

for x in table:
    if maximum < x:
        maximum = x
    if minimum > x:
        minimum = x
    total += x

print("%d %d %d"%(minimum,maximum,total))



Measured memory_bytes: 6596
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .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 ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

    ($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, parser) => {
        $next
    };

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

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

#[allow(dead_code)]
struct Edge {
    from: usize,
    to: usize,
}

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1_000_000_007;

fn main() {
    input! {
        a: [[usize; 3]; 3],
        n: usize,
        b: [usize; n],
    }

    let mut open = vec![false; 200];
    for x in b {
        open[x] = true;
    }

    for i in 0..3 {
        let mut ok = true;
        for j in 0..3 {
            if !open[a[i][j]] {
                ok = false;
            }
        }
        if ok {
            println!("Yes");
            return;
        }
        let mut ok = true;
        for j in 0..3 {
            if !open[a[j][i]] {
                ok = false;
            }
        }
        if ok {
            println!("Yes");
            return;
        }
    }

    if open[a[0][0]] && open[a[1][1]] && open[a[2][2]]
        || open[a[2][0]] && open[a[1][1]] && open[a[0][2]]
    {
        println!("Yes");
        return;
    }

    println!("No");
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)

const ll MOD = 1e9+7;

template<int MOD> struct Fp {
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
    if (val < 0) v += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator - () const noexcept {
    return val ? MOD - val : 0;
  }
  constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp& operator += (const Fp& r) noexcept {
    val += r.val;
    if (val >= MOD) val -= MOD;
    return *this;
  }
  constexpr Fp& operator -= (const Fp& r) noexcept {
    val -= r.val;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr Fp& operator *= (const Fp& r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp& operator /= (const Fp& r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b; swap(a, b);
      u -= t * v; swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr bool operator == (const Fp& r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator != (const Fp& r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
    return os << x.val;
  }
  friend constexpr istream& operator >> (istream &is, Fp<MOD>& x) noexcept {
    return is >> x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
    if (n == 0) return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1) t = t * a;
    return t;
  }
};


int main () {
  using mint = Fp<MOD>;
  int H, W, K;
  cin >> H >> W >> K;

  // t[i][j]: c[i] -> c[j]
  vector<vector<mint>> t(W, vector<mint>(W, 0));

  rep(i,1<<(W-1)) {
    rep(j,W-1) {
      if(((i>>j) & (i>>(j+1)) & 1)) goto next;
    }
    rep(j,W) {
      if(j-1 >= 0 && ((i>>(j-1)) & 1)) {
        t[j][j-1] += 1;
      } else if (j+1 <= W-1 && ((i>>j) & 1)) {
        t[j][j+1] += 1;
      } else {
        t[j][j] += 1;
      }
    }
  next:;
  }

  vector<vector<mint>> c(H+1, vector<mint>(W, 0));
  c[0][0] = 1;
  rep(h,H) {
    rep(i,W) {
      rep(j,W) {
        c[h+1][j] += t[i][j] * c[h][i];
      }
    }
  }

  cout << c[H][K-1] << endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())
def make(r):
    rr = [1]
    for i, v in r:
        newrr = rr[:]
        for j in rr:
            for k in range(v):
                newrr.append(j * i ** (k + 1))
        rr = newrr
    return rr
        
def factors(n):
    k = n
    i = 2
    r = []
    while i * i <= k:
        v = 0
        while k % i == 0:
            v += 1
            k //= i
        if v > 0:
            r.append((i, v))
        i += 1
    if k > 1:
        r.append((k, 1))
    return make(r)

def isOK(n, k):
    return n % k == 1

r = 0
for i in factors(n):
    n1 = n
    while n1 % i == 0 and i != 1:
        n1 //= i
    if isOK(n1, i):
        r += 1
#print(factors(n), r)
r += len(factors(n - 1)) - 1
#print(factors(n - 1), r)
print(r)


Measured memory_bytes: 3188
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

int main()
{
	int N;
	long double t;
	in >> N >> t;
	std::vector<long double>x(N), h(N);
	rep(i, N) in >> x[i] >> h[i];

	long double ans = -1.;
	rep(i, N)
	{
		long double res = h[i] / x[i] * t;
		ans = std::max(ans, res);
	}

	out << std::fixed << std::setprecision(6);
	out << ans << std::endl;
	return 0;
}



Measured memory_bytes: 3328
#include<bits/stdc++.h>
 using namespace std;
 int main(){
 	string a;
 	string b;
 	cin>>a>>b;
  sort(a.begin(),a.end());
  sort(b.rbegin(),b.rend());
  if(a<b)
  	cout<<"Yes";
  else
  	cout<<"No";
 	return 0;
 }

Measured memory_bytes: 256
#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

int main()
{
    int n,m;
    cin >>n >>m;
    vector<int> a(n);
    rep(i,n) cin >>a[i];

    int ans=0;
    int start=0;
    while(1)
    {
        int p=0, q=123456789;
        rep(i,m)
        {
            p = max(p,a[(start+i)%n]);
            q = min(q,a[(start+i)%n]);
        }
        ans += p-q;

        (start+=m)%=n;
        if(start==0) break;
    }

    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 3204
#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1e9;
const LL LLINF = 1e16;

int main(){
    fastcin();

    int n;
    cin >> n;
    vector<int> a(n), b(n);
    rep(i, n) cin >> a[i] >> b[i];
    vector<int> p(n);
    iota(all(p), 0);
    double ans = 0;
    while(1){
        double tmp = 0;
        rep1(i, n){
            tmp += sqrt((a[p[i]]-a[p[i-1]])*(a[p[i]]-a[p[i-1]]) + (b[p[i]]-b[p[i-1]])*(b[p[i]]-b[p[i-1]]));
        }
        ans += tmp;
        if(!next_permutation(all(p))) break;
    }
    rep1(i, n+1) ans /= i;
    cout << decimal << ans << endl;

}

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

int n, p[300000];

int main(){
  int n;
  cin >> n;
  rep(i, n){
    cin >> p[i];
    p[i] -= i + 1;
  }
  rep(i, n) cerr << p[i] << " ";
  int cnt = 0;
  bool flag = true;
  rep(i, n){
    if(p[i] == 0){
      if(flag){
        flag = false;
        cnt++;
      }else{
        flag = true;
      }
    }else{
      flag = true;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 640
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.map!(to!int).array; }

void calc(string s) {
    int toi(char c) { return c - '0'; }

    int a = toi(s[0]);
    int b = toi(s[1]);
    int c = toi(s[2]);
    int d = toi(s[3]);

    int reduce(int lhs, int rhs, int op) {
        return op == 0 ? lhs + rhs : lhs - rhs;
    }
    char op(int op) {
        return op == 0 ? '+' : '-';
    }

    for (int i = 0; i < 2; i++) {
        int x = reduce(a, b, i);
        for (int j = 0; j < 2; j++) {
            int y = reduce(x, c, j);
            for (int k = 0; k < 2; k++) {
                int z = reduce(y, d, k);
                if (z == 7) {
                    writeln(a, op(i), b, op(j), c, op(k), d, "=7");
                    return;
                }
            }
        }
    }
}

void main() {
    auto s = readln.chomp;
    calc(s);
}

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

template <int mod = (int)(998244353)>
struct ModInt {
  int x;
  ModInt() : x(0) {}
  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  ModInt &operator+=(const ModInt &p) {
    if ((x += p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &p) {
    if ((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &p) {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }
  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }
  ModInt operator-() const { return ModInt(-x); }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt &p) const { return x == p.x; }
  bool operator!=(const ModInt &p) const { return x != p.x; }
  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while (b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  ModInt pow(int64_t n) const {
    ModInt res(1), mul(x);
    while (n) {
      if (n & 1) res *= mul;
      mul *= mul;
      n >>= 1;
    }
    return res;
  }
  friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }
  static int get_mod() { return mod; }
};

struct Combination {
  vector<ModInt<>> _fact, _rfact, _inv;
  Combination(long long nsize = 5000000)
      : _fact(nsize + 1), _rfact(nsize + 1), _inv(nsize + 1) {
    _fact[0] = _rfact[nsize] = _inv[0] = 1;
    for (int i = 1; i <= nsize; i++) _fact[i] = _fact[i - 1] * i;
    _rfact[nsize] /= _fact[nsize];
    for (int i = nsize - 1; i >= 0; i--) _rfact[i] = _rfact[i + 1] * (i + 1);
    for (int i = 1; i <= nsize; i++) _inv[i] = _rfact[i] * _fact[i - 1];
  }
  inline ModInt<> fact(int k) const { return _fact[k]; }

  inline ModInt<> rfact(int k) const { return _rfact[k]; }

  inline ModInt<> inv(int k) const { return _inv[k]; }

  ModInt<> P(int n, int r) const {
    if (r < 0 || n < r) return 0;
    return fact(n) * rfact(n - r);
  }

  ModInt<> C(int p, int q) const {
    if (q < 0 || p < q) return 0;
    return fact(p) * rfact(q) * rfact(p - q);
  }
  // n types,choose r
  ModInt<> H(int n, int r) const {
    if (n < 0 || r < 0) return (0);
    return r == 0 ? 1 : C(n + r - 1, r);
  }
};

long long r, c, h, w;
vector<vector<ModInt<>>> dp;

ModInt<> solve();

int main() {
  cin >> r >> c >> h >> w;
  cout << solve() << endl;
  return 0;
}

ModInt<> solve() {
  dp.assign(h + 1, vector<ModInt<>>(w + 1, 0));
  dp[r][c] = 1;
  for (int i = r; i <= h; ++i)
    for (int j = c; j <= w; ++j) {
      dp[i][j] += dp[i - 1][j] * j;
      dp[i][j] += dp[i][j - 1] * i;
      dp[i][j] -= dp[i - 1][j - 1] * (i - 1) * (j - 1);
    }
  return dp[h][w];
}

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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 a,b;
    cin >> a >> b;
    FOR(i,1,10001){
        if((int32)((double)i * 0.08) == a && (int32)((double)i * 0.1) == b){
            ANS(i);
            return 0;
        }
    }
    ANS(-1);
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProblemB
{
    class Program
    {
        // beg 51 B
        static void Main(string[] args)
        {
            var read = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var K = read[0];
            var S = read[1];
            var ret = 0; 
            // Y + Z = S - X 
            // loop for X
            for (int i = 0; i <= S && i <= K; i++)
            {
                var yPlusZ = S - i;
                if(yPlusZ <= 2 * K)
                    ret += Math.Min(yPlusZ, K) - Math.Max(yPlusZ - K, 0) + 1;
            }
            Console.WriteLine(ret);
        }
    }
}


Measured memory_bytes: 28236
#include<bits/stdc++.h>
    using namespace std;
    #define endl '\n'
    typedef long long ll;
    #define all(x) (x).begin(), (x).end()
     
    int main(){
        int r; cin>>r;
        double op = (r*(acos(-1)))*2;
        cout<<op<<endl;
        return 0;
    }
     

Measured memory_bytes: 3788
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

typedef std::vector<std::string> Data;

int Multi(int,int,int,Data);
int Add(int,int,int,Data);

int Multi(int level,int pos,int n ,Data data){
  std::vector<int> vec;
  for(int i=pos;i<n;i++){
    std::string tgt=data[i];
    if(tgt[level]=='*'){
      vec.push_back(Multi(level+1,i+1,n,data));
    }else if(tgt[level]=='+'){
      vec.push_back(Add(level+1,i+1,n,data));
    }else{
      int tgt_level=0;
      for(int ti=0;ti<tgt.size();ti++){
        if(tgt[ti]=='.'){
          tgt_level++;
        }else{
          break;
        }
      }
      if(tgt_level<level){
        int result=1;
        for(auto x:vec){
          result*=x;
        }
        return result;
      }else if(tgt_level==level){
        vec.push_back(tgt[tgt_level]-'0');
      }
    }
  }
}

int Add(int level,int pos,int n ,Data data){
  std::vector<int> vec;
  for(int i=pos;i<n;i++) {
    std::string tgt = data[i];
    if (tgt[level] == '*') {
      vec.push_back(Multi(level + 1, i + 1, n, data));
    } else if (tgt[level] == '+') {
      vec.push_back(Add(level + 1, i + 1, n, data));
    } else {
      int      tgt_level = 0;
      for (int ti        = 0; ti < tgt.size(); ti++) {
        if (tgt[ti] == '.') {
          tgt_level++;
        } else {
          break;
        }
      }
      if (tgt_level < level) {
        int       result = 0;
        for (auto x:vec) {
          result += x;
        }
        return result;
      } else if (tgt_level == level) {
        vec.push_back(tgt[tgt_level]-'0');
      }
    }
  }
}

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);

  while(1){
    int n;
    Data data;
    cin>>n;
    if(n==0){
      break;
    }else if(n==1){
      int a;
      cin>>a;
      cout<<a<<endl;
      continue;
    }

    for(int i=0;i<n;i++){
      std::string s;
      cin>>s;
      data.push_back(s);
    }
    data.push_back("");
    n++;
    if(data[0]=="+"){
      cout<<Add(1,1,n,data)<<endl;
    }else{
      cout<<Multi(1,1,n,data)<<endl;
    }
  }

  return 0;
}



Measured memory_bytes: 3152
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <numeric>
#include <string>
#include <cstring>
#include <cmath>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long int int64;


const int MOD = 998244353;
void sadd(int &a, int b)
{
    a += b;
    if (a >= MOD) a -= MOD;
}
int add(int a, int b)
{
    sadd(a, b);
    return a;
}
void ssub(int &a, int b)
{
    a -= b;
    if (a < 0) a += MOD;
}
int sub(int a, int b)
{
    ssub(a, b);
    return a;
}
int mul(int a, int b)
{
    return (a * 1LL * b) % MOD;
}

const int N = 105;
char str[N];

map <string, int> dp[2];

int solve(const string &s, bool sp = false)
{
 //   eprintf("%s %d\n", s.c_str(), sp);
    if (dp[sp].count(s) ) return dp[sp][s];

    if ((int) s.length() == 1)
    {
        int zeros = (s == "0");
        if (zeros) return dp[sp][s] = 1;
        return dp[sp][s] = 2;
    }
    int ans = 0;
   
    if (!sp)
    {
        for (int i = 1; i < (int) s.length(); i++)
        {
            string pref = s.substr(0, i), suff = s.substr(i);
            sadd(ans, mul(solve(pref, (i > 1) ), solve(suff) ) );
        }
    }
    for (int i = 1; i < (int) s.length(); i++)
    {
        if (((int) s.length() ) % i != 0) continue;
        string x = string(i, '1');
        for (int j = 0; j < (int) s.length(); j++)
        {
            if (s[j] == '0')
                x[j % i] = '0';
        }
        sadd(ans, solve(x) );
    }

 //   eprintf("%s %d : %d\n", s.c_str(), sp, ans);
    return dp[sp][s] = ans;
}


int main(int,  char **)
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

    scanf("%s", str);

    int ans = solve(string(str) );
    printf("%d\n", ans);



	return 0;
}



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

int a[100005];
int b[100005];
int c[100005];

int n;
int dp[100005][3] = {0};

int f(){


	dp[0][0] = a[0];
	dp[0][1] = b[0];
	dp[0][2] = c[0];

	for(int i=1;i<n;i++){
		
		int op1 = a[i] + max(dp[i-1][1],dp[i-1][2]);
		int op2 = b[i] + max(dp[i-1][2],dp[i-1][0]);
		int op3 = c[i] + max(dp[i-1][1],dp[i-1][0]);

		dp[i][0]=op1;
		dp[i][1]=op2;
		dp[i][2]=op3;

	}	

	int ans = max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
	return ans;
}


int main(){
#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
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i]>>b[i]>>c[i];


	cout<<f()<<endl;












}

Measured memory_bytes: 5976
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int sx[] = { 0, 0, 1, 0, -1 };
int sy[] = { 0, -1, 0, 1, 0 };
int mx[] = { 0, -1, 0, 1, 1, 1, 0, -1, -1 };
int my[] = { 0, -1, -1, -1, 0, 1, 1, 1, 0 };
int lx[] = { 0, -1, 0, 1, 1, 1, 0, -1, -1, 0, 2, 0, -2 };
int ly[] = { 0, -1, -1, -1, 0, 1, 1, 1, 0, -2, 0, 2, 0 };

int main() {
    int paper[10][10] = { 0 };
    int x, y, s, nx, ny;
    while (scanf("%d,%d,%d", &x, &y, &s) != EOF) {
        if (s == 1) {
            for (int i = 0; i < 5; i++) {
                nx = x + sx[i];
                ny = y + sy[i];
                if (nx < 0 || nx >= 10 || ny < 0 || ny >= 10) {
                    continue;
                }
                paper[ny][nx]++;
            }
        }
        else if (s == 2) {
            for (int i = 0; i < 9; i++) {
                nx = x + mx[i];
                ny = y + my[i];
                if (nx < 0 || nx >= 10 || ny < 0 || ny >= 10) {
                    continue;
                }
                paper[ny][nx]++;
            }
        }
        else {
            for (int i = 0; i < 13; i++) {
                nx = x + lx[i];
                ny = y + ly[i];
                if (nx < 0 || nx >= 10 || ny < 0 || ny >= 10) {
                    continue;
                }
                paper[ny][nx]++;
            }
        }
    }
    
    int none = 0, maxc = 0;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (paper[i][j] == 0) {
                none++;
            }
            maxc = max(maxc, paper[i][j]);
        }
    }
    cout << none << endl << maxc << endl;
    
    return 0;
}

Measured memory_bytes: 1208
#include<bits/stdc++.h>
using namespace std;
long long i,j,n,m,mas[200005],x,rez1,rez2,l,r,c;
int main()
{
    std::cin.sync_with_stdio(false);
    std::cin.tie(0);
    cin >> n;
    i=0;
    while (i<n)
    {
        cin >> mas[i];
        i++;
    }
    l=-1000000000;
    r=1000000000;
    while (l!=r)
    {
        c=l+(r-l)/2;
        i=0;
        rez1=0;
        while (i<n)
        {
            rez1+=abs(mas[i]-(c+i+1));
            i++;
        }
        rez2=0;
        i=0;
        while (i<n)
        {
            rez2+=abs(mas[i]-(c+i+2));
            i++;
        }
        //cout << l << " " << r << " " << c << " " << c+1 << " " << rez1 << " " << rez2 << "\n";
        if (rez1==rez2)
        {
            cout << rez1;
            return 0;
        }
        else if (rez1<rez2)
        {
            r=c;
        }
        else
        {
            l=c+1;
        }
    }
    cout << min(rez2,rez1);
    return 0;
}


Measured memory_bytes: 1792
#pragma GCC optimize("O3")
#pragma GCC target("avx")

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;
using llong = long long;

const llong mod = (llong)(1e9) + 7;
llong n;
char s[100005];
llong cnt[26];

int main() {
    scanf("%lld %s", &n, s);

    for (int i = 0; i < n; i++) {
        cnt[s[i] - 'a']++;
    }

    /*
    llong ans = 0;
    for (llong i = 1; i < (1 << 26); i++) {
        //bitset<26> b(i);
        llong b = i;
        llong tmp = 1;

        for (int j = 0; j < 26; j++) {
            if (b & 1) {
                tmp *= cnt[j];
                if (cnt[j] == 0) break;
                tmp %= mod;
            }
            b >>= 1;
        }

        ans += tmp;
        if (ans >= mod) ans -= mod;
    }
    */

    llong ans = 1;
    for (llong i = 0; i < 26; i++) {
        if (cnt[i]) ans *= (cnt[i] + 1);
        ans %= mod;
    }
    ans = (ans + mod - 1) % mod;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(i,v) for(auto &(i):(v))
#define eachr(i,v) for(auto &(i)=(v).rbegin();(i)!=(v).rend();(i)++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
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;}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;



int a, b, k;

signed main() {
	cin >> a >> b >> k;
	rep(i,k) {
		if (i%2==0) b += a/2, a /= 2;
		else a += b/2, b /= 2;
	}
	cout << a << ' ' << b << endl;
}

Measured memory_bytes: 256
#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 FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) std::sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define ALL(obj) (obj).begin(),(obj).end()

using namespace std;

const int INF = 99999999;
const ll LINF = 9999999999999;

typedef pair<int, int> P;
typedef pair<ll, ll> LP;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };



int main() {
	ll a, b, total=0;

	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	cin >> a>>b;
	for (int i = 1; i <= b - a-1; i++) {
		total += i;
	}
	total -= a;
	cout << total << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n;i++)
using namespace std;

int main(){
    string s;
    cin>>s;
    map<char,int>mp;
    rep(i,s.size()){
        mp[s[i]]++;
    }
    int cnt=0;
    for(auto itr:mp){
        if(itr.second%2)cnt++;
    }
    cout<<(cnt%2?(cnt-1)/2:cnt/2)<<endl;
}

Measured memory_bytes: 3196
# -*- coding: utf-8 -*-
#Python
import sys


N,M=list(map(int,raw_input().split()))
#print N
#print M

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

#隣接リスト
for i in range(M):
	x,y=list(map(int,raw_input().split()))
	#if x==1 and y==N:
	#	continue
	adj[x].append(y)
	adj[y].append(x)

#print adj

#訪問判別フラグ
F=(N+1)*[0]

#Stack
S=[]

#距離
dist=(N+1)*[0]

#先頭から深さ優先探索
S.append(1)
while len(S) != 0:
	#print S
	v=S.pop()
	#print "v:::"+str(v)
	
	if F[v]==0:
		F[v]=1
		#print F
		for u in adj[v]:
			#print "u::"+str(u)
			if F[u]==0:
				S.append(u)
				if dist[u] == 0:
					dist[u]=dist[v]+1
					#print S
					#print dist

#print dist

if dist[N]==2:
	print "POSSIBLE"
else:
	print "IMPOSSIBLE"


Measured memory_bytes: 46056
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
using namespace std;

const int inf=1e9;
int mini,n,cnt,xx;
int main()
{
	mini=inf;
	cnt=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>xx;
        cnt=cnt+xx;
        if(xx%10!=0&&xx<mini)
            mini=xx;
    }
    if(cnt%10!=0)
		cout<<cnt<<endl;
    else if(mini==inf)
		cout<<0<<endl;
    else cout<<cnt-mini;
    return 0;
}


Measured memory_bytes: 256
import sys
from collections import deque

def input():
  return sys.stdin.readline()

N,M=map(int,input().split())
L=[[] for _ in range(N)]
for _ in range(M):
  a,b=map(int,input().split())
  L[a-1].append(b)
  L[b-1].append(a)
A=[0]*N
a,b = N,0
d=deque([])
for l in L[0]:
  d.append((1,l))
while a>b:
  i,j=d.popleft()
  if A[j-1]==0:
    b+=1
    A[j-1]=i
    for l in L[j-1]:
      d.append((j,l))
if a==b:
  print("Yes")
  for i in range(1,N):
    print(A[i])
else:
  print("No")

Measured memory_bytes: 109620
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define nn '\n'
#define YES {cout<<"YES"<<'\n';}
#define NO {cout<<"NO"<<'\n';}
#define Yes {cout<<"Yes"<<'\n';}
#define No {cout<<"No"<<'\n';}
#define yes {cout<<"yes"<<'\n';}
#define no {cout<<"no"<<'\n';}
void YN(bool flg){cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg){cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#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 out(n) {cout << n << '\n';}
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    string s; cin >> s;
    string s_01 = s, s_10 = s; REP(i,s.size()){if(i%2==0){s_01[i]='0'; s_10[i]='1';}else{s_01[i]='1'; s_10[i]='0';}}
    int count_01 = 0 , count_10 = 0;
    REP(i,s.size()){
        if(s_01[i]!=s[i]) count_01++;
        if(s_10[i]!=s[i]) count_10++;
    }
    out(min(count_01,count_10));

    return 0;
}

Measured memory_bytes: 592
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

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 RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()
#define MOD 1000000007

int N, M;
ll S[2000], T[2000];
ll dp[2001][2001];

int main() {
    cin >> N >> M;
    REP(i, N) cin >> S[i];
    REP(i, M) cin >> T[i];

    REP(i, N) REP(j, M) {
        if (S[i] == T[j]) dp[i + 1][j + 1] = (dp[i][j + 1] + dp[i + 1][j] + 1) % MOD;
        else dp[i + 1][j + 1] = (dp[i][j + 1] + dp[i + 1][j] - dp[i][j] + MOD) % MOD;
    }
    cout << dp[N][M] + 1 << endl;
    return 0;
}

Measured memory_bytes: 31488
#include <bits/stdc++.h>
using namespace std;
int main(){
  cout << fixed << setprecision(10);
  int N, M;
  cin >> N >> M;
  vector<double> L(N), a(N), b(N);
  for (int i = 0; i < N; i++){
    cin >> L[i] >> a[i] >> b[i];
  }
  double ans = 0;
  for (int i = 0; i < (1 << N); i++){
    if (__builtin_popcount(i) == M){
      double sum = 0;
      for (int j = 0; j < N; j++){
        if (i >> j & 1){
          for (int k = j + 1; k < N; k++){
            if (i >> k & 1){
              sum += pow(L[k] - L[j], 2) + pow(a[k] - a[j], 2) + pow(b[k] - b[j], 2);
            }
          }
        }
      }
      ans = max(ans, sum);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3288
N, K = map(int, input().split())
X = list(map(int, input().split()))

cand = []

for i in range(N - K + 1):
    cand.append(min(abs(X[i]), abs(X[i + K - 1])) + abs(X[i + K - 1] - X[i]))

print(min(cand))


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

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

	int N;
	cin >> N;
	if (N % 2) {
		cout << N * 2 << endl;
		return 0;
	}
	else {
		cout << N << endl;
		return 0;
	}
}

Measured memory_bytes: 256