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

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("Ofast")

using namespace std;
using ll = long long;

// MACRO
// for loop
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)

// for vector
#define ALL(x) x.begin(), x.end()
#define SIZE(x) ll(x.size())
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort(ALL(x), greater<int>())
#define RSORTS(x) sort(ALL(x), greater<string>())
#define FIND(x, n) find(ALL(x), n)
#define VFOR(e, x) for (auto &e : x)

// Constant
const ll INF = 1000000000000; // 10^12:  ∞
const int MOD = 1000000007;   // 10^9+7: Congruence ceremony MOD
const int MAXR = 100000;      // 10^5:   Array Max Range
const char EL = '\n';         // newline

// alias
#define EB emplace_back // push as last element
#define PP pop_back     // pop last element
#define MP make_pair    // pair constractor
#define F first         // first element of pair
#define S second        // second element of pair

// change max/min
template <class T>
bool chmax(T &a, const T &b)
{
  if (a < b)
  {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
  if (b < a)
  {
    a = b;
    return 1;
  }
  return 0;
}

// optimize in/out
#define OPTIMIZE_CIN_COUT() \
  cin.tie(0);               \
  ios::sync_with_stdio(false);

template <typename... Args>
void input(Args... args)
{
  for (int &e : {args...})
  {
    cin >> e;
  }
}
#define INPUT1(a) \
  int a = 0;      \
  cin >> a;
#define INPUT2(a, b) \
  int a = 0;         \
  int b = 0;         \
  cin >> a >> b;
#define INPUT3(a, b, c) \
  int a = 0;            \
  int b = 0;            \
  int c = 0;            \
  cin >> a >> b >> c;
#define INPUT4(a, b, c, d) \
  ll a = 0;                \
  ll b = 0;                \
  ll c = 0;                \
  ll d = 0;                \
  cin >> a >> b >> c >> d;
#define INPUTS(s) \
  string s = "";  \
  cin >> s;

#define INPUTA(n, a) \
  int n = 0;         \
  cin >> n;          \
  vector<int> a(n);  \
  REP(i, n)          \
  {                  \
    cin >> a[i];     \
  }
#define INPUTB(x, y, b)                     \
  int x = 0, y = 0;                         \
  cin >> x >> y;                            \
  vector<vector<int>> b(y, vector<int>(x)); \
  REP(i, y)                                 \
  {                                         \
    REP(j, x)                               \
    {                                       \
      cin >> b[i][j];                       \
    }                                       \
  }

int main()
{
  OPTIMIZE_CIN_COUT();

  // INPUT2(A, B);
  INPUT4(A, B, C, D);

  ll a1 = A * C;
  ll a2 = A * D;
  ll a3 = B * C;
  ll a4 = B * D;

  cout << max(a1, max(a2, max(a3, a4)));
  // INPUTS(S);
  // INPUTA(N, A);
  // INPUTB(X, Y, B);
}


Measured memory_bytes: 3644
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    int N; cin >> N;
    vector<char> A(N), B(N);
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> B[i];
    ll dp[55];
    rep(i, N) {
        if(A[i] == B[i]) {
            if(i == 0) {
                dp[i] = 3; continue;
            }
            if(A[i - 1] == B[i - 1]) dp[i] = dp[i - 1] * 2;
            if(A[i - 1] != B[i - 1]) dp[i] = dp[i - 1];
        } else {
            if(i == 0) {
                dp[i] = 6; continue;
            }
            if(A[i - 1] == B[i - 1]) dp[i] = dp[i - 1] * 2;
            if(A[i - 1] != B[i - 1]) {
                if(A[i - 1] == A[i]) {
                    dp[i] = dp[i - 1];
                } else {
                    dp[i] = dp[i - 1] * 3;
                }
            }
        }
        dp[i] %= mod;
    }
    cout << dp[N - 1] << endl;
	return 0;
}

Measured memory_bytes: 256
n, m = map(int,input().split())
ks = [list(map(int,input().split())) for _ in range(m)]
p = list(map(int,input().split()))

ans = 0
for i in range(2 ** n):
    on = [False] * n
    for j in range(n):
        if ((i>>j) & 1):
            on[n - j - 1] = True
    g = 0
    for j in range(m):
        c = 0
        for s in range(1,len(ks[j])):
            if on[ks[j][s]-1]:
                c += 1
        if c % 2 == p[j]:
            g += 1
    if g == m:
        ans += 1
print(ans)

Measured memory_bytes: 43376
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	var wk []int

	for i := 0; i < n; i++ {
		var in int
		fmt.Scan(&in)
		wk = append(wk, in)
	}

	var res = abc088B(n, wk)
	fmt.Println(res)
}

func abc088B(n int, wk []int) int {
	var res = 0
	sort.Sort(sort.Reverse(sort.IntSlice(wk)))

	var alice = 0
	var bob = 0
	for i := 0; i < n; i++ {
		if i%2 == 0 {
			alice += wk[i]
		} else {
			bob += wk[i]
		}
	}

	res = alice - bob
	return res
}


Measured memory_bytes: 512
use std::io;
use std::io::prelude::*;
use std::io::BufReader;
use std::str::FromStr;

fn read_vec<T: FromStr>(s: String) -> Result<Vec<T>, T::Err> {
    s.split(' ').map(|x| x.parse()).collect()
}

fn main() {
    const M: i64 = 1000_000_000 + 7;
    let mut lines = BufReader::new(io::stdin()).lines().map(|l| l.unwrap());
    let nk: Vec<usize> = read_vec(lines.next().unwrap()).unwrap();
    let mut v: Vec<i64> = read_vec(lines.next().unwrap()).unwrap();
    let mut P: Vec<_> = v.iter().filter(|&&x| x > 0).collect();
    let mut N: Vec<_> = v.iter().filter(|&&x| x < 0).map(|x| -x).collect();
    P.sort_unstable();
    N.sort_unstable();
    // kをなるべくPで埋めて、あまりを2の倍数に切り上げて、それがNより少ない時
    let can_positive = if P.len() == 0 {
        nk[1] & 1 == 0 && nk[1] <= N.len() // Pがゼロ個なら、kが偶数で、Nはkより多い必要がある
    } else if nk[1] > P.len() {
        // Pが1つ以上あって、kより少ない時
        (nk[1] - P.len() + 1) & !1 <= N.len() // Pが一つ以上あれば、k-Pを2の倍数に切り上げた数より、Nが多い必要がある
    } else {
        true
    };
    if !can_positive {
        if v.contains(&0) {
            // ゼロにできる時
            println!("0");
        } else {
            // 負の数になる時
            v.sort_unstable_by_key(|x| {
                let y = x >> 31;
                (x ^ y) - y
            });
            let ans = v
                .iter()
                .take(nk[1]) // 小さい方から集めて
                .fold(1, |acc, x| acc * (x % M) % M);
            println!("{}", (ans + M) % M);
        }
        return;
    }
    let mut ans = 1;
    let mut k = nk[1];
    if k & 1 == 1 {
        ans *= P.pop().unwrap();
        k -= 1;
    }
    let a = P.pop();
    let b = P.pop();
    let mut ab = a.and_then(|a| b.map(|b| a * b));
    let c = N.pop();
    let d = N.pop();
    let mut cd = c.and_then(|c| d.map(|d| c * d));
    loop {
        if k == 0 {
            break;
        }
        let pn = match ab {
            Some(ab) => match cd {
                Some(cd) => ab > cd,
                _ => true,
            },
            None => false,
        };
        if pn {
            ans *= ab.unwrap() % M;
            ans %= M;
            let a = P.pop();
            let b = P.pop();
            ab = a.and_then(|a| b.map(|b| a * b));
        } else {
            ans *= cd.unwrap() % M;
            ans %= M;
            let c = N.pop();
            let d = N.pop();
            cd = c.and_then(|c| d.map(|d| c * d));
        }
        k -= 2;
    }
    println!("{}", (ans + M) % M);
}

Measured memory_bytes: 6068
N, Q = map(int, input().split())
s = input()
t = [0 for _ in range(N + 1)]
for i in range(N):
    t[i + 1] = t[i] + (1 if s[i:i + 2] == 'AC' else 0)

for _ in range(Q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])


Measured memory_bytes: 9308
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<_>>()
    };

    ($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")
    };
}

fn main() {
    input! {
        n: usize,
        txy: [(i64, i64, i64); n],
    }
    let mut txy = txy;
    txy.insert(0, (0, 0, 0));
    if txy.windows(2).all(|p| {
        let target = p[1].0 - p[0].0 - (p[1].1 - p[0].1).abs() - (p[1].2 - p[0].2).abs();
        target >= 0 && target % 2 == 0
    }) {
        println!("Yes");
    } else {
        println!("No");
    }
}


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

#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif // LOCAL_
#define dumpi(x1) fprintf(stderr, "#%s.%d (%s) = (%d)\n", __func__, __LINE__, #x1, x1);
#define dumpii(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%d, %d)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumpiii(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%d, %d, %d)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);
#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);
#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);
#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);

struct S002 {
  int n;
  S002& operator > (long& x) {
    n = x;
    return *this;
  }
  S002& operator >= (long& x) {
    if( scanf("%ld", &x) <= 0 ) exit(0);
    return *this;
  }
  S002& operator >= (double& x) {
    if( scanf("%lf", &x) <= 0 ) exit(0);
    return *this;
  }
  S002& operator >= (std::string& s) {
    if( not (std::cin >> s) ) exit(0);
    return *this;
  }
  template<typename a>
  S002& operator >= (std::vector<a>& v) {
    v.resize(n);
    for(long i = 0; i < n; ++i) {
      *this >= v[i];
    }
    return *this;
  }
};

struct Solver {
  long n, c, k;
  std::vector<long> xs;
  Solver() {
    S002 r;
    r >= n >= c >= k >n>= xs;
  }
  void solve() {
    std::sort(xs.begin(), xs.end());
    long t = xs[0];
    long p = 0;
    int i = 0;
    long res = 0;
    for(;;) {
      t = xs[i];
      int j = i;
      while( (i + 1) < n and (xs[i+1] <= t + k) and (i + 1 - j + 1 <= c) ) i += 1;
      res += 1;
      // dumpi(i);
      i += 1;
      if( i >= n ) break;
    }
    printf("%ld\n", res);
  }  
};

int main() {
  for(;;) std::unique_ptr<Solver>(new Solver())->solve();
  return 0;
}

Measured memory_bytes: 1024
// #pragma GCC target("avx2")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
}
// ここから編集しろ
int p[110000];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",p+i);
	int ret=0;
	for(int i=1;i<=30;i++){
		bool on=false;
		for(int j=0;j<a;j++){
			if(p[j]<=(1<<(i-1))){
				on=false;
			}else{
				if(p[j]>=(1<<i)){
					if(!on){
						on=true;ret++;
					}
				}else{
					if(on){
						on=false;
					}else{
						on=true;ret++;
					}
				}
			}
		}
	}
	printf("%d\n",ret);
}

Measured memory_bytes: 512
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define dbg(x) { cerr<<"> "<<#x<<": "<<x<< endl; }
#define dbg2(x,y) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
const int inf = INT_MAX;
const double eps = 0.0000001;
const double PI = acos(-1.0);
const int MOD = 1e9+7;
const int N  = 1e3+5;

char a[N][N];
int dp[N][N], ready[N][N];

int solve (int i, int j) {
	if (a[i][j] == '#') return 0;
	if (i == 1 && j == 1) return 1;
	if (i < 1 || j < 1) return 0;
	if (ready[i][j]) return dp[i][j];
	dp[i][j] = (solve(i-1, j) + solve(i,j -1))%MOD;
	ready[i][j] = 1;
	return dp[i][j];
}

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

    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
    	for (int j = 1; j <= m; j++) {
    		cin >> a[i][j];
    	}
    }
    cout << solve(n, m);
    return 0;
}


Measured memory_bytes: 17152
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[1000];
    long long int x,i;
    cin>>s;
    x=strlen(s);
    for(i=0;i<x;i++)
    {
        cout<<"x";
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 256
n, m = [int(i) for i in input().split()]
ts = []
a_s = [int(i) for i in input().split()]
for a in a_s:
    ts.append((1, a))
for i in range(m):
    b, c = [int(i) for i in input().split()]
    ts.append((b, c))

ts = sorted(ts, key=lambda x: x[1], reverse=True)

ans = 0
num = 0
for b, c in ts:
    if num >= n:
        break
    remain = n - num
    ans += min(remain, b) * c
    num += b
print(ans)

Measured memory_bytes: 34040
from collections import Counter

N = int(input())
A = list(map(int, input().split()))
max_a = max(A)

A.sort()

count = Counter(A)

divisible = [False] * (max_a + 1)

ans = 0

for a in A:
    if divisible[a]:
        continue
    for i in range(1, max_a // a + 1):
        divisible[i * a] = True
    if count[a] == 1:
        ans += 1
print(ans)




Measured memory_bytes: 133448
package main

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

func main() {
	sc.Split(bufio.ScanWords)

	var n, q int
	fmt.Scan(&n, &q)
	m := make([][]int, n)
	for i := 0; i < n-1; i++ {
		a := nextInt() - 1
		b := nextInt() - 1
		m[a] = append(m[a], b)
		m[b] = append(m[b], a)
	}
	qs := make([]int, n)
	for i := 0; i < q; i++ {
		p := nextInt() - 1
		x := nextInt()
		qs[p] += x
	}

	counts := make([]int, n)
	var dfs func(i, cnt, par int)
	dfs = func(i, cnt, par int) {
		counts[i] = qs[i] + cnt
		for _, ni := range m[i] {
			if ni != par {
				dfs(ni, counts[i], i)
			}
		}
	}
	dfs(0, 0, 0)

	fmt.Println(strings.Trim(fmt.Sprint(counts), "[]"))
}

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}


Measured memory_bytes: 79872
#include <iostream> 
#include <numeric> 
#include <cstdlib> 
#include <climits> 
#include <cmath> 
#include <cstdio> 
#include <cfloat> 
#include <map> 
#include <utility> 
#include <cassert>
#include <set> 
#include <memory> 
#include <algorithm> 
#include <functional> 
#include <sstream> 
#include <complex> 
#include <iomanip>
#include <stack> 
#include <queue> 
#include <string> 
#include <vector> 
using namespace std; 

#define rep(i, n) for(int i = 0; i < n; i++) 
#define rep2(i, m, n) for(int i = m; i < n; i++) 
const double EPS = 1E-10; 
typedef long long ll; 
typedef pair<int, int> P; 
typedef pair<int, P> PP; 
typedef complex<double> xy_t; 
const int INF = 1 << 30; 

double cross(xy_t a, xy_t b){
  return imag(conj(a) * b);
}

double dot(xy_t a, xy_t b){
  return real(conj(a) * b);
}

xy_t A, B, C;

double limit;
xy_t r1, r2[2];
double db, dc;

void setR(xy_t s, xy_t p0, xy_t p1, double R){
  xy_t p = p0 - s;
  xy_t q = p1 - s;
  p /= abs(p);
  q /= abs(q);
  xy_t r = p + q;
  r /= abs(r);
  double d = abs(cross(r, p));
  r1 = s + r * (R / d);
  
}

double getR2(xy_t s, xy_t p0, xy_t p1, double R, int id){
  xy_t p = p0 - s;
  xy_t q = p1 - s;
  p /= abs(p);
  q /= abs(q);
  xy_t r = p + q;
  r /= abs(r);
  double d = abs(cross(r, p));


  double ub = limit;
  double lb = 0;
  
  for(int i = 0; i < 100; i++){
    double mb = (ub + lb) / 2.0;
    r2[id] = s + r * (mb / d);
    if(abs(r2[id] - r1) > mb + R) lb = mb;
    else ub = mb;
  }
 
  return lb;
}

bool ok(double mb){
  
  setR(A, B, C , mb);
  db = getR2(B, A, C, mb, 0);
  dc = getR2(C, A, B, mb, 1);
  //  cout << (b + c) << " " << abs(r2[0] - r2[1]) << endl;
  return (db + dc) > abs(r2[0] - r2[1]);
}

int main(){
  int a, b, c, d, e, f;
  while(cin >> a >> b >> c >> d >> e >> f && (a || b || c || d || e || f)){
    A = xy_t(a, b);
    B = xy_t(c, d);
    C = xy_t(e, f);

    double S = abs(cross(B - A, C - A)) / 2.0;
    limit = S * 2 / (abs(B - A) + abs(C - A) + abs(C - B));
  
    double ub = limit;
    double lb = 0;
    rep(i, 100){
      double mb = (ub + lb) / 2.0;
      if(ok(mb)) lb = mb;
      else ub = mb;
    }
    cout << fixed << setprecision(9) << lb << " " << db << " " << dc << endl;
    
  }
  return 0;
}

Measured memory_bytes: 0
using System;


namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var A = Console.ReadLine().Split(' ');
           
            int W = int.Parse(A[0]);
            int H = int.Parse(A[1]);
            int x = int.Parse(A[2]);
            int y = int.Parse(A[3]);
            int r = int.Parse(A[4]);
            if(y-r>=0&&x-r>=0&&x>=0&&y>=0&&x+r<=W&&y+r<=H)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
            
        }
    }
}

Measured memory_bytes: 8996
#include <iostream>
using namespace std; 
int main(){
    ios::sync_with_stdio(false);
    int iLeft1, iLeft2, iRight1, iRight2; 
    cin >> iLeft1 >> iLeft2 >> iRight1 >> iRight2; 
    if (iLeft1 + iLeft2 > iRight1 + iRight2) 
        cout << "Left\n"; 
    else if (iLeft1 + iLeft2 == iRight1 + iRight2) 
        cout << "Balanced\n"; 
    else 
        cout << "Right\n"; 
    return 0; 
}

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

int main(){
	int n; cin >> n;
	string s; cin >> s;

	int ans = 0;
	for(int i = 1; i < n; ++i){
		int cnt = 0;
		for(char c = 'a'; c <= 'z'; c++){
			bool left = false, right = false;
			for(int j = 0; j < i; ++j){
				if(s[j] == c) left = true;
			}
			for(int j = i; j < n; ++j){
				if(s[j] == c) right = true;
			}
			if(left && right) cnt++;
		}
		ans = max(ans, cnt);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int loc1=12321,loc2=-1;
    for(int i=0;i<s.size();i++)
        if(s[i]=='C')
        {
            loc1=i;
            break;
        }
    for(int i=s.size()-1;i>=0;i--)
        if(s[i]=='F')
        {
            loc2=i;
            break;
        }
    if(loc2>loc1)
        cout<<"Yes\n";
    else 
        cout<<"No\n";
    return 0;
}


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

string shuffle(string str, int h){
	string head = str.substr(0, h);
	string tail = str.substr(h, str.size() - h);
	return tail + head;
}

int main()
{
	string cards;
	int m, h;

	while (1){
		cin >> cards;
		if (cards == "-") break;

		cin >> m; 
		for (int i = 0; i < m; i++){
			cin >> h;
			cards = shuffle(cards, h);
		}
		cout << cards << endl;
	}
	return 0;
}

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

using namespace std;
typedef long long LL;
typedef pair<int,int> P;
const int Max_Num=1e5+10;
const int INF=1e9;

int main(){
	int N, M;
	cin >> N >> M;
	vector<vector<int>> G(N);
	rep(i,M){
		int A, B;
		cin >> A >> B;
		A--; B--;
		G[A].emplace_back(B);
		G[B].emplace_back(A);
	}
	vector<int> ans(N), dist(N,INF);
	dist[0]=0;
	queue<int> q;
	q.push(0);
	while(!q.empty()){
		int n=q.front(); q.pop();
		rep(i,G[n].size()){
			int next=G[n][i];
			if(dist[next]!=INF) continue;
			q.push(next);
			dist[next]=dist[n]+1;
			ans[next]=n+1;
		}
	}
	cout << "Yes" << endl;
	rep(i,N-1) cout << ans[i+1] << endl;

	return 0;
}

Measured memory_bytes: 10724
#if 1
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <functional>
#include <set>
#include <numeric>

using namespace std;
#define int long long
constexpr int MOD = 1000000007;
constexpr int INF = 1145141919810;

#define LOADVEC(type,name,N) std::vector<type>name(N); \
for (int nnn = 0; nnn < N; ++nnn) { \
	cin >> name[nnn]; \
}

#define LOADVEC2(type,name0,name1,N) std::vector<type>name0(N),name1(N); \
for (int nnn = 0; nnn < N; ++nnn) { \
	cin >> name0[nnn];cin >> name1[nnn]; \
}

#define LOAD(type,name) type name; \
cin >> name;



signed main() {
	ios::sync_with_stdio(false);
	LOAD(int, N);
	LOADVEC(int, C0, N);
	std::vector<int>C;
	C.reserve(N);
	int last = -1;
	for (int i = 0; i < N; ++i) {
		if (last != C0[i])C.push_back(C0[i]);
		last = C0[i];
	}
	std::vector<int>res(C.size());
	std::vector<int> lastColor(300000, -1);
	int lastColor2 = -1;
	res[0] = 1;
	lastColor[C[0]] = 0;
	for (int i = 1; i < C.size(); ++i) {
		if (lastColor[C[i]] == -1) {
			res[i] = res[i - 1];
		}
		else {
			res[i] = res[i - 1] + res[lastColor[C[i]]];
			res[i] %= MOD;
		}
		lastColor[C[i]] = i;
	}
	cout << res.back();
	return 0;
}
#endif


Measured memory_bytes: 7296
#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int A=0 ,B=0;
	
	scanf("%d %d", &A, &B);
	
	int C = A-B;
	
	if(A-B > 0){
		printf("%d" , 2 * A - 1);
	}
	
	else if(A-B < 0){
		printf("%d", 2 * B - 1);
	}
	
	else{
		printf("%d", 2 * A);
	}
	
	
	return 0;
}


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

using namespace std;

int main()


{

    int n;
    cin >> n;
    //int c =0;
    if(n %4 == 0)
        cout << "Yes";
    else if(n%7 == 0)
        cout << "Yes";
    else {

            int c = 0;
        for(int i = 1; i<=25;++i)
        {
            for(int j = 1; j<=14;++j)
            {
                if(4*i + 7*j == n)
                    c = 1;
            }
        }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int lli;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef pair <lli,lli> pii;
#define ff first
#define ss second
#define MOD 1000000007
#define pb push_back
#define EPS 1e-6
 
 
 
int main()
{
    fast;
    lli n;
    cin>>n;
    vector<lli> v(n);
    for(lli i=0; i<n; i++) cin>>v[i];
    sort(v.begin(), v.end());
    lli ans=0;
    for(lli i=0; i<n; i++){
        
        for(lli j=i+1; j<n; j++){
            
            lli idx= lower_bound(v.begin(), v.end(), v[i]+v[j])-v.begin() -1;
            ans+=(idx-j);
        }
    }
    //ans/=3;
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;

int main() {
    int N;
    cin >> N;
    vector<vector<int>> G(N, vector<int>());
    vector<pll> H;
    map<pll, int> hen;
    map<ll, ll> ma;
    vector<ll> c(N);
    rep(i, N - 1) {
        ll a, b;
        cin >> a >> b;
        a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    rep(i, N) { cin >> c[i]; }

    sort(all(c), greater<ll>());
    queue<int> que;
    vector<ll> d(N, -1);
    int cur = 0;
    ll ans = 0;
    que.push(0);
    d[0] = c[cur];
    while (!que.empty()) {
        int v = que.front(); // キューから先頭頂点を取り出す
        que.pop();

        // v から辿れる頂点をすべて調べる
        for (int nv : G[v]) {
            if (d[nv] != -1)
                continue; // すでに発見済みの頂点は探索しない

            // 新たな白色頂点 nv について距離情報を更新してキューに追加する
            d[nv] = c[cur + 1];
            ans += d[nv];
            que.push(nv);
            cur++;
        }
    }

    cout << ans << endl;
    rep(i, N) { cout << d[i] << " "; }
}

Measured memory_bytes: 4080
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    K = I()
    s = S()

    if len(s)<=K:
        print(s)
    else:
        print(s[:K]+'...')

if __name__ == '__main__':
    resolve()

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


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    vector<int>ans(s.length());

    //for(int i=0;i<a.size();i++) cout<<a[i]<<' '<<endl;
 //cout<<s.length()<<endl;

    int ri,eni, sti=0,siz=0,lsiz=0;
    for(int i=0;i<s.length();i++)
    {

        if(s[i]=='R' && s[i+1]=='L')
            {
                ri=i;
                //cout<<ri<<endl;;
                while(s[i+1]=='L')
                {
                    i++;
                }
                eni=i;
                //cout<<sti<<' '<<eni<<endl;
                siz=eni-sti+1;
                lsiz=ri-sti;

                //cout<<lsiz<<' '<<siz<<endl;
                if(siz%2==0)
                {
                    ans[ri]=siz/2;
                    ans[ri+1]=ans[ri];
                    //cout<<siz<<endl;
                }
                else
                {
                    if(lsiz%2==0 && (siz-lsiz-2)%2!=0)
                    {
                        ans[ri]=(siz/2)+1;
                        ans[ri+1]=ans[ri]-1;
                    }
                    else
                    {
                        ans[ri+1]=(siz/2)+1;
                        ans[ri]=ans[ri+1]-1;
                    }
                }
                sti=i+1;

            }
    }
    for(int i=0;i<ans.size();i++) cout<<ans[i]<<' ';

    return 0;
}


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

int main() {
  int n;
  cin >>n;
  
  vector<char> s(n);
  for (int i=0; i<n; i++) cin >> s.at(i);
  
  int red=0;
  int blue=0;
  
  for (int i=0; i<n; i++) {
    if (s.at(i) == 'R') red++;
    else if (s.at(i) == 'B') blue++;
  }
  
  if (red > blue) cout <<"Yes";
  else cout <<"No";
  
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<bits/stdc++.h>
#define ll long long
#define fast_io cin.tie(0);cout.tie(0);ios::sync_with_stdio(0)
#define MOD 1000000007
using namespace std;

int main(){
	fast_io;
	string s;
	cin>>s;
	for(int i=0;i<s.length()-1;i++){
        if(s[i]==s[i+1]){
            cout<<"Bad";
            return 0;
        }
	}
	cout<<"Good";
	return 0;
}


Measured memory_bytes: 256
X,Y = map(int, input().split())
mod = 10**9 + 7

def nCk(n,k,p):
    fact    = [1,1] + [0]*(n-1)
    inv     = [0,1] + [0]*(n-1)
    factinv = [1,1] + [0]*(n-1)
    
    for i in range(2, n+1):
        fact[i] = i * fact[i-1] % p
        inv[i] = - inv[p % i] * (p // i) % p
        factinv[i] = factinv[i-1] * inv[i] % p
    
    return fact[n] * factinv[k] * factinv[n-k] % p

ans = 0
if (X + Y) % 3 == 0 and X <= 2*Y and Y <= 2*X:
    a = (2*Y - X) // 3
    b = (2*X - Y) // 3
    ans = nCk(a+b, a, mod)
print(ans)

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

using namespace std;

#define IO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define ull unsigned long long int

const int INF = 1e9 + 7;
const int N = 1e5+5;


int main() {

	IO;

	ll a, b;
	char c;
	cin >> a >> c >> b;
	
	if (c == '+') 
		cout << a + b;
	else 
		cout << a - b;
}


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

#define ll long long
#define ar array

const int MOD=1e9+7;
int n, a[21][21], dp[1<<21];

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

	cin >> n;
	for (int i=0; i<n; ++i) for (int j=0; j<n; ++j) cin >> a[i][j];
	dp[0]=1;
	for (int mask=0; mask<(1<<n); ++mask) {
		int k=__builtin_popcount(mask); //we are on kth man with mask (women) taken
		for (int j=0; j<n; ++j)
			if (!(mask&(1<<j))&&a[k][j])
				dp[mask|(1<<j)]=(dp[mask|(1<<j)]+dp[mask])%MOD;
	}
	cout << dp[(1<<n)-1];
	return 0;
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
*/


Measured memory_bytes: 11812
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef complex <double> cp;
#define debug(a) cout<<#a<<":"<<a<<endl;
#define fr freopen("in.txt","r",stdin);
#define Fill(x,a) memset(x,a,sizeof(x))
#define cpy(a,b) memcpy(a,b,sizeof(a))
const double PI = acos(-1);
const ll INF=0x3f3f3f3f;
const ll N=1e6+7;
const ll mod=1e9+7;
ll maxn,minn;
ll T,n,m,q;
ll sum[N];
ll arr[N];

int main(){
	cin >> n;
	for(ll i = 1; i <= n; i ++ ){
		scanf("%lld", arr + i);
	}
	sum[n + 1] = 0;
	for(ll i = n; i >= 1; i -- ){
		sum[i] = (sum[i + 1] + arr[i] ) % mod;
	}
	ll ans = 0;
	for(ll i = 1; i <= n; i ++ ){
		ans = (ans + sum[i + 1] * arr[i] % mod ) % mod ;
	}
	cout << ans << endl;
	



	return 0;
}



Measured memory_bytes: 6860
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int, int>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define FILLINF(a) memset(a, 0x3f, sizeof(a))
#define POW(n) (1LL << (n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i, a, b) ((a) <= (i) && (i) <= (b))
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a > b) { a = b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a < b) { a = b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(begin(a), end(a)); }
template <typename T> inline void REV(T& a) { reverse(begin(a), end(a)); }
template <typename T> inline void UNI(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <typename S, typename T> inline T LB(S& v, T a) { return *lower_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int LBP(S& v, T a) { return lower_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> inline T UB(S& v, T a) { return *upper_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int UBP(S& v, T a) { return upper_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> ostream& operator << (ostream& os, const pair<S, T>& p) { os << p.first << " " << p.second; return os; }
template <typename S, typename T> istream& operator >> (istream& is, pair<S, T>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator << (ostream& os, const vector<T>& v) { for (int i = 0; i < v.size(); ++i) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator >> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for(auto &e : t) fill_v(e, v); }
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const lint MOD = 1000000007;

void _main() {
    int K, X;
    cin >> K >> X;
    cout << (500 * K >= X ? "Yes" : "No") << endl;
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i')) freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o')) freopen("output.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 256
N,M = map(int,input().split())
A = [[] for i in range(N+1)]
B = []
d = {}
for i in range(M):
    p,y = map(int,input().split())
    B.append((p,y))
    A[p].append(y)
for i in range(N+1):
    A[i].sort()
    n = len(A[i])
    for j in range(n):
        d[A[i][j]] = j+1
for i in range(M):
    p,y = B[i]
    q = d[y]
    m = 6 - len(str(p))
    n = 6 - len(str(q))
    ans = "0"*m + str(p) + "0"*n + str(q)
    print(ans)


Measured memory_bytes: 37548
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;
const int MOD = 1000000007;
int main(){
	int n;
	cin >> n;
	vector<vector<int>> e(n,vector<int>(n));
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++)cin >> e[i][j];
	}

	ll ans = 0;
	for(int i = 0;i < n-1;i++){
		for(int j = i+1;j < n;j++){
			bool flag = true;
			for(int k = 0;k < n;k++){
				if(i != k && k != j){
					if(e[i][k] + e[k][j] < e[i][j]){
						cout << -1 << endl;
						return 0;
					}
					else if(e[i][k] + e[k][j] == e[i][j]){
						flag = false;
					}
				}
			}
			if(flag)ans += e[i][j];
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>

using namespace std;

#define M_MAX 20
#define N_MAX 50000
#define INFTY 1 << 29

int main(){
    int n,m;
    int coin[21];
    int T[N_MAX + 1];
    
    cin >> n >> m;
    // コインに額面を代入する
    for(int i = 1;i <= m;++i){
        cin >> coin[i];
    }
    
    // 最大値で初期化
    for(int i = 0;i < N_MAX;++i){
        T[i] = INFTY;
    }
    T[0] = 0;
    for(int i = 1;i <= m;++i){
        for(int j = 0;j + coin[i] <= n;++j){
            T[j + coin[i]] = min(T[j + coin[i]],T[j] + 1);
        }
    }
    cout << T[n] << endl;
    return 0;
}


Measured memory_bytes: 3308
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
//#pragma comment(linker, "/stack:200000000")

using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
//#define ipq priority_queue<ll, vector<ll>, greater<ll> >
//#define dpq priority_queue<ll>
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()
//#define PQ(type) priority_queue<type>
//#define PQD(type) priority_queue<type,vector<type>,greater<type> >
//#define umap unordered_map<ll,ll> 
//#define vpair vector<pair<ll,ll>>
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
ll mod=1e9+7;

int main()
{
    
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a[100],b[100],i,j,k;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i];
        b[i]=a[i];
    }
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            swap(b[i],b[j]);
            if(is_sorted(b,b+n)){
                cout<<"YES";
                return 0;
            }
            swap(b[i],b[j]);
        }
    }
    
        cout<<"NO";
    
    
}

Measured memory_bytes: 256
n = int(input())
s = input()
cnt = []
c_new = 'a'

for i in range( len(s) ):
  #s[i] += n
  c = s[i]
  if( ord(c) + n <= ord("Z") ):
    c_new = chr(ord(c) + n)
  else:
    c_new = chr(ord(c) + n - 26)
  cnt += c_new

print(''.join(cnt))

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

int main(){
    int N;
    cin >> N;
    vector<ll> A(N), B(N);
    for (int i = 0; i < N; i++) cin >> A[i] >> B[i];
    ll ans = 0;
    for (int i = N-1; i >= 0; i--) {
        A[i] += ans;
        if (A[i] % B[i]) ans += B[i] - A[i] % B[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#pragma GCC optimze("Ofast")
#include <bits/stdc++.h>

using namespace std;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
# define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
//mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1000000007;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef map<int, int> mii;
typedef set<int> si;
typedef queue<int> qi;


const int N = 2e5 + 5;



void solve() {

	int a, b;
	double c;
	cin >> a >> c;
	b = (int)round(100 * c);
	cout << a * b / 100 << endl;
}


signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//srand(chrono::high_resolution_clock::now().time_since_epoch().count());
	cout << fixed << setprecision(15);
	int t = 1;
	//cin >> t;

	while (t--)
		solve();
#ifdef aa
	cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


int norm(int a) {
	while (a >= mod) a -= mod;
	while (a < 0) a += mod;
	return a;
}

int powm(int a, int b) {
	int res = 1;
	while (b) {
		if (b & 1)
			res = (res * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return res;
}


int divide(int a, int b) {
	return (a % mod) * powm(b, mod - 2) % mod;
}


Measured memory_bytes: 3748
#include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	long long int n,k;
    	cin>>n>>k;
    	if(n==0)
    	cout<<0<<endl;
    	else if(k==0)
    	cout<<n<<endl;
    	else if(n>=k)
    	{
    		
    		cout<<min(n%k,k-(n%k))<<endl;
    	}
    	else if(n<k)
    	cout<<min(n,k-n)<<endl;
    	return 0;
    }


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  int N,M;
  cin>>N>>M;
  vector<int[3]> A(N);
  for(int i=0;i<N;i++)cin>>A[i][0]>>A[i][1]>>A[i][2];
  int ans=0;
  for(int bit=0;bit<8;bit++){
    vector<int> B(N,0);
    for(int i=0;i<N;i++)
      for(int j=0;j<3;j++){
        if((bit>>j)&1)B[i]+=A[i][j];
        else B[i]-=A[i][j];
      }
    sort(B.rbegin(),B.rend());
    int cnt=0;
    for(int i=0;i<M;i++)cnt+=B[i];
    ans=max(ans,cnt);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
int main (){
	int now=1;
	int n;scanf ("%d",&n);
	for (int i=1;i<=n;i++){
		int x;scanf ("%d",&x);
		if (x==now) now++;
	}
	printf ("%d",now==1?-1:n-now+1);
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int a,b,c;
int main(){
  cin>>a>>b>>c;
  if(a==5){
	if(b==5||b==7){
		if(b+c==12){
			cout << "YES" << endl;
          	return 0;
        }
    }
  }else if(a==7){
	if(b==c&&c==5){
		cout << "YES" << endl;
      	return 0;
    }
  }
  cout << "NO" << endl;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) container.begin(), container.end()
#define RALL(container) container.rbegin(), container.rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

const int INF = 1<<29;
const double EPS = 1e-8;
const int MOD = 1000000007;

#define X first
#define Y second
#define MAXSIZE 1001
int n;
vector<pii> p;
int X[MAXSIZE][MAXSIZE];
int K[MAXSIZE][MAXSIZE];

int optimalBST(int n) {
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= n; ++j){
      X[i][j] = i+1 == j ? 0 : INF;
      if(i+1 == j) K[i][j] = i;
    }
    X[i][i] = 0;
    K[i][i] = i;
  }
  for (int w = 2; w <= n; ++w) 
    for (int i = 0, j; (j = i+w) <= n; ++i) 
      for (int r = K[i][j-1]; r <= K[i+1][j]; ++r)  {
        int c = X[i][r] + X[r][j] + p[r-1].Y - p[j-1].Y + p[r].X - p[i].X;
        if (X[i][j] > c) { X[i][j] = c; K[i][j] = r; }
      }
  return X[0][n];
}
main(){
	ios::sync_with_stdio(false);
	while(cin >> n){
		p.resize(n);
		REP(i, n) cin >> p[i].X >> p[i].Y;
		cout << optimalBST(n) << endl;
	}
	return 0;
}

Measured memory_bytes: 9036
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define check system("pause")
#define all(x) (x).begin(),(x).end()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
const ll mod = 1e9+7;
const int N = 1e6+20;
#define dep(i,a,b) for(int i=(a);i>=(b);i--)
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define mes(p,b) memset(p,b,sizeof(p))
#define sz(x) int(x.size())
char c[N];
int main()
{
  	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>c;
	int len=strlen(c);
	for(int i=0;i<len;i++){
		
		if(c[i]=='?') cout<<"D";
		else cout<<c[i];
	}
  	return 0;
}



Measured memory_bytes: 3712
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = sc.next();

		if(3200 <= a) {
			System.out.println(s);
		}else {
			System.out.println("red");
		}
	}

}


Measured memory_bytes: 35720
//	-*- mode: C++ -*-
//	Bubble Sort
//		Write a program of the Bubble Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:

//		BubbleSort(A)
//		1 for i = 0 to A.length-1
//		2     for j = A.length-1 downto i+1
//		3         if A[j] < A[j-1]
//		4             swap A[j] and A[j-1]
//		Note that, indices for array elements are based on 0-origin.

//		Your program should also print the number of swap operations defined in line 4 of the pseudocode.

//	Input
//		The first line of the input includes an integer N, the number of elements in the sequence.

//		In the second line, N elements of the sequence are given separated by spaces characters.

//	Output
//		The output consists of 2 lines.

//		In the first line, please print the sorted sequence. Two contiguous elements of the sequence should be separated by a space character.

//		In the second line, please print the number of swap operations.

//	Constraints
//		1 ≤ N ≤ 100

//	Sample Input 1
//		5
//		5 3 2 4 1
//	Sample Output 1
//		1 2 3 4 5
//		8

//	Sample Input 2
//		6
//		5 2 4 6 1 3
//	Sample Output 2
//		1 2 3 4 5 6
//		9

#include <iostream>
#include <vector>

unsigned int BubbleSort(std::vector<int>&	A)
{
	unsigned int swapCount	{0};

	for(unsigned int i = 0; i < A.size() - 1; i++){
		for(unsigned int j = A.size() - 1; j > i; j--){
			if(A[j] < A[j - 1]){
				auto	tmp	= A[j];
				A[j]		= A[j - 1];
				A[j - 1]	= tmp;
				swapCount++;
			}
		}
	}

	return swapCount;
}

int	main(int	argc,
		 char*	argv[])
{
	unsigned int		N	{0};
	std::vector<int>	A	{};

	std::cin >> N;

	for(unsigned int i = 0; i < N; i++){
		int	element	{0};
		std::cin >> element;
		A.push_back(element);
	}

	unsigned int swapCount	= BubbleSort(A);

	unsigned int count	{0};

	for(auto element : A){
		std::cout << element;
		count++;
		if(count < N){
			std::cout << ' ';
		}
		else{
			std::cout << '\n';
		}
	}

	std::cout << swapCount << '\n';
    return 0;
}



Measured memory_bytes: 3160