akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;
#define int long long int
#define inf 1000000000000000
int function(string &str,int initial,int final,int memo[])
{
	if(initial==final+1)
	{
		return 1;
	}
	if(initial>final)
	   return 0;
	if(memo[initial]!=-1)
	  return memo[initial];
	else
	{
		string s="";
		int j;
		for(j=initial;str[j]!='\0'&&j<=initial+4;j++)
		{
			s+=str[j];
		}
		int a=0,b=0,c=0,d=0;
		if(s=="dream")
		{
			a=function(str,initial+5,final,memo);
		}
		if(s=="erase")
		{
			b=function(str,initial+5,final,memo);
		}
		s="";
		for(j=initial;str[j]!='\0'&&j<=initial+5;j++)
		   s+=str[j];
		if(s=="eraser")
		{
			c=function(str,initial+6,final,memo);
		}
		s="";
		for(j=initial;str[j]!='\0'&&j<=initial+6;j++)
		   s+=str[j];
		if(s=="dreamer")
		   d=function(str,initial+7,final,memo);
		if(a==1||b==1||c==1||d==1)
		  memo[initial]=1;
		else
		  memo[initial]=0;
		return memo[initial];
	}
}
int32_t main()
{
	string str;
	cin>>str;
	int n=str.size();
	int memo[n+1];
	int j;
	for(j=0;j<=n;j++)
	{
		memo[j]=-1;
	}
	int result=function(str,0,n-1,memo);
	if(result==1)
	   cout<<"YES"<<endl;
	else
	  cout<<"NO"<<endl;
}


Measured memory_bytes: 4352
//***Little by little one travels far***
 
#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main()
{
    ll n;
    cin>>n;
    ll a=(n+1)/2;
    ll b=n;
    printf("%0.6f",(float)a/(float)b);
}

Measured memory_bytes: 256
import collections

n = int(input())
nums = list(map(int, input().split()))
nums2 = [0] * 3 * n
nums2_i = 0
for num in nums:
  nums2[nums2_i] = num - 1
  nums2_i += 1
  nums2[nums2_i] = num
  nums2_i += 1
  nums2[nums2_i] = num + 1
  nums2_i += 1


c = collections.Counter(nums2)
print(c.most_common()[0][1])

Measured memory_bytes: 30868
#include<iostream> 
#include<iomanip> 
#include<vector> 
#include<map> 
#include<set> 
#include<algorithm> 
#include<numeric> 
#include<limits> 
#include<bitset> 
#include<functional> 
#include<type_traits> 
#include<queue> 
#include<stack> 
#include<array> 
#include<random> 
#include<utility> 
#include<cstdlib> 
#include<ctime>
//#define _LIBCPP_DEBUG 0
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define all(a) (a).begin(),(a),end()
#define rep(i,n) for (ll i = 0; i < (ll)(n); ++i)	

int max(int a, int b) {
	int max;
	if (a > b) max = a;
	else max = b;
	return max;
}
int min(int a, int b) {
	int min;
	if (a < b) min = a;
	else min = b;
	return min;
}


int main() {
	int n;
	cin >> n;
	cout << (n + 1) / 2 << endl;
}

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

#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define REP(i,n) FOR(i,0,n)
using namespace std;

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

    int num;
    string str;
    cin >> num >> str;
    if(num>=3200){
        cout << str << endl;
    }else{
        cout << "red" << endl;
    }   
}


Measured memory_bytes: 256
import sys
# import collections
# import math
import string
# import bisect
# import re
# import itertools
# import statistics

def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    s = sys.stdin.readline().rstrip()
    if s[a] == '-':
        s_a, s_b = s[:a], s[a+1:]
        for i in s_a:
            if not i in string.digits:
                f_a = False
                break
        else:
            f_a = True
            for i in s_b:
                if not i in string.digits:
                    f_b = False
                    break
            else:
                f_b = True
    else:
        print('No')
        exit()
    
    print('Yes' if f_a and f_b else 'No')

if __name__ == "__main__":
    # execute only if run as a script
    main()


Measured memory_bytes: 3772
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 10000;

int a[N];

int main() {
	int n;cin>>n;
	rep(i,n) cin>>a[i];
	int ans=0;
	rep(i,n){
		int c=0;
		while(a[i]%2==0){
			c++;
			a[i]/=2;
		}
		ans+=c;
	}
	cout<<ans<<endl;
}


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

int main() {
  int N;
  cin >> N;
  
  int sum = 0;
  for (int i = 0; i < N; i++){
    int l, r;
    cin >> l >> r;
    sum += r - l + 1;
  }
  
  cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
  int n;
  cin>>n;
  ll ans=0;
  for(int i=1;i<=n-1;i++){
    int bound=sqrt(i);
    for(int j=1;j<=bound;j++){
      if(i%j==0){
        if(j*j==i) ans++;
        else ans+=2;
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3680
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int a,b;

int main(){
	cin>>a>>b;
	int res=0;
	for(int i=1;i<=1000000;i++) if(i*8/100==a&&i*10/100==b){
		res=i;
		break;
	}
	if(res==0) cout<<-1<<endl;
	else cout<<res<<endl;
}

Measured memory_bytes: 256
// Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int n;
		cin >> n;

		if(n==0)
			break;

		double b_min = 2000000.0;
		int m_min = 0;
		for(int i=0; i<n; i++){
			int m, h, w;
			cin >> m >> h >> w;

			double b = (double)(w*10000)/(double)(h*h)-22.0;
			if(b<0.0)
				b = -b;

			if(b<b_min||(b==b_min&&m<m_min)){
				b_min = b;
				m_min = m;
			}
		}

		cout << m_min << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

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;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n, k; cin >> n >> k;    // n体のモンスター, k回必殺技
    vector<ll> h(n);
    rep(i, n) cin >> h[i];
    sort(RALL(h));
    rep(i, min(k, n)) h[i] = 0;
    ll ans = 0;
    rep(i, n) ans += h[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
int main()
{
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    if(r>=1/2*H&&r<=x&&x<=W-r&&r<=y&&y<=H-r)
    printf("Yes\n");
    else
    printf("No\n");
    return 0;
}


Measured memory_bytes: 2680
#include<iostream>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(x,a) for(auto& (x):(a))
#define ALL(obj) (obj).begin(),(obj).end()
#define Yes(n) cout<<((n)?"Yes":"No")<<endl;
using namespace std;
using ll=long long;
const int INF=1e9;
const ll LINF=1e18;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int H,W;
char S[2000][2000];
int ans=0;

int U[2000][2000];
int D[2000][2000];
int L[2000][2000];
int R[2000][2000];

int main(){
  cin>>H>>W;
  char moji;
  REP(i,H){
    REP(j,W){
      cin>>moji;
      S[i][j]=moji;

    }
  }
  REP(j,W){
    U[0][j] = S[0][j]=='.' ? 1 : 0;
    D[H-1][j] = S[H-1][j]=='.' ? 1 : 0;
  }
  REP(i,H){
    L[i][0] = S[i][0]=='.' ? 1 : 0;
    R[i][W-1] = S[i][W-1]=='.' ? 1 : 0;
  }

  REP(i,H){
    REP(j,W){
      if(i!=0){
        U[i][j] = S[i][j]=='.' ? U[i-1][j]+1 : 0;
        D[H-1-i][j] = S[H-1-i][j]=='.' ? D[H-i][j]+1 : 0;
      }
      if(j!=0){
        L[i][j] = S[i][j]=='.' ? L[i][j-1]+1 : 0;
        R[i][W-1-j] = S[i][W-1-j]=='.' ? R[i][W-j]+1 : 0;
      }
    }
  }

  ans = 0;
  REP(i,H) REP(j,W) if(S[i][j]=='.') ans=max(ans, U[i][j]+D[i][j]+L[i][j]+R[i][j]-3);

  cout<<ans<<endl;

  return 0;
}

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

int main() {
    cin.tie(0)->sync_with_stdio(false);

    string key = "keyence";
    string s; cin >> s;

    bool ok = false;
    auto pos = s.find(key);
    if (pos == string::npos) {
        int n = key.size();
        REP(i, n) {
            string l = key.substr(0, i + 1);
            string r = key.substr(i + 1, n - 1);
            auto posL = s.find(l);
            auto posR = s.rfind(r);
            if (posL == 0 && posR == s.size() - r.size())
                ok = true;
        }
    } else {
        auto posL = s.find(key);
        auto posR = s.find(key);
        if (posL == 0 || posR == (s.size() - key.size()))
            ok = true;
    }

    if (ok) cout << "YES" << '\n';
    else cout << "NO" << '\n';
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int A = scan.nextInt();
    int B = scan.nextInt();

    int plus = A + B;
    int minus = A - B;
    int kakeru = A * B;

    int result = plus;

    if (result < minus) {
      result = minus;
    }
    if (result < kakeru) {
      result = kakeru;
    }

    System.out.println(result);

  }

}


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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const ll mod = 1000000007;

int compute(int n, int p){
	int ret = 1;
	while(n){
		ret += n/p;
		n /= p;
	}
	return ret;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);


	int n; cin>>n;
	ll ans = 1;
	for(int i = 2; i <= n; i++){
		int k = i; bool flg = true;
		for(int j = 2; j < k; j++){
			if(k%j == 0){
				flg = false;
				break;
			}
		}
		if(flg)(ans *= compute(n, i)) %= mod;
	}
	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int n, m;
unordered_map<pi, int> dist;
unordered_map<int, vi> e[100000];

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	cin >> n >> m;
	rep(i, m){
		int a, b, c; cin >> a >> b >> c; a--; b--;
		e[a][c].pb(b);
		e[b][c].pb(a);
	}
	set<pi> vis;
	priority_queue<tuple<int, int, int>> q;
	q.emplace(0, 0, -1);
	dist[pi(0, -1)] = 0;
	
	while(!q.empty()){
		int a, b, c; tie(c, a, b) = q.top(); q.pop();
		if(a == n - 1){
			cout << -c << endl;
			return 0;
		}
		vis.emplace(a, b);
		
		if(b >= 0){
			if(e[a].count(b)) for(int i : e[a][b]) if(!vis.count(pi(i, b)) && (!dist.count(pi(i, b))
				|| dist[pi(i, b)] > -c)) q.emplace(c, i, b), dist[pi(i, b)] = -c;
			if(!vis.count(pi(a, -1)) && (!dist.count(pi(a, -1)) ||
				dist[pi(a, -1)] > -c)) q.emplace(c, a, -1), dist[pi(a, -1)] = -c;
		}
		else for(const auto &p : e[a]) for(int i : p.second)
		if(!vis.count(pi(i, p.first)) && (!dist.count(pi(i, p.first)) ||
			dist[pi(i, p.first)] > -c + 1)) q.emplace(c - 1, i, p.first), dist[pi(i, p.first)] = -c + 1;
	}
	cout << -1 << endl;
	
	return 0;
}

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

#define ll long long
const int MOD = 1e9 + 7;
#define INF 2e9

#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

#define MATCH(_str, _ptn) regex_match(_str, regex(_ptn))
#define REPLACE(_str, _ptn, _replacement) regex_replace(_str, regex(_ptn), _replacement)

# define pb push_back

# define INIT() cin.tie(0); ios::sync_with_stdio(false); cout << fixed << std::setprecision(20)

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; }

ll l,r,d,result;
string s;
int main() {
    INIT();

    cin >> l >> r >> d;
    for(ll i = d; i <= r; i += d) {
        if(l <= i) {
            result++;
        }
    }
    cout << fixed << result;
}

Measured memory_bytes: 3604
class InputLine
  def self.to_s
    gets.chomp
  end

  def self.to_i
    InputLine.to_s.to_i
  end
  
  def self.to_f
    InputLine.to_s.to_f
  end

  def self.to_sa
    InputLine.to_s.split(' ')
  end

  def self.to_ia
    InputLine.to_sa.map(&:to_i)
  end
  
  def self.to_fa
    InputLine.to_sa.map(&:to_f)
  end
end

def main(argv)
  s = InputLine.to_s
  if s.end_with?('s') then
    puts s + 'es'
  else
    puts s + 's'
  end
end

if self.to_s == 'main' then
  main(ARGV)
end

Measured memory_bytes: 14344
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;


int main() {
    
    int N;
    long long M;
    cin >> N >> M;
    vector<long long> A(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> A[i];
    }

    map<long long,long long> m;

    vector<long long> X;
    long long s = 0;
    m[0]++;
    for ( int i = 0; i < N; i++ ) {
        s += A[i];
        s %= M;

        m[s]++;
        X.push_back(s);
    }
    sort( X.begin(), X.end() );

    long long ans = 0;
    for ( int i = 0; i < X.size(); i++ ) {
        if ( i == 0 || X[i] != X[i-1] ) {
            ans += m[X[i]]*(m[X[i]]-1)/2;
        }
    }
    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 6008
def cmb(n, r, mod):
  if ( r < 0 or r > n ):
    return 0
  r = min(r, n - r)
  return g1[n] * g2[r] * g2[n - r] % mod
 
MOD = 10 ** 9 + 7 #出力の制限
N = 10 ** 5 * 2 + 1
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
 
for i in range(2, N + 1 ):
  g1.append((g1[-1] * i) % MOD)
  inverse.append((-inverse[MOD % i] * (MOD // i) ) % MOD)
  g2.append((g2[-1] * inverse[-1]) % MOD)

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

A.sort()

answer = 0
for i in range(N):
  if i > N - K:
    break
  answer = (answer + (A[N - i - 1] - A[i]) * cmb(N - 1 - i, K - 1, MOD)) % MOD

print(answer)

Measured memory_bytes: 84464
#include <bits/stdc++.h>
#define ll long long
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define INF 10000000000000000
using namespace std;
ll i, j, k, n, x, mid, sum1 = 0, sum2 = 0, ans, l[300005], r[300005];
vector<ll> v(300005);
int main()
{
    cin >> n;
    for (i = 0; i < 3 * n; i++)
    {
        cin >> v[i];
    }
    priority_queue<int> pq;                             //max_heap for first half
    priority_queue<int, vector<int>, greater<int>> pq2; //min_heap for second half
    ll csum = 0;
    for (i = 0; i < 3 * n; i++)
    {
        pq2.push(v[i]);
        csum += v[i];
        if (pq2.size() > n)
        {
            csum -= pq2.top();
            pq2.pop();
        }
        if (pq2.size() == n)
            l[i] = csum;
        else
            l[i] = -INF; //maximum  possible sumof n numbers till ith index so,
    }                    //if i<n or pq2.size<n set it to -inf cause it is not favourable
    csum = 0;
    for (int i = 3 * n - 1; i >= 0; i--)
    {
        pq.push(v[i]);
        csum += v[i];
        if (pq.size() > n)
        {
            csum -= pq.top();
            pq.pop();
        }
        if (pq.size() == n)
            r[i] = csum;
        else
            r[i] = INF; //minimum  possible sumof n numbers till ith index from back so,
    }                   //if i<2*n or pq2.size<n set it to inf cause it is not favourable
    ll ans = -INF;
    for (i = 0; i < 3 * n - 1; i++)
    {
        ans = max(ans, l[i] - r[i + 1]); //checking at where the partition would be for maximum ans
                                         // u can also loop from n to 2*n because l[i]is -inf before n and r[i]is inf after 2*n
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 11220
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
#define PI  acos(-1)
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;

signed main(){
  int X,Y,A,B,C;cin>>X>>Y>>A>>B>>C;
  vector<int> arrA(A),arrB(B),arrC(C),ans(X+Y);
  REP(i,0,A)cin>>arrA[i];
  REP(i,0,B)cin>>arrB[i];
  REP(i,0,C)cin>>arrC[i];
  sort(ALL(arrA),greater<int>());
  sort(ALL(arrB),greater<int>());
  sort(ALL(arrC),greater<int>());
  REP(i,0,X)ans[i]=arrA[i];
  REP(i,0,Y)ans[i+X]=arrB[i];
  sort(ALL(ans));
  int idx=0;
  REP(i,0,C){
    if(arrC[i]>ans[idx]){
      ans[idx]=arrC[i];
      idx++;
    }
    else br;
  }
  
  print(sum(ans));


}


Measured memory_bytes: 3968
INF = 10**10

def chmax(a, b):
    if(a>b):
        return a
    else:
        return b

def chmin(a, b):
    if(a<b):
        return a
    else:
        return b


N, K = map(int,input().split())

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

dp = N*[INF]
dp[0]=0


for i in range(1,N):
    for j in range(1,K+1):
        dp[i] = chmin(dp[i],dp[i-j]+abs(h[i]-h[i-j]))
        if i < j:
            break

#print(dp)
print(dp[N-1])

Measured memory_bytes: 84740
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define Rep(i, s, n) for (int i = (int)s; i < (int)n; i++)
typedef long long ll;

int max(int a, int b) {
    return a > b ? a : b;
}
int max(int a, int b, int c) {
    return max(max(a, b), c);
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b;
    cin >> a >> b;
    cout << max(a+b, a-b, a*b) << endl;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<ll>::iterator sit;
typedef map<ll,ll>::iterator mit;

ll a[111111];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	if(a[n-1]!=2)
	{
		cout<<-1<<'\n';
		return 0;
	}
	ll l = 2; ll r = 2;
	for(int i=n-1;i>=0;i--)
	{
		ll mingroups = (l+a[i]-1)/a[i];
		ll maxgroups = r/a[i];
		if(mingroups>maxgroups)
		{
			cout<<-1<<'\n';
			return 0;
		}
		l = mingroups*a[i];
		r = maxgroups*a[i]+a[i]-1;
	}
	cout<<l<<' '<<r<<'\n';
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <cmath>


using namespace std;

int n;

int a_cnt[1000000 + 5];
int ft[1000000 + 5];
int t;

int main() {
    cin >> n;
    vector<int> a;
    memset(a_cnt, 0, sizeof(a_cnt));
    memset(ft, 0, sizeof(ft));
    for (int i = 0; i < n; ++i) {
        cin >> t;
        a.push_back(t);
        ++a_cnt[t];
    }
    sort(a.begin(), a.end());
    int maxnum = a[n - 1];
    for (int i = 0; i < n; ++i) {
        t = a[i];
        if (ft[t]) continue;
        for (int j = t * 2; j <= maxnum; j=j+t) {
            ft[j] = 1;
        }
    }
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        t = a[i];
        if (a_cnt[t] > 1) continue;
        if (ft[t]) continue;
        ++ans;
    }
    cout << ans << endl;
}


Measured memory_bytes: 12108
#include<iostream>
#include<algorithm>
using namespace std;
int p[200000];
long long int MOD = 1000000007;
long long modpow(long long a, long long n, long long mod);
long long modinv(long long a, long long mod);
int main() {


	//F
	long long int r1, r2, c1, c2;
	cin >> r1 >> c1 >> r2 >> c2;
	long long int sum = 0;
	int i;
	long long int c;
	c = 1;
	for (i = 1; i <= r2 + 1; i++) {
		c = c * (r2 + c2 + 3 - i);
		c = c % MOD;
		c = (c * modinv(i, MOD)) % MOD;
	}
	sum = sum + c;
	c = 1;
	for (i = 1; i <= r1; i++) {
		c = c * (r1 + c2 + 2 - i);
		c = c % MOD;
		c = (c * modinv(i, MOD)) % MOD;
	}
	sum = (sum + MOD - c) % MOD;
	c = 1;
	for (i = 1; i <= c1; i++) {
		c = c * (r2 + c1 + 2 - i);
		c = c % MOD;
		c = (c * modinv(i, MOD)) % MOD;
	}
	sum = (sum + MOD  - c) %MOD;
	c = 1;
	for (i = 1; i <= r1; i++) {
		c = c * (r1 + c1 + 1 - i);
		c = c % MOD;
		c = (c * modinv(i, MOD)) % MOD;
	}
	sum =( sum + c) % MOD;
	cout << sum << endl;
	return 0;




	//A
	/*string s, t;
	int a, b;
	string u;
	cin >> s >> t;
	cin >> a >> b;
	cin >> u;
	if (s == u) {
		a--;
	}
	else {
		b--;
	}
	cout << a << ' '<< b << endl;
	return 0;
	*/

	//B
	/*string s;
	cin >> s;
	int i;
	for (i = 0; i < s.size(); i++) {
		s[i] = 'x';
	}
	cout << s << endl;
	return 0;*/

	//C
	/*int n;
	cin >> n;
	int i;
	for (i = 0; i < n; i++) {
		cin >> p[i];
	}
	sort(p, p + n);
	for (i = 0; i < n-1; i++) {
		if (p[i] == p[i + 1]) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;*/
	//D
	/*int n, k;
	cin >> n >> k;
	int i;
	for (i = 0; i < n; i++) {
		cin >> p[i];
	}
	int max = 0;
	int sum = 0;
	for (i = 0; i < k; i++) {
		sum = sum + p[i];
	}
	max = sum;
	for (i = k; i < n; i++) {
		sum = sum + p[i] - p[i - k];
		if (sum > max)max = sum;
	}
	//cout << max + k << endl;
	double f = (double)(((double)max +(double) k) / 2);
	printf("%.10f\n", f);
	//cout << (max + k) / 2 << endl;
	return 0;
	*/
}

// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

// a^{-1} mod を計算する
long long modinv(long long a, long long mod) {
	return modpow(a, mod - 2, mod);
}

Measured memory_bytes: 3632
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //b
  int n, x;
  cin >> n >> x;
  int cur = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int l;
    cin >> l;
    if (cur <= x) ans++;
    cur = cur + l;
  }
  if (cur <= x) ans++;
  cout << ans << endl;
  return 0;
}

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

struct UnionFind {
	vector<int> par;

	UnionFind(int N) : par(N) {
		for (int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) {
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	bool issame(int x, int y) {
		return root(x) == root(y);
	}

	void merge(int x, int y) {
		int rx = root(x);
		int ry = root(y);
		if (rx == ry) return;
		par[rx] = ry;
	}
};

int main() {
	int N; cin >> N;
	vector<long long> x(N), y(N);
	for (int i = 0; i < N; i++) cin >> x[i] >> y[i];

	using P = pair<int, int>;
	using Edge = pair<long long, P>;
	vector<Edge> edges;

	vector<int> ids(N);
	for (int i = 0; i < N; i++) ids[i] = i;
	sort(ids.begin(), ids.end(), [&](int i, int j) { return x[i] < x[j]; });
	for (int i = 0; i < N - 1; i++) {
		int u = ids[i], v = ids[i + 1];
		edges.push_back(Edge(x[v] - x[u], P(u, v)));
	}
	sort(ids.begin(), ids.end(), [&](int i, int j) { return y[i] < y[j]; });
	for (int i = 0; i < N - 1; i++) {
		int u = ids[i], v = ids[i + 1];
		edges.push_back(Edge(y[v] - y[u], P(u, v)));
	}
	sort(edges.begin(), edges.end());
	
	UnionFind uf(N);
	long long ans = 0;
	for (auto e : edges) {
		int u = e.second.first, v = e.second.second;
		long long cost = e.first;
		if (uf.issame(u, v)) continue;
		uf.merge(u, v);
		ans += cost;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 8432
#include<bits/stdc++.h>
using namespace std;
     
int main()
{
    int h , w , x=0;
    cin>>h>>w;
    char a[h][w];
    
    for (int i = 0 ; i < h ; i++)
    {
        for (int j = 0 ; j < w ;j++)
        {
            cin>>a[i][j];
            if ( a[i][j] == '#' )
            {
                x++;
                
            }
        }
    }
    if ( h + w - 1 == x )
    {
        cout<<"Possible"<<endl;
        
    }
    else
    {
        cout<<"Impossible"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
S = input()
temp = ""
ans = 0
for n in range(len(S)):
  if S[n]=="A" or S[n]=="C" or S[n]=="G" or S[n]=="T":
    temp += S[n]
  else:
    if ans < len(temp):
      ans = len(temp)
    temp = ""
if ans < len(temp):
  ans = len(temp)
print(ans)

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

namespace AtCoder.Beginner091
{
    public class ABC091A
    {
        public static void Main(string[] args)
        {
            int[] nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int A = nums[0];
            int B = nums[1];
            int C = nums[2];

            Console.WriteLine((A+B>=C) ? "Yes" : "No");
        }
    }
}

Measured memory_bytes: 13396
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
static int gt(const void* pa, const void* pb)
{
const char* a=pa;
const char* b=pb;
return (int)*b-(int)*a;
}
static int lt(const void* pa, const void* pb)
{
const char* a=pa;
const char* b=pb;
return (int)*a-(int)*b;
}
int main(void)
{
char s[101], t[101];
scanf("%s%s", s,t);
qsort(s, strlen(s), sizeof(*s), lt);
qsort(t, strlen(t), sizeof(*t), gt);
if(strcmp(s,t)<0)
printf("Yes\n");
else
printf("No\n");
return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

ll ceil(ll a, ll b) {  // a÷b以上の最小の整数
    if(b == 0) {
        return 0;
    }
    return (a+b-1)/b;
}
 
int main() {
    ll n, k;
    cin >> n >> k;

    rep(i, n) {
        ll a;
        cin >> a;
    }
    
    out(1 + ceil(n-k, k-1));
    re0;
}

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

int main(){
  int N, X;
  cin >> N >> X;
  vector<int> M(N);

  for (int i = 0; i < N; i++) {
    cin >> M.at(i);
  }
  sort(M.begin(),M.end());
  X=X-accumulate(M.begin(),M.end(),0);
  cout << X/M.at(0)+N << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <bitset>
#define pb push_back 
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define INF (1<<30)
#define MOD 1000000007
using ll = long long;
using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    if (a + b == 15)cout << '+';
    else if (a*b == 15)cout << '*';
    else cout << 'x';
    return 0;
}


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


int park[11][10][10] = {{0}};
int x, y, n;

bool can_move(int x, int y){
    return (0 <= x && x <= 9) && (0 <= y && y <= 9);
}

bool solve(int x, int y, int this_sprinkler){
    if (!can_move(x, y)) return false;
    if (park[this_sprinkler][x][y] != this_sprinkler) return false;
    if (park[this_sprinkler][x][y] == n){
        return true;
/*            (can_move(x-1, y-2) && !park[1][x-1][y-2]
             or
             can_move(x, y-2)   && !park[1][x][y-2]
             or 
             can_move(x+1, y-2) && !park[1][x+1][y-2]
             or
             can_move(x-2, y+1) && !park[1][x-2][y+1]
             or
             can_move(x+2, y+1) && !park[1][x+2][y+1]
             or
             can_move(x-2, y)   && !park[1][x-2][y]
             or
             can_move(x+2, y)   && !park[1][x+2][y]
             or
             can_move(x-2, y+1) && !park[1][x-2][y+1]
             or
             can_move(x+2, y+1) && !park[1][x+2][y+1]
             or
             can_move(x-1, y+2) && !park[1][x-1][y+2]
             or
             can_move(x, y+2)   && !park[1][x][y+2]
             or
             can_move(x+1, y+2) && !park[1][x+1][y+2]);
             */
    }
    return
        (solve(x-1, y-2, this_sprinkler+1)
         or
         solve(x-2,y-2, this_sprinkler+1)
         or
         solve(x-1, y-2, this_sprinkler+1)
         or
         solve(x-2, y-1, this_sprinkler+1)
         or
         solve(x+2, y-1, this_sprinkler+1)
         or
         solve(x-2, y, this_sprinkler+1)
         or
         solve(x+2, y, this_sprinkler+1)
         or
         solve(x-2, y+1, this_sprinkler+1)
         or
         solve(x+2, y+1, this_sprinkler+1)
         or
         solve(x-1, y+2, this_sprinkler+1)
         or
         solve(x, y+2, this_sprinkler+1)
         or
         solve(x+1, y+2, this_sprinkler+1));
}

int main(){
    while (1){
        cin >> x >> y;
        if (x == 0 && y == 0) break;
        cin >> n;
        int n_ = n;
        for (int i = 0; i < 11; i++)
            for (int j = 0; j < 10; j++)
                for (int k = 0; k < 10; k++)
                    park[i][j][k] = -1;
        park[0][x][y] = 0;
        int x_, y_;
        while (n_--){
            cin >> x_ >> y_;
            for (int i = -1; i <= 1; i++)
                for (int j = -1; j <= 1; j++)
                    if (can_move(x_+i, y_+j))
                        park[n - n_][x_+i][y_+j] = n - n_;
        }

        bool result = solve(x, y, 0);
        if (result) cout << "OK" << endl;
        else cout << "NA" << endl;
    }
}

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

typedef long long ll;

using namespace std;

int A[104], B[104];

int main() {
    int n; scanf("%d",&n);
    vector<int> v(n);
    for (int i=0; i<n; i++) scanf("%d",&A[i]);
    for (int i=0; i<n; i++) scanf("%d",&B[i]);
    for (int i=0; i<n; i++) {
        v[i]=i+1;
    }
    int index1=-1, index2=-1;
    bool isTrueA=1, isTrueB=1;
    int cnt=0;
    while (index1==-1 || index2==-1) {
        // for (int i=0; i<n; i++) printf("%d ",v[i]);
        // printf("\n");
        isTrueA=1; isTrueB=1;
        for (int i=0; i<n; i++) {
            if (A[i]!=v[i]) isTrueA=0;
            if (B[i]!=v[i]) isTrueB=0;
        }
        if (isTrueA && index1==-1) index1=cnt;
        if (isTrueB && index2==-1) index2=cnt;
        cnt++;
        next_permutation(v.begin(), v.end());
    }
    // printf("%d %d\n",index1,index2);
    // printf("%d %d\n",index1,index2);
    printf("%d",abs(index1-index2));
}

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

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  int N;
  int d[100];

  cin >> N;
  REP(i, N) { cin >> d[i]; }

  int result = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      result += (d[i] * d[j]);
    }
  }

  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e9
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;
int q[200010],p[200010];
signed main(){
    int n;
    cin >> n;
    REP(i,n) {
        cin >> p[i];
        q[p[i]]=i;
    }    
    int cnt=0;
    int ans=0;
    for (int i = 1; i < n; i++)
    {
        if(q[i]<q[i+1]) cnt++;
        else {
            ans=max(ans,cnt+1);
            cnt=0;
        }
        //cerr<<ans<<endl;
    }
    ans=max(ans,cnt+1);
   cout<<n-ans<<endl;
    return 0;
}

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

int main()
{   int a,p,b;
 
    scanf("%d",&a);
   scanf("%d",&p);
    
b=a*3;

if(b+p>=3){
	printf("%d",(b+p)/2);}
else printf("0");


}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>
#include <vector>
#include <map>

using std::cout;
using std::cin;
using std::string;


int main()
{
  std::map<char, char> data;
  data['A'] = 'T';
  data['T'] = 'A';
  data['C'] = 'G';
  data['G'] = 'C';

  char value;
  cin >> value;

  cout << data[value] << "\n";

  return 0;
}


Measured memory_bytes: 256
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

from itertools import permutations
from math import factorial, hypot

#############
# Main Code #
#############

A, B = map(Decimal, input().split())
print(int(A * B))

Measured memory_bytes: 73096
#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう

#define rep(i,n) for( i=1;i<n;i++)
typedef long long  ll;
typedef long double  ld;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  ld ans=0;
  ld a,b,n;
  cin>>a>>b>>n;
  ll x=min(b-1,n);
    ld sum=floorl(a*x/b)-a*floorl(x/b);
    ans=max(ans,sum);
    cerr<<x<<sum<<endl;
  
  cout<<ans;
}

Measured memory_bytes: 3704
#include <stdio.h>
int dp[200005],a[100005];
int main(void) {
	// your code goes here
	int n,k,i;
	scanf("%d%d",&n,&k);
	for(i=1;i<=n;i++)
	scanf("%d",&a[i]);
	int j;
	for(i=0;i<=k;i++)
	{
	    if(dp[i]==0)
	    {
	        for(j=1;j<=n;j++)
	        dp[i+a[j]] = 1;
	    }
	}
	if(dp[k])printf("First\n");
	else printf("Second\n");
	return 0;
}



Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
string s;
int main(){
	cin>>s;
	if (s[0]==s[1]){
		if (s[2]==s[3]&&s[0]!=s[2]){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	else if (s[0]==s[2]){
		if (s[3]==s[1]&&s[0]!=s[1]){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	else if (s[0]==s[3]){
		if (s[2]==s[1]&&s[0]!=s[2]){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}

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

struct Process {
    string name;
    int time;
};

void print(const vector<Process> &vec) {
    for (const auto &v : vec) cout << v.name << " " << v.time << endl;
}

void simulate(queue<Process> &queue, int q) {
    int time = 0;

    while (!queue.empty()) {
        Process proc = queue.front();
        queue.pop();
        if (proc.time > q) {
            time += q;
            proc.time -= q;
            queue.push(proc);
        } else {
            time += proc.time;
            cout << proc.name << " " << time << endl;
        }
    }
}

int main() {
    int n, q;
    cin >> n >> q;

    queue<Process> queue;

    for (int i = 0; i < n; i++) {
        string name;
        int time;
        cin >> name >> time;
        queue.push({name, time});
    }

    simulate(queue, q);
}

Measured memory_bytes: 6236
#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

ll N,C,K;
ll nums[100009];
ll ans=0, cnt=0,top=LLINF;

void dep(){
    ans++;cnt=0;top=LLINF;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>N>>C>>K;
    rep(i,N) cin>>nums[i];
    
    sort(nums,nums+N);
    
    rep(i,N){
        if(top-nums[i]<-K) dep();
        cnt++;
        top=min(top,nums[i]);
        if(cnt>=C) dep();
    }
    if(cnt>0) ans++;
    cout1(ans)
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
using namespace std;

int main()
{
  long long a,b,c,d;
  cin>>a>>b>>c>>d;
  cout<<((a-c)*(b-d))<<endl;
}


Measured memory_bytes: 3648
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <set>
#define maxn 100300
#define maxm 200300
using namespace std;
inline void read(int &x) {
    char ch;
    bool flag = false;
    for (ch = getchar(); !isdigit(ch); ch = getchar())if (ch == '-') flag = true;
    for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
    x = flag ? -x : x;
}
inline void write(int x) {
    static const int maxlen = 100;
    static char s[maxlen];
    if (x < 0) {   putchar('-'); x = -x;}
    if (!x) { putchar('0'); return; }
    int len = 0; for (; x; x /= 10) s[len++] = x % 10 + '0';
    for (int i = len - 1; i >= 0; --i) putchar(s[i]);
}



int pre[maxm],now[maxn],son[maxm],tot;
int n;
int deep[maxn];

void build(int a,int b){
pre[++tot]=now[a];
now[a]=tot;
son[tot]=b;
}

int Size[maxn];
int mid;


bool dfs(int x,int fa){
Size[x]=1;
int op=0;
for (int p=now[x];p;p=pre[p])
    if (son[p]!=fa)
    {
        deep[son[p]]=deep[x]+1;
        if (dfs(son[p],x))
            op=1;
        Size[x]+=Size[son[p]];
    }
if (x==n)
    op=1;
if(  op  )
    if ( deep[n]/2+1==deep[x])
        mid=x;
return op;
}



int main(){
    read(n);
    for (int i=1;i<n;i++)
    {
        int x,y;
        read(x); read(y);
        build(x,y);
        build(y,x);
    }
    dfs(1,0);
    int tot1=0,totn=0;
    tot1=Size[1]-Size[mid];
    totn=Size[1]-tot1;
    //printf("%d  %d\n",tot1,totn);
    if (tot1>totn)
        puts("Fennec");
    else
        puts("Snuke");
	return 0;
}


Measured memory_bytes: 9216
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);
    cin>>n;
   unordered_map<int,int> um;
  int c=0;
   int x=100;
    for(int i=1;i<=x;i++)
    {
      for(int j=1;j<=(x);j++)
      {
          for(int k=1;k<=(x);k++)
          {
              int val=i*i+j*j+k*k+i*j+j*k+k*i;
              um[val]++;
          }
      }
    }
    for(int i=1;i<=n;i++)
    {
        cout<<um[i]<<endl;
    }
}


Measured memory_bytes: 4940
#include <bits/stdc++.h>
using namespace std;
// B - Tax Rate
//https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_b
int main()
{
    int N;
    cin >> N;

    double L,R;
    L = N/1.08;
    R = (N+1)/1.08;
 
    for (int i = 1; i < 50001; i++)
    {
        if (L<= i && i < R)
        {
            cout << i << endl;
            return 0;
        }
    }

    cout << ":(" << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main() {
  int N, i;
  scanf("%d", &N);
  int T[N+1];
  for (i=0; i<N; i++) {
    scanf("%d", &T[i]);
  }
 
  int M, p, x;
  scanf("%d", &M);
  for (i=0; i<M; i++) {
    scanf("%d %d", &p, &x);
    T[N]=T[p-1];
    T[p-1]=x;
 
    int sum=0, j;
    for (j=0; j<N; j++) {
      sum+=T[j];
    }
    printf("%d\n", sum);
    T[p-1]=T[N];
  }
  return 0;
}

Measured memory_bytes: 128
List_A = [list(map(int,input().split())) for i in range(3)] # [[1,2],[3,4],[5,6]]
N = int(input()) # 数字を変数に格納
List_B = [int(input()) for i in range(N)] # 複数の数字をリストに格納 # [1,2,3]

List_C = [[0,0,0] for i in range(3)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if List_B[i] == List_A[j][k]:
                List_C[j][k] = 1
                
result = 'No'

for i in range(3):
    if List_C[i][0] * List_C[i][1] * List_C[i][2] == 1:
        result = 'Yes'
    if List_C[0][i] * List_C[1][i] * List_C[2][i] == 1:
        result = 'Yes'
    if List_C[0][0] * List_C[1][1] * List_C[2][2] == 1:
        result = 'Yes'
    if List_C[0][2] * List_C[1][1] * List_C[2][0] == 1:
        result = 'Yes'

print(result)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main ()
{ 
	string a;
	cin>>a;
	if(a[2]==a[3]&&a[4]==a[5])
	{ 
		cout<<"Yes";
	} 
	else
	{ 
		cout<<"No";
	} 
	return 0;
} 

Measured memory_bytes: 256