akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main() {
    int n, x, temp, ans, minimum = INT_MAX;
    cin >> n >> x;
    rep(i, n) {
        cin >> temp;
        minimum = min(minimum, temp);
        x -= temp;
    }
    ans = n + x / minimum;
    cout << ans << endl;
}

Measured memory_bytes: 256
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 binary_search<T: std::cmp::Ord>(ys: &[T], elem: &T) -> usize {
    match ys.binary_search(elem) {
        Ok(r) => {
            let mut c = r + 1;
            loop {
                if ys.len() == c || &ys[c] != elem {
                    break;
                }

                c += 1;
            }

            c
        },
        Err(r) => r,
    }
}

fn solve(n: i32, mut xs: Vec<i32>) -> i32 {
    let mut r = 0;
    xs.sort();
    let ys = &xs.as_slice();
    for i in 0..n {
        for j in 0..i {
            let z = ys[i as usize];
            let y = ys[j as usize];
            let x = binary_search(ys, &(z-y)) as i32;

            if j > x {
                r += j - x;
            }
        }
    }

    r
}

fn main() {
    input!{
        n: i32,
        xs: [i32; n],
    }

    println!("{:?}", solve(n, xs));
}


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

#define F first
#define S second
typedef double db;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const ll INF=1e17;
const int mod=1000000007;


ll gcd(ll x,ll y){
return y? gcd(y,x%y):x;
}

int main(){
  int n,sum,ave,ans1,ans2;
  sum=ave=ans1=ans2=0;
  cin>>n;
  vector<int> a(n);
  rep(i,n)cin>>a[i];
  rep(i,n)sum+=a[i];
  ave=sum/n;
  rep(i,n)ans1+=pow(a[i]-ave,2);
  rep(i,n)ans2+=pow(a[i]-ave-1,2);
  cout<<min(ans1,ans2)<<endl;
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  if (N * A > B) {cout << B << endl;}
  else if (N * A == B) {cout << N * A << endl;}
  else if (N * A < B) {cout << N * A << endl;}
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define REP(i,a,b) for(int i=int(a);i<(int)b;++i)
#define Graph vector<vecctor<ll>>
#define pairs vector<pair<ll,ll>>
#define pb push_back



using namespace std;
using ll = long long;
const ll INF = 1e18;
const double PI = acos(-1);

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
const ll mod = 1e9 + 7;







int main(void)
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    ll n,x,m;
    cin >> n >> x >> m;
    vector<ll>a;
    ll as = x,sum = x,key=INF;
    a.pb(as);
    bool flag;
    set<ll>se;
    se.insert(as);
    rep(i,m){
        as = (as*as)%m;
        if(se.count(as) == 1){
            flag = false;
            key = as;
            break;
        }
        if(as == 0){
            flag = true;
            break;
        }
        a.pb(as);
        se.insert(as);
        sum += as; 
    }
    ll start = INF;
    if(flag){
        cout << sum << endl;
        return 0;
    }else{
        rep(i,a.size()){
            if(a[i] == key){
                start = i;
            }
        }
    }
    sum = 0;
    ll ans,sz = 0;
    rep(i,a.size()){
        if(i == start){
            ans = sum;
            sum = 0;
            sz = 0;
        }
        sz++;
        sum += a[i];

    }
    n -= start;
    ll sho = n/sz;
    ll amari = n%sz;
    ans += sho*sum;
    for(int i = 0;i < amari;++i){
        ans += a[i+start];
    }

    cout << ans << endl;
    return 0;
}

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

using namespace std;

int main() {
   long long int a,b,c,d;
   cin>>a>>b>>c>>d;
   
   long long int A[4];
   A[0]=(a*c);
   A[1]=(b*c);
   A[2]=(a*d);
   A[3]=(b*d);
   sort(A,A+4);
   
   cout<<(A[3])<<endl;
}

Measured memory_bytes: 3636
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define REP(i, n) for(int i = 0;i < (n);i++)
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=1000000007;
const llint inf=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-10;
template <class T,class U>bool chmin(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool chmax(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(const vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(const vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}

int main(void){
	int n,K,i;cin>>n>>K;
	vector<int>den(n);
	vector<int>nex(n);
	for(i=0;i<n;i++){cin>>den[i];}
	while(K--){
		bool mda=false;
		for(i=0;i<n;i++){nex[i]=0;if(den[i]<n){mda=true;}}
		if(!mda){break;}
		for(i=0;i<n;i++){
			
			nex[max(0,i-den[i])]++;
			if(i+den[i]+1<n){nex[i+den[i]+1]--;}
		}
		
		for(i=0;i<n-1;i++){nex[i+1]+=nex[i];}
		swap(nex,den);
		//for(i=0;i<n;i++){cout<<den[i]<<" ";}cout<<endl;
	}
	for(i=0;i<n;i++){cout<<den[i]<<" ";}
	return 0;
}
/*
41 999
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
*/

Measured memory_bytes: 4468
x,y = map(int,input().split())
a = (1, 3, 5, 7, 8, 10, 12)
b = (4, 6, 9, 11)
if x in a and y in a:
    print('Yes')
elif x in b and y in b:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
    string N;
    cin >> N;
    for(int i=0; i<3; i++){
        if(N[i]=='7'){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

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

ll search(ll n)
{
	if (n==1)  return 1ll;
	else
	{
		if (n%2==1)  n--;
		return search(n/2)*2ll+1;
	}
}

int main()
{
	ll n;
	cin>>n;
	if (n==0)
	{
		cout<<0<<endl;
		return 0;
	}
	cout<<search(n)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<utility>
#include<algorithm>
using namespace std;
int N,ans=0;
bool used[100]={0};
pair<int,int> x[100],y[100];
int main(void){
	cin>>N;
	for(int i=0;i<N;i++)cin>>x[i].first>>x[i].second;
	for(int i=0;i<N;i++)cin>>y[i].first>>y[i].second;
	sort(x,x+N);
	sort(y,y+N);
	for(int i=N-1;i>=0;i--){
		int k=999;
		int c=-1;
		for(int j=0;j<N;j++){
			if(x[i].first<y[j].first&&x[i].second<y[j].second&&k>y[j].second&&!used[j]){
				c=j;
				k=y[j].second;
			}
		}
		if(c!=-1){
			used[c]=1;
			ans++;	
		}
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
N = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(N-1):
  if p[i] == i+1:
    p[i],p[i+1] = p[i+1],p[i]
    ans += 1
if p[-1] == N:
  ans += 1
print(ans)

Measured memory_bytes: 14008
#include <stdio.h> 
 #include <stdbool.h> 
 
 
 int main(){ 
     int i, j, n; 
     char mark; 
     char marks[4]={'S', 'H', 'C', 'D'}; 
     int num; 
     bool cards[4][13]={false}; 
 
 
     scanf("%d ", &n); 
     for(i=0;i<n;i++){ 
        scanf("%c %d ", &mark, &num); 
         for(j=0;j<4;j++){ 
             if(mark==marks[j]){ 
                 cards[j][num-1]=true; 
                 break; 
             } 
         } 
     } 
     for(i=0;i<4;i++){ 
         for(j=0;j<13;j++){ 
             if(!cards[i][j]){ 
                 printf("%c %d\n", marks[i], j+1); 
             } 
         } 
     } 
     return 0; 
 } 



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

int two[2002];
int four[4002];
 
int main(){
  for(int i = 0; i <= 1000; i++){
    for(int j = 0; j <= 1000; j++){
      two[i + j]++;
    }
  }
 
  for(int i = 0; i <= 2000; i++){
    for(int j = 0; j <= 2000; j++){
      four[i + j] += two[i] * two[j];
    }
  }
 
  int n;
 
  while(cin >> n){
    cout << four[n] << endl;
  }
}


Measured memory_bytes: 3104
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
	int n_old = 0;
	int a, b;
	scanf("%d", &n_old);
	if (n_old == 1) {
		printf("Hello World\n");
	} else {
		scanf("%d", &a);
		scanf("%d", &b);
		printf("%d", a+b);
	}
	return 0;
}


Measured memory_bytes: 128
import math

a,b,x=[int(x) for x in input().split()]
if x*2<=a**2*b:
    y=2*x
    theta=math.atan2(y,b*a*b)
else:
    theta=math.atan2(a**3, 2*(b*a**2-x) )
print(90-theta*180/math.pi)
    

Measured memory_bytes: 2940
// E - Roaming
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int MOD = 1000000007,N,K;

#define MAX 200001 //[n+1] 1_origin
ll fac[MAX]; // 階乗 n!
ll inv[MAX]; // 逆元 1/n
ll finv[MAX]; // 逆元の階乗 (n^-1)! = (1/n)!

// n 個の配列に、mod p で前処理する
void init(int n, int p){
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	rp(i,2,n+1){
		fac[i] = fac[i-1] * i % p;
		inv[i] = p - inv[p%i] * (p/i) % p;
		finv[i] = finv[i-1] * inv[i] % p;
	}
}

// 二項係数計算 nCr(mod m)
ll nCr(int n, int r, int m){
	if(n<r || n<0 || r<0) return 0;
	return fac[n] * (finv[n-r] * finv[r] % m) % m;
}

ll solve(){
	init(N, MOD);
	K = min(K, N-1);
	ll ans = 0;
	rp(k,0,K+1){
		ll x = nCr(N, k, MOD) * nCr(N-1, k, MOD) % MOD;
		ans = (ans + x) % MOD;
	}
	return ans;
}

int main(){
	cin>>N>>K;
	cout<< solve() <<endl;
}

Measured memory_bytes: 4992
// +build ignore
package main

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

func solve(sc *scanner, wr *bufio.Writer) int {
	N := sc.i()

	f := factorize(N)

	ans := 0
	for _, p := range f {
		t := p
		i := 1
		for t-i >= 0 {
			ans++
			t -= i
			i++
		}
	}

	fmt.Println(ans)

	return 0
}

func factorize(n int) map[int]int {
	res := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			res[i]++
			n /= i
		}
	}
	if n != 1 {
		res[n] = 1
	}
	return res
}

func main() {
	sc := newScanner(os.Stdin)
	wr := bufio.NewWriter(os.Stdout)
	ret := solve(sc, wr)
	wr.Flush()
	os.Exit(ret)
}

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

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

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

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

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

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

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}


Measured memory_bytes: 1764
num = gets.to_i
input = gets.split.map(&:to_i)

max = input[0]
result = true

(0..(num - 1)).each do |index|
next if index == 0 
if input[index] - input[index-1] < -1 || input[index] - max < -1 
  result = false 
  break
end
  max = [input[index], max].max
end

puts (result ? 'Yes' : 'No')

Measured memory_bytes: 11140
#include<stdio.h>

int main(void){
	int N,S=0; scanf("%d",&N);
	int V[N],C[N];
	for(int i=0;i<N;i++){
		scanf("%d",&V[i]);
	}
	for(int i=0;i<N;i++){
		scanf("%d",&C[i]);

	}
	for(int i=0;i<N;i++){
		if(V[i]>C[i]){
			S+=V[i]-C[i];
		}
	}
	printf("%d\n",S);
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define REVERSE(a) reverse(ALL(a))
using namespace std;
typedef long long ll;
//vector<vector<int>> vec(i, vector<int>(j));

vector<int> input(int N) {
    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }
    return vec;
}

void Main() {
    int n;
    string s;
    cin >> n >> s;
    int x = 0;
    int tmp = 0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == 'I') {
            x++;
            if (tmp < x) {
                tmp = x;
            }
        }
        else
        {
            x--;
        }
    }
    cout << tmp << endl;
}

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

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
S = input()

while 1:
    if S == "":
        print("YES")
        break
    elif S[-5:] == "dream" or S[-5:] == "erase":
        S = S[:-5]
    elif S[-6:] == "eraser":
        S = S[:-6]
    elif S[-7:] == "dreamer":
        S = S[:-7]
    else:
        print("NO")
        break


Measured memory_bytes: 3188
#include <stdio.h>
int main()
{
	char b;
	
	scanf("%c", &b);
	
	
	if(b == 'A')
		printf("T");
	else if(b == 'T')
		printf("A");
	else if(b == 'C')
		printf("G");
	else if(b == 'G')
		printf("C");

	return 0;
}

Measured memory_bytes: 128
A,B=map(int,input().split())
if A==1 or B==1:
  if A==B:
    print('Draw')
  elif A==1:
    print('Alice')
  else:
    print('Bob')
elif A>B:
  print('Alice')
elif A<B:
  print('Bob')
else:
  print('Draw')

Measured memory_bytes: 3064
"use strict";

function Main(input) {
    input=input.split("\n");
    for(var i=0;i<input.length;i++){
        if(input[i].indexOf("?") !== -1)
            break;
        console.log(Math.floor(eval(input[i])));
    }
}
    
function debug(){
	var input = document.getElementById("input").value;
	Main(input);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main(){
  int a, b;
  cin >> a >> b;
  while(a < 1 || a > 100 || b < 1 || b > 100){
    cin >> a >> b;
  }
  if((a + b) % 2 == 0){
    cout << (a + b) / 2 << endl;
  }else{
    cout << (a + b + 1) / 2 << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int memo[302][302];
int w[302];

int rec(int i,int j){
    if(i>=j) return 0;
    if(i+1==j){
        if(abs(w[i]-w[j]) <= 1) return 2;
        else return 0;
    }
    if(memo[i][j]>=0) return memo[i][j];
    int res=0;

    if(abs(w[i]-w[j])<=1 and rec(i+1,j-1)==j-1-i){
        return memo[i][j]=j-i+1;
    }

    for(int k=i;k<j;k++){
        int L=rec(i,k);
        int R=rec(k+1,j);
        res=max(res,L+R);
    }
    return memo[i][j]=res;
}

void solve(int N){
    rep(i,302) rep(j,302) memo[i][j]=-1;
    rep(i,N) cin >> w[i];
    cout << rec(0,N-1) << endl;
}

int main(){
    while(1){
        int n;
        cin >> n;
        if(n==0) break;
        solve(n);
    }
}



Measured memory_bytes: 3452
n = int(input())
a = [0]*n
a = list(map(int, input().split()))

a.sort()
hoge = a[n-1] / 2 - a[0]
ans = 0
for i in range(n-1):
    if abs(a[n-1] / 2 - a[i+1]) > hoge:
        ans = i
        break
    else:
        hoge = abs(a[n-1] / 2 - a[i+1])

print(a[n-1], a[ans])

Measured memory_bytes: 15196
#include<iostream>

using namespace std;

typedef long long ll;

int N;
ll a[50];
ll K;

int main() {
	cin >> N;
	for (int i = 0; i < N; i++)cin >> a[i];
	while (true) {
		bool update = false;
		ll total = 0, dec[50] = {};
		for (int i = 0; i < N; i++) {
			total += (a[i] / N);
			dec[i] = (a[i] / N);
			if (a[i] / N != 0)update = true;
		}
		K += total;
		for (int i = 0; i < N; i++) {
			a[i] %= N;
			a[i] += (total - dec[i]);
		}
		if (!update)break;
	}
	cout << K << endl;
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n, cnt, num int
	fmt.Scan(&n)
	for i := 1; i <= n; i += 2 {
		cnt = 0
		for j := 1; j <= n; j++ {
			if i%j == 0 {
				cnt++
			}
		}
		if cnt == 8 {
			num++
		}
	}
	fmt.Println(num)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <string>
#define INF 100000
using namespace std;
int H, W,N;
int x, y;
typedef long long ll;


int main(){
    cin >> W >> H >> x >> y ;
    int flag=0;

    double ans = (double) W*(double) H/2;
    if((double) x==(double) W/2 && (double) y==(double) H/2) flag = 1;
    cout << ans<<" "<< flag << endl;

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#define FOR(i,j,n) for(int i=(j);i<=((int)n);++i)
#define N 1000005
#define MOD 1000000007
#define all(c) (c).begin(),(c).end()
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define pb push_back
typedef long long int ll;
typedef std::vector< int > vi;
typedef std::vector< vi > vvi;
typedef std::pair< int,int > ii;
using namespace std;

vector <int>g[N];
void init()
{
	for(int i = 0; i < N; i++) {
		g[i].clear();
	}
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int h[n+6];
    FOR(i,1,n)
    cin>>h[i];
    int x[n+5];
    x[n]=0;
    int m=0;
    for (int i=n-1;i>=1;i--)
    {
    	if (h[i]>=h[i+1])
    	x[i]=1+x[i+1];
    	else
    	x[i]=0;
    	m=max(m,x[i]);
	}
	cout<<m<<endl;
}





Measured memory_bytes: 24448
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int n,m;
    cin>>n>>m;
    int k[n];
    int ans[m]={};
    int kai=0;
    int a[n][m];
    for(int i=0;i<n;i++){
      cin>>k[i]; 
      for(int j=0;j<k[i];j++){
        cin>>a[i][j];  
      }
    }
    for(int i=0;i<n;i++){
      for(int j=0;j<k[i];j++){
        ans[a[i][j]-1]++;  
      }
    }
    for(int i=0;i<m;i++){
        if(ans[i]==n){
          kai++;  
        }
    }
    cout<<kai<<endl;
}

Measured memory_bytes: 256
N = int(input())
A = [int(input()) for _ in range(N)]
a = sorted(A)

odd_n = set()
even_n = set()

for i in range(N):
    if(i%2 == 0):
        even_n.add(a[i])
    else:
        odd_n.add(a[i])
    
cnt= 0    
    
for i in range(N):
    if(i%2 == 0):
        if(A[i] not in even_n):
            cnt += 1
    else:
        if(A[i] not in odd_n):
            cnt += 1
print(cnt//2)

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

typedef long long ll;
typedef struct {
	ll cost;
	int to;
} Edge;

ll n;
ll q, k;
ll min_cost[100005];
int visited[100005];
Edge *graph[100005];
int edge_num[100005];
int capacity[100005];

int st[100005];
int sp;

void dfs(ll k);

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

	for (ll i = 1; i < n; i++) {
		ll a, b, c;

		scanf("%lld %lld %lld", &a, &b, &c);


		if (capacity[a] == edge_num[a]) {
			graph[a] = realloc(graph[a], sizeof(Edge) * (capacity[a] + 1) * 2);
			capacity[a] = 2 * (capacity[a] + 1) - 1;
		}

		if (capacity[b] == edge_num[b]) {
			graph[b] = realloc(graph[b], sizeof(Edge) * (edge_num[b] + 1) * 2);
			capacity[b] = 2 * (capacity[b] + 1) - 1;
		}

		graph[a][edge_num[a]] = (Edge){.cost = c, .to = b};
		graph[b][edge_num[b]] = (Edge){.cost = c, .to = a};

		edge_num[a]++;
		edge_num[b]++;
	}

	scanf("%lld %lld", &q, &k);

	dfs(k);

	for (ll i = 0; i < q; i++) {
		ll x, y;

		scanf("%lld %lld", &x, &y);

		printf("%lld\n", min_cost[x] + min_cost[y]);
	}


	return 0;
}

void dfs(ll k)
{
	visited[k] = 1;
	st[0] = k;
	sp = 0;

	while(sp >= 0) {
		ll pos = st[sp]; sp--;

		for (ll i = 0; i < edge_num[pos]; i++) {
			ll npos = graph[pos][i].to;
			ll ncos = graph[pos][i].cost + min_cost[pos];

			if (visited[npos] == 0) {
				visited[npos] = 1;
				min_cost[npos] = ncos;

				sp++;
				st[sp] = npos;
			}
		}
	}

	return;
}


Measured memory_bytes: 12288
from copy import copy
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from heapq import heapify, heappush, heappop
setrecursionlimit(1000000)

# INF = float('inf')
INF = int(1e10)

def input():
    return stdin.readline()[:-1]

def main():
    from builtins import int, map
    K = int(input())

    heap = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    heapify(heap)
    count = 0
    while True:
        count += 1
        v = heappop(heap)
        if v % 10 != 0:
            heappush(heap, 10 * v + (v % 10) - 1)
        heappush(heap, 10 * v + (v % 10))
        if v % 10 != 9:
            heappush(heap, 10 * v + (v % 10) + 1)

        if count == K:
            print(v)
            exit()

if __name__ == '__main__':
    main()

Measured memory_bytes: 54980
#include <iostream>
#include <vector>

int main(){
    std::vector<int> vec(9);
    for(int i = 0; i < 9; ++i){
        std::cin >> vec.at(i);
    }

    int n;
    std::cin >> n;
    for(int i = 0; i < n; ++i){
        int val;
        std::cin >> val;
        auto itr = std::find(std::begin(vec), std::end(vec), val);
        *itr = -1;
    }

    bool flg = false;
    int i = 0;
    while(!flg && i < 3){
        flg = -1 == vec.at(i) && -1 == vec.at(i + 3) && -1 == vec.at(i + 6);
        ++i;
    }

    i = 0;
    while(!flg && i < 3){ // horizonral
        flg = -1 == vec.at(i * 3 + 0) && -1 == vec.at(i * 3 + 1) && -1 == vec.at(i * 3 + 2);
        ++i;
    }
    
    if(!flg){
        flg = -1 == vec.at(0) && -1 == vec.at(4) && -1 == vec.at(8);
    }

    if(!flg){
        flg = -1 == vec.at(2) && -1 == vec.at(4) && -1 == vec.at(6);
    }

    std::string ans = "No";
    if(flg){
        ans = "Yes";
    }
    std::cout << ans << std::endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int MAXN = 123456;
char s[MAXN];
int psum[MAXN];

int main() {
    int N, Q;
    scanf("%d %d", &N, &Q);
    scanf("%s", s + 1);
    for (int i = 1; i <= N; i++) {
        psum[i] = psum[i - 1];
        if (s[i] == 'C' && s[i - 1] == 'A') psum[i]++;
    }
    for (int i = 0; i < Q; i++) {
        int l, r;
        scanf("%d %d", &l, &r);
        int ans = psum[r] - psum[l];
        printf("%d\n", ans);
    }
    return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dbg(x) cerr << #x << " : " << x << endl;
#define endl '\n'
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n,k;
    cin >> n >> k;
    string s1;
    cin >> s1;
    ll ans=0;
    for(int i=0;i<n;i++){
        if(s1[i]=='L' and i!=0 and s1[i]==s1[i-1]) ans++;
        if(s1[i]=='R' and i!=n-1 and s1[i]==s1[i+1]) ans++;
    }
    string s="";
    s+=s1[0];
    for(int i=1;i<n;i++){
        if(s1[i]!=s1[i-1]) s+=s1[i];
    }
    dbg(s);
    n=s.size();
    ans+=min(n/2,k)*2;
    if(n%2==0 and n/2<=k) ans--;
    cout << ans << endl;
    return 0;
} 

Measured memory_bytes: 592
//B - Counting Roads
#include <bits/stdc++.h>
using namespace std;

int main(){
    vector<int> la(50);
    vector<int> lb(50);

    int N,M; cin >> N >> M;

    for(int i = 0;i < M;i++)
        cin >> la.at(i) >> lb.at(i);
    
    vector<int> load(50);

    for(int i = 0;i < N;i++)
        load.at(i) = 0;

    for(int i = 0;i < M;i++)
    {
        load.at(la.at(i) - 1) += 1;
        load.at(lb.at(i) - 1) += 1;
    }

    for(int i = 0;i < N;i++)
        cout << load.at(i) << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int N, a[100];
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		int temp;
		scanf("%d", &temp);
		a[i] = -1;
		for (int j = 0; j < 8; j++) {
			if (temp < 400*(j+1)) {
				a[i] = j;
				break;
			}
		}
	}
	int super = 0;
	int list[8];
	for (int i = 0; i < 8; i++) list[i] = 0;
	for (int i = 0; i < N; i++) {
		if(a[i] == -1) {
			super++;
			continue;
		}else{
			list[a[i]] = 1;
		}
	}
	int colormin = 0, colormax;
	for (int i = 0; i < 8; i++) colormin += list[i];
	colormax = colormin + super;
	if(colormin == 0) colormin = 1;
	printf("%d %d\n", colormin, colormax);
	return 0;
}


Measured memory_bytes: 128
// Author: Mohammad Faisal
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin >> s;
  string t;
  cin >> t;
  reverse(t.begin(),t.end());
  if(t==s)
    cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
  return 0;
}

Measured memory_bytes: 256
max = 105000
sn = max.to_f**0.5.ceil
is_prime = [false, false] + [true]*(max-1)
(2..sn).each do |i|
  next unless is_prime[i]
  (i*i).step(max, i) do |j|
    is_prime[j] = false
  end
end
prime_list = (2..max).to_a.select{ |i| is_prime[i] }

while n = gets.to_i do
  break if n == 0
  puts prime_list[0..(n-1)].inject(:+)
end

Measured memory_bytes: 9588
def gcd(a, b):
    while a != 0:
        b = b%a
        a, b = b, a
    return b

def lcm(a, b):
    return (a*b)//gcd(a,b)

n, m = map(int, input().split())

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

x = 1

for y in a:
    x = lcm(x, y//2)

for y in a:
    if (x//(y//2)) % 2 == 0:
        print(0)
        exit()

max_n = (m-x)//(2*x)

print(max_n+1)


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

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

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

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

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

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

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

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

#[allow(unused_mut)]
#[allow(non_snake_case)]
fn main() {
    input!{
        s: chars
    }

    let mut ind = 0;
    let mut count = 0;

    loop {
        if s.len() - ind < 2 {
            break;
        }

        if (s[ind] as u32 - '0' as u32) + (s[ind + 1] as u32 - '0' as u32) == 1 {
            count += 1;
            s.remove(ind);
            s.remove(ind);
            if ind > 0 {
                ind -= 1
            }
        } else {
            ind += 1;
        }
    }

    println!("{}", count * 2);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,-1,0};
const int vy[4] = {1,0,0,-1};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define int ll

char c[1100][1100];
int h,w;
int a[1100][1100];


signed main(){
  cin>>h>>w;
  rep(i,h){
    cin>>c[i];
  }

  queue<P> q;
  q.push(P(0,0));
  a[0][0]=1;

  while(!q.empty()){
    P p = q.front();
    q.pop();
    int x=p.S,y=p.F;
    rep(i,2){
      if(x+vx[i]<0||w<=x+vx[i]||y+vy[i]<0||h<=y+vy[i]) continue;
      int ax=x+vx[i],ay=y+vy[i];
      if(c[ay][ax]=='#') continue;
      a[ay][ax]+=a[y][x];
      a[ay][ax]%=M;
      if(a[ay][ax]==a[y][x])
        q.push(P(ay,ax));
    }
  }



  cout<<a[h-1][w-1]<<endl;
}

Measured memory_bytes: 10752
n, q = [int(i) for i in input().split()]
S = input()
counter = [0] * (len(S) + 1)
for i in range(len(counter)):
    if S[i-2:i] == 'AC':
        counter[i] = counter[i-1] + 1
    else:
        counter[i] = counter[i-1]

for _ in range(q):
    l, r = [int(i) for i in input().split()]
    print(counter[r] - counter[l])

Measured memory_bytes: 51032
#include<iostream>
#include<bits/stdc++.h>
#define Amr_Abdelazim ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define pp pop_back
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define vvll vector<vector<ll> >
#define vpll vector<pair<ll,ll> >
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define rep(i,n)   for(int i=0;i<n;i++)
#define repp(i,s,n)   for(int i=s;i<=n;i++)
#define print(v) {for(auto i:v)cout<<i<<" ";cout<<"\n";}
#define mkp make_pair
#define clr(ar,v) memset(ar,v,sizeof(ar));
#define TC ll amr_abdelazim;cin>>amr_abdelazim;while(amr_abdelazim--)
#define popcnt(x) __builtin_popcount(x)
#define EPS 1e-9
#define INF 1e17
using namespace std;
const int mod = 1000000007;
const int N = 1000000+5;
const double pi = acos(-1);
class cmp{
public:
	bool operator() (pair<ll, pll> &A, pair<ll, pll> &B){
		return A > B;
	}
};
template<class a,class b,class c>
class tup{
public:
	a f;
	b s;
	c t;
	tup(a f,b s,c t):f(f),s(s),t(t){}
	tup(){}
};
bool by_sec(pll &A, pll &B){
	return A.second < B.second;
}
ld dist(pll p1, pll p2){
	return (ld)sqrt((ld)(p1.first - p2.first)*(p1.first - p2.first) + (ld)(p1.second - p2.second)*(p1.second - p2.second));
}
ll fact[1000009], inv[1000009];
ll fp(ll a, ll b){
	if (b == 0)
		return 1;
	ll ans = fp(a, b / 2);
	ans = (ans * ans) % mod;
	if (b % 2 != 0)
		ans = (ans * (a % mod)) % mod;
	return ans;
}
void FacInv(ll n){
	fact[0] = inv[0] = 1;
	for (ll i = 1; i <= n; i++)
	{
		fact[i] = ((i%mod) * fact[i - 1] % mod) % mod;
		inv[i] = fp(fact[i], mod - 2);
	}
}
ll ncr(ll n, ll r){
	return (((fact[n] * inv[r]) % mod) * inv[n - r]) % mod;
}

ll v[N][3];
ll n;
ll dp[N][4];
ll fun(ll i,int last){
	if (i >= n)return 0;
	if (dp[i][last] == -1){
		ll ans = 0;
		rep(j, 3){
			if (j != last)
				ans = max(ans, v[i][j] + fun(i + 1, j));
		}
		dp[i][last] = ans;
	}
	return dp[i][last];
}
int main()
{
	Amr_Abdelazim
	cin >> n;
	clr(dp, -1);
	rep(i, n){
		cin >> v[i][0] >> v[i][1] >> v[i][2];
	}
	cout << fun(0, 3) << "\n";
	return 0;
}


Measured memory_bytes: 46568
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*----------------------------------------*/
template <typename Abelian, const Abelian UNITY>
struct WeightedUnionFind {
  WeightedUnionFind(int sz) : parent(sz, -1), data(sz, UNITY) {}

  int root(int ver) {
    if (parent[ver] < 0) return ver;
    int res = root(parent[ver]);
    data[ver] += data[parent[ver]];
    return parent[ver] = res;
  }

  void unite(int ver1, int ver2, Abelian wt) {
    wt += weight(ver1);
    wt -= weight(ver2);
    ver1 = root(ver1);
    ver2 = root(ver2);
    if (ver1 != ver2) {
      if (parent[ver1] < parent[ver2]) {
        parent[ver1] += parent[ver2];
        parent[ver2] = ver1;
        data[ver2] = wt;
      } else {
        parent[ver2] += parent[ver1];
        parent[ver1] = ver2;
        data[ver1] = -wt;
      }
    }
  }

  bool same(int ver1, int ver2) { return root(ver1) == root(ver2); }

  int size(int ver) { return -parent[root(ver)]; }

  Abelian diff(int ver1, int ver2) { return weight(ver2) - weight(ver1); }

private:
  vector<int> parent;
  vector<Abelian> data;

  Abelian weight(int ver) {
    root(ver);
    return data[ver];
  }
};

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n, m; cin >> n >> m;
  WeightedUnionFind<int, 0> uf(n);
  bool ans = true;
  REP(i, m) {
    int l, r, d; cin >> l >> r >> d;
    --l;
    --r;
    if (uf.same(l, r)) ans &= (uf.diff(l, r) == d);
    else uf.unite(l, r, d);
  }
  cout << (ans ? "Yes" : "No") << '\n';
  return 0;
}


Measured memory_bytes: 1024
n = int(input())
s = input()
c = 0
tmp = 0

for i in range(1,n):
  s1 = list(set(s[:i]))
  s2 = list(set(s[i:]))
  for j in s1:
    if j in s2:
      tmp += 1
  if tmp > c:
    c = tmp
  tmp = 0
  
print(c)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
double a[21][3],ans=0,p;int n,m,c[21];
using namespace std;
double cal(){p=0;
  r(i,0,m)r(j,i+1,m)
  p+=pow(a[c[i]][0]-a[c[j]][0],2)+pow(a[c[i]][1]-a[c[j]][1],2)+pow(a[c[i]][2]-a[c[j]][2],2);
  ans=max(ans,p);
}
void dfs(int x,int d){
  if(d==m){cal();return;}
  else if(x==n)return;
  c[d]=x;dfs(x+1,d+1);dfs(x+1,d);
}
int main(){
  cin>>n>>m;
    r(i,0,n)cin>>a[i][0]>>a[i][1]>>a[i][2];
    dfs(0,0);
    printf("%.6f\n",ans);
}

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


void solve(){
    string s, ans;
    cin >> s;
    for(char c : s){
        if(c == '0')
            ans += "0";
        else if(c == '1')
            ans += "1";
        else if(!ans.empty()) ans.pop_back();
    }
    cout << ans << "\n";
}

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

    bool multitest = false;
//    multitest = true;
    if(multitest){
        int t; cin >> t;
        while(t--)
            solve();
    }
    else
        solve();
}






Measured memory_bytes: 3592
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();

        final Map<Integer, Boolean> countMap = new HashMap<>();
        for (int i = 0; i < n; i++) {
            countMap.compute(scanner.nextInt(), (k, v) -> v == null ? v = true : !v);
        }

        final long answer = countMap.values().stream()
                .filter(Boolean::booleanValue)
                .count();

        System.out.println(answer);
    }
}


Measured memory_bytes: 63932
lista = []
listb = []
listc = []
tmp1 = input().rstrip()
for i in range(len(tmp1)):
  lista.append(tmp1[i])
  
tmp2 = input().rstrip()
for j in range(len(tmp2)):
  listb.append(tmp2[j])
  
tmp3 = input().rstrip()
for k in range(len(tmp3)):
  listc.append(tmp3[k])
  
dict = {'a':lista,'b':listb,'c':listc}

now = 'a'
while 1:
  if len(dict[now]) == 0:
    print(now.upper())
    break
  work = (dict[now])[0]
  dict[now].pop(0)
  now = work

Measured memory_bytes: 3064
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	int a, b, t; cin >> a >> b >> t;

	cout << (t / a)*b << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std; 
int n; 
int N[36] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 15, 21, 24, 27, 20, 28, 32, 36, 25, 30, 35, 40, 45, 42, 48, 54, 49, 56, 63, 64, 72, 81}; 

int main()
{
	cin >> n; 
	for (int i = 0; i < 36; ++i)
		if (N[i] == n)
		{
			cout << "Yes"; 
			return 0; 
		}
	cout << "No"; 
	return 0; 
}

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

int main(){
  string A, B, C;
  cin >> A >> B >> C;
  if(A[A.size()-1]==B[0] && B[B.size()-1]==C[0]){
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int L,R;
	int L_res=1, R_res= N;

	for (int i = 0; i < M; i++)
	{
		cin >> L >> R;
		L_res = max(L,L_res);
		R_res = min(R,R_res);
	}

	cout << max(R_res - L_res + 1,0) << endl;
	return 0; 
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#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) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
//#define INF 9999999999
#define m0(x) memset(x,0,sizeof(x))
//#define fill(x,y) memset(x,y,sizeof(x))
#define print(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long


using namespace std;
typedef pair<int, int>P;

int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };


const int MAX = 500010;
const int MOD = 1000000007;
const ll INF = 10e17;


signed main() {
	int a, b, c, d; cin >> a >> b >> c >> d;
	int ans = a * b - a * d - b * c + c * d;
	print(ans);
}

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

int main() {
  ll x;
  cin >> x;
  
  ll y=100,j=0;
  while(true){
    j++;
    y=y+y/100;
    if(y>=x) break;
  }
  cout << j << endl;
  return 0;
  
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define int long long
using namespace std;

typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    int N, P;
    cin >> N;
    vector<int> invP(N);

    REP(i, N){
        cin >> P;
        P--;
        invP[P] = i;
    }

    int count = 1, ans = 1;    
    FOR(i, 1, N){
        if(invP[i] > invP[i - 1]) count++;
        if(invP[i] < invP[i - 1] || i == N - 1){
            ans = max(ans, count);
            count = 1;
        }
    }

    ans = N - ans;
    cout << ans;
    
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
#include <numeric>
#include <stack>
#include <tuple>

using namespace std;
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
const int INF = 100000000;
const long long LINF = 1000000000000000000;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-6;
using pii = std::pair<int, int>;
using pLL = std::pair<long long, long long>;
using ll = long long;
#define SORT(v) std::sort(v.begin(), v.end())

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<int> a;
	a.push_back(N);
	if (N == 2) {
		cout << 4 << endl;
		return 0;
	}
	else if (N==1) {
		cout << 4 << endl;
		return 0;
	}
	size_t i = 1;
	while (1) {
		if (N % 2 == 0) {
			N /= 2;
			a.push_back(N);
			
		}
		else {
			N = N * 3 + 1;
			a.push_back(N);
			
		}

		if (a.size() >= 3) {
			if (a[i] == 1 && a[i - 1] == 2 && a[i - 2] == 4) {
				cout << i+2 << endl;
				return 0;
			}

		}
		//cout << a[i] << i << endl;
		i++;
		
	}
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int h,n;
    cin >> h >> n;
    int sum = 0;
    for(int i=0; i<n; i++){
        int a;
        cin >> a;
        sum += a;
    }
    if(sum >= h){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

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

int main()
{
  int ans = 0;
  vector<int> v(3);
  for (int i = 0; i < 3; i++)
  {
    cin >> v[i];
  }
  sort(v.begin(), v.end());

  int a, b;
  a = v[2] - v[0];
  b = v[2] - v[1];

  if (a % 2 == 1 && b % 2 == 1)
  {
    ans++;
    ans += ((a - 1) / 2) + ((b - 1) / 2);
  }
  else if (a % 2 == 0 && b % 2 == 1)
  {
    ans++;
    ans += (a / 2) + ((b + 1) / 2);
  }
  else if (a % 2 == 1 && b % 2 == 0)
  {
    ans++;
    ans += ((a + 1) / 2) + (b / 2);
  }
  else
  {
    ans += (a / 2) + (b / 2);
  }
  cout << ans << endl;
}


Measured memory_bytes: 3572
#include<bits/stdc++.h>
#define  ll  long long int
#define  sz  200010

using namespace std;


int main()
{

    ll n,s=0,l,r,d;

    cin>>n;

    while(n--)
    {
        cin>>l>>r;
        d=r-l+1;

        s+=d;
    }

    cout<<s<<endl;

    return 0;
}


Measured memory_bytes: 256