akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

//-------------------------------------

struct UnionFind
{
    vector<int> par;

    UnionFind(int n) : par(n, -1) {}
    void init(int n) { par.assign(n, -1); }

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

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

    bool merge(int x, int y)
    {
        x = root(x);
        y = root(y);
        if (x == y)
            return false;
        if (par[x] > par[y])
            swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x)
    {
        return -par[root(x)];
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<int> x(m), y(m), z(m);
    for (int i = 0; i < m; i++)
    {
        cin >> x[i] >> y[i] >> z[i];
        x[i]--;
        y[i]--;
    }
    UnionFind uf(n);
    for (int i = 0; i < m; i++)
    {
        uf.merge(x[i], y[i]);
    }
    set<int> st;
    for (int i = 0; i < n; i++)
    {
        st.insert(uf.root(i));
    }
    cout << st.size() << endl;
}

Measured memory_bytes: 6528
import java.lang.Math;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
      	final int N = scanner.nextInt();
      	int count = 0;
		int max = 0;
      	for (int i = 0; i < N; i++) {
        	final int h = scanner.nextInt();
          	if (h >= max) {
            	count++;
              	max = h;
            }
        }

       	System.out.println(count);
    }
}

Measured memory_bytes: 21844
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int N=305;

typedef long long LL;

int n,f[N][N][N],m,ans,la[N][26];

char S[N];

int main()
{
	scanf("%s%d",S+1,&m);
	n=strlen(S+1);
	for (int i=1;i<=n;i++)
	{
		S[i]-='a';
		for (int j=0;j<26;j++) la[i][j]=(S[i]==j)?i:la[i-1][j];
	}
	f[0][0][0]=n+1;
	for (int i=0;i<n;i++)
	{
		for (int j=0;j<=min(i,m);j++)
		{
			for (int k=0;k<=i;k++) if (f[i][j][k]>i)
			{
				ans=max(ans,k*2);
				if (f[i][j][k]-1>i) ans=max(ans,k*2+1);
				f[i+1][j][k]=max(f[i+1][j][k],f[i][j][k]);
				f[i+1][j][k+1]=max(f[i+1][j][k+1],la[f[i][j][k]-1][S[i+1]]);
				if (j<m) f[i+1][j+1][k+1]=max(f[i+1][j+1][k+1],f[i][j][k]-1);
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 108800
import sys
def input():
    return sys.stdin.readline()[:-1]

s=input()
t=input()
import collections
dic={}
lim={}
mod=len(s)
for ind,i in enumerate(s):
    if i not in dic:
        dic[i] = []
        lim[i] = 0
    dic[i].append(ind)
    lim[i] += 1
now=0
cnt=0
ok = True
#print(dic)
import bisect
for i in t:
    if i not in dic:
        ok=False
        break
    ed = bisect.bisect_left(dic[i],now)
    if ed == lim[i]:
        cnt+=1
        now = dic[i][0]+1
    else:
        now = dic[i][ed]+1
    #print(now)
if ok==True:
    print(mod*cnt+now)
else:
    print(-1)


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

int main() {
  string s;
  cin >> s;
  if (s.at(0) == s.at(1) || s.at(1) == s.at(2) || s.at(2) == s.at(3)) {
    cout << "Bad" <<endl;
  }
  else {
    cout << "Good" <<endl;
  }
}


Measured memory_bytes: 256
#アルゴリズムの実装
def insertionSort(A, N):
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print(" ".join(map(str, A)))

#入力dataの挿入
input_N = int(input())
input_A = list(map(int, input().split()))
print(" ".join(map(str, input_A)))

#処理の実行
insertionSort(input_A, input_N)



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

int main(){
    int n, m;
    cin >> n >> m;
    vector<int> a(m);
    int sum = 0;
    rep(i, m){
         cin >> a[i];
         sum += a[i];
    }
    int l = n - sum;
    if(l >= 0){
        cout << l << endl;
    }else{
        cout << -1 << endl;
    }
    return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
/*
g++ -std=c++11 -Wall -g -fsanitize=undefined -D_GLIBCXX_DEBUG abc/abc118/a.cpp
*/
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define SZ(x) ((int)(x).size())
#define INF (1e16)
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    if(b % a == 0){
        cout << a + b << "\n";
    }else{
        cout << b - a << "\n";
    }
    return 0;
}

Measured memory_bytes: 256
N, M = list(map(int, input().split()))
if N>M:
    N, M = M, N

if N==1 and M==1:
    print(1)
    exit()
if N==1:
    print(M-2)
    exit()
if N==2:
    print(0)
    exit()
print((N-2)*(M-2))


Measured memory_bytes: 2940
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		for(int i = 1; i <= 9; i++) {
			for(int j = 1; j <= 9; j++) {
				if(i*j == n) {
					System.out.println("Yes");
					return;
				}
			}
		}
		
		System.out.println("No");
		
	}

}


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

string s;
int a, b, c, d;

string solve();

int main() {
  while(1) {
    cin >> s;
    if(s == "#") break;
    cin >> a >> b >> c >> d;
    --a, --b, --c, --d;
    cout << solve() << endl;
  }
  return 0;
}

string solve() {
  int cntsls = 1, now = 0;
  vector<string> v;
  for(int i = 0; i < s.size(); ++i)
    if(s[i] == '/') ++cntsls;
  v.resize(cntsls);
  for(int i = 0; i < s.size(); ++i) {
    if(s[i] == 'b')
      v[now] += 'b';
    else if(s[i] == '/')
      ++now;
    else
      for(char j = '0'; j < s[i]; ++j) v[now] += '.';
  }
  swap(v[a][b], v[c][d]);
  string ans;
  for(int i = 0; i < cntsls; ++i) {
    int nowsize = v[i].size(), cnt = 0, id = 0;
    while(1) {
      if(id == nowsize) break;
      if(v[i][id] == 'b') {
        ans += 'b';
        ++id;
        continue;
      }
      cnt = 0;
      while(id < nowsize && v[i][id] != 'b') ++cnt, ++id;
      ans += '0' + cnt;
    }
    if(i != cntsls - 1) ans += '/';
  }
  return ans;
}


Measured memory_bytes: 3020
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N,A,B = MI()
    x = N//(A+B)
    c = N%(A+B)

    if c>A:
        c = A

    print(x*A+c)


if __name__ == "__main__":
	main()

Measured memory_bytes: 3064
import numpy as np

N = int(input())

#print(1e+5)
ans = np.zeros(int(1e+5),dtype = int)
for x in range(1,int(N**0.5+1)):
  for y in range(x,int((N-x**2)**0.5+1)):
    for z in range(y,int((N-x**2-y**2)**0.5+1)):
      n = x**2 + y**2 + z**2 +x*y+y*z+z*x
      num = len({x,y,z})
      if num == 1:
        ans[n] += 1
      elif num == 2:
        ans[n] += 3
      elif num == 3:
        ans[n] += 6

for i in range(1,N+1):
  print(ans[i])

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

int main() {
  string s,t;
  cin>>s>>t;
  int count=0;
  for(int i=0;i<s.size();i++){
    if(s.at(i)!=t.at(i)) count++;
  }
  cout<<count<<endl;
}


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

#define precise(n,k) fixed<<setprecision(k)<<n

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int d, n;
    
    cin >> d >> n;
    
    if(d == 0) {
        int ans = 0;
        int tmp = 0;


        for(int i = 1; ; ++i) {
            
            if(i % 100 != 0) {
                ans++;
            }
            
            if(ans == n) {
                tmp = i;
                break;
            }
        }
        
        cout << tmp << endl;


        
        return 0;
    }
    
    int ans = 0;
    int tmp = 1;
    int x = 1;
    
    if(d == 1) {
        x = 100;
    } else if(d == 2) {
        x = 10000;
    }
    
    for(int i = 1; ; ++i) {
        tmp = i*x; 
        
        if(d == 1) {
            if(tmp != 10000) ans++;
        } else if(d == 2) {
            if(tmp != 1000000)ans++;
        }
        
        if(ans == n) break;
    }
   
    cout << tmp << endl;
 
   return 0;
}

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

int main() {
    string a, b, c;
    cin >> a >> b >> c;
    cout << char(toupper(a[0])) << char(toupper(b[0])) << char(toupper(c[0]))
         << endl;

    return 0;
}


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

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

  ll n;
  cin >> n;

  ll MOD = 998244353;

  vector<ll> d(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }

  vector<ll> dc(n, 0);  // indexが距離, valが個数
  for (int i = 0; i < n; i++) {
    int dist = d[i];

    dc[dist]++;
  }

  ll ans = 1;
  for (int i = 0; i < n; i++) {
    int dist = d[i];

    if (i == 0 && dc[dist] == 1) {
      continue;
    } else if (i == 0 && dc[dist] != 1) {
      ans = 0;
      break;
    }

    int prevD = dist - 1;

    if(prevD < 0) {
      ans = 0;
      break;
    }

    ll prevc = dc[prevD] % MOD;

    if (prevc == 0) {
      ans = 0;
      break;
    }

    ans = (prevc * ans) % MOD;
  }

  cout << ans % MOD << endl;

  return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define Size 100005
#define Mod 1000000007LL
int main(){
    int x;
    cin>>x;
    string s1,s2,st;
    cin>>s1>>s2;
    int ln1= s1.size();
    int ln2 = s2.size();
    int i = 0,j=0;
    while(i<ln1 || j<ln2){
        st+=s1[i];
        st+=s2[j];
        i++,j++;
    }
    cout<<st<<"\n";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
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; }

int n, m;

int main() {
    cin >> n >> m;
    if (n == m) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int i_max(int arr[],int n){
    int MAX=arr[0];
   int  i1=0,i2=0;
    for (int i= 0;i<n;i++)
    {
        if (arr[i]>MAX)
        {
            MAX =arr[i];
            i1=i;
            i2=i;
        }
        else if (arr[i]==MAX)
        {
            i2=i;
        }
   }
    return max(i1,i2);
}
int i_min(long long int arr[],int n,int& i1,int& i2){
    long long int min=arr[0];
    i1=0;
    i2=0;
     for (int i= 0;i<n;i++)
     {
         if (arr[i]<min)
         {
             min =arr[i];
             i1=i;
             i2=i;
         }
         else if (arr[i]==min)
         {
             i2=i;
         }
    }
     return max(i1,i2);
}

int main (){
    // two magical lines to speed up IO
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int k,x,i;
    cin >>k>>x;
    i=x+1-k;
    while(i<x+k){
        cout << i<<" ";
        i++;
    }
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,k,x;
  cin>>n>>k>>x;
  vi A(n);
  for(int i=0;i<k;i++){
    A[i]=x;
  }
  if(x==INF){
    for(int i=k;i<n;i++){
      A[i]=INF-1;
    }
  }else{
    for(int i=k;i<n;i++){
      A[i]=INF;
    }
  }
  for(auto a:A)cout<<a<<" ";
  cout<<endl;
  return 0;
}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	int N;
	cin >> N;
	vector<pair<int,string>> S;
	for (int i = 0; i < N; ++ i) {
		string s;
		cin >> s;
		S.push_back({(int)s.length(), s});
	}
	sort(S.begin(), S.end());
	map<ll, int> hoge;
	ll ans = 0;
	for (const auto& pp : S) {
		int n = pp.first;
		const string& s = pp.second;
		vector<int> a(n+1);
		for (int j = 0; j < n; ++ j) {
			a[j+1] = a[j] | (1 << (s[j]-'a'));
		}
		ll hh = 0;
		for (int j = n-1; j >= 1; -- j) {
			auto it = hoge.find(hh);
			if (it != hoge.end()) {
				ans += __builtin_popcount(it->second & a[j+1]);
			}
			hh = 37 * hh + s[j];
		}
		hoge[hh] |= (1 << (s[0]-'a'));
	}
	cout << ans << endl;
}


Measured memory_bytes: 19672
# ABC123 A

def main():

    antennas = []
    for _ in range(5):
        char = int(input())
        antennas.append(char)
    
    k = int(input())
    result = 'Yay!'
    
    for antenna in antennas[::-1]:
        if antenna - antennas[0] > k:
            result = ':('
            break
    
    print(result)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {
            final int n = scanner.nextInt();

            System.out.println(countOfSumCombination(n));
        }
    }

    static int countOfSumCombination (int value) {
        int count = 0;
        for (int a = 0; a <= 9; a++) {
            for (int b = 0; b <= 9; b++) {
                for (int c = 0; c <= 9; c++) {
                    for (int d = 0; d <= 9; d++) {
                        if (a + b + c + d == value) {
                            count++;
                        }
                    }
                }
            }
        }

        return count;
    }

}

Measured memory_bytes: 26392
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=200010;
//const ll mod=1e9+7;
const ll mod = 998244353;

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

vector<ll> inv,fact,invfact;
void mod_build(int n){  
  fact.resize(n+1); inv.resize(n+1); invfact.resize(n+1);
  fact[0]=inv[0]=invfact[0]=1; inv[1]=1;
  rep(i,n){
    fact[i+1]=fact[i]*(i+1)%mod;
    if(i>0)inv[i+1]=mod-inv[mod%(i+1)]*(mod/(i+1))%mod;
    invfact[i+1]=invfact[i]*inv[i+1]%mod;
  }
}
ll perm(int n,int k){ if(n<0||k<0||k>n){ return 0; } else { return fact[n]*invfact[n-k]%mod; } }
ll comb(int n,int k){ if(n<0||k<0||k>n){ return 0; } else { return (fact[n]*invfact[n-k]%mod)*invfact[k]%mod; }}
ll modpow(ll n,ll k){
  k%=mod-1; if(k<0)k+=mod-1;
  ll ret=1; while(k){ if(k&1)ret=ret*n%mod; n=n*n%mod; k>>=1; }
  return ret;
}
ll modinv(ll a){ return modpow(a, mod-2); }


int main(){
  mod_build(mx);
  string s;
  cin >> s;
  int n = s.size();
  vector<int> sumr(4010,0);
  vector<vector<mint>> dp(4010, vector<mint>(4010,0));
  rep(i,n){
    int tmp = 0;
    if(s[i]=='0'){ tmp=2; } else if(s[i]=='1'){ tmp=1; }
    sumr[i+1] = sumr[i]+tmp;
  }

  dp[0][0] = 1;
  rep(i,n)rep(j,i+1){
    if(dp[i][j].x == 0) continue;
    if(sumr[i+1] >= j+1){
      dp[i+1][j+1] += dp[i][j];
    }
    if((i+1)*2-sumr[i+1] >= i+1-j){
      dp[i+1][j] += dp[i][j];
    }
  }

  mint ans = 0;
  rep(i,n+1){
    ans += dp[n][i]*comb(n,sumr[n]-i);
  }
  cout << ans.x << endl;
  return 0;
}


Measured memory_bytes: 130944
#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<list>
#include<map>
#include<vector>

using namespace std;


#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define ll long long
#define MOD 1000000007

#define IMIN INT_MIN;
#define IMAX INT_MAX;


int main(){
    string S;
    cin >> S;
    int acnt=0, bcnt=0;
    rep(i, S.size()) {
        if(S[i] == 'A') acnt++;
        else bcnt++;
    }
    if (acnt == 2 || acnt == 1) cout << "Yes" << endl;
    else cout << "No" << endl;


	return 0;
}


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

int main()
{
	int K, N, d;
  
		cin >> N;
		cin >> K;

		if (K == 1)
		{
			cout << 0;
		}
		else
		{
			d = N - K;

			cout << d;
		}
  
	return 0;
}

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

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

  deque<int> a(m), idx;

  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    if (a[i] & 1) idx.push_back(i);
  }

  if ((n & 1) + idx.size() >= 3) {
    puts("Impossible");
    return 0;
  }

  idx.resize(2);
  swap(a[idx[1]], a[0]);
  swap(a[idx[0]], a.back());

  for (int i = 0; i < m; ++i) cout << a[i] << endl;

  if (m == 1) a.push_back(0);
  a[0]--;
  a.back()++;
  if (a[0] == 0) a.pop_front();

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


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#define MAX 10000

int main(){
  int i,j,n,q,c,key,cnt = 0;
  int S[MAX],T[MAX];
  
  scanf("%d",&n);
  if(n>=10001) exit(1);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  
  scanf("%d",&q);
  if(q>=501) exit(2);
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }

  for(i=0;i<q;i++){
    for(j=0;j<n;j++){
      if(S[j] == T[i]){
	cnt++;
	break;
      }
    }
  }

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



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

#define ll unsigned long long
#define inf 1e18
#define mod 1e9+7
#define w(x) int x; cin >> x; while(x--)
#define sp(x, y) fixed << setprecision(y) << x;
#define pb push_back


const int maxn = 1e6;
const ll mx = 1e18;

long double a, b;
void solve() {
    cin >> a >> b;
    b *= 1000;
    cout << sp(floor((a * b) / 1000), 0);
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    solve();
    return 0;
}



Measured memory_bytes: 3764
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        System.out.println(n-k+1);
        // System.out.println("XXXXXXXX");
    }
}


Measured memory_bytes: 21716
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
	int n, a, b, c;
	cin >> n >> a >> b >> c;
	vector<int> l(n);
	for (int i = 0; i < n; i++)cin >> l[i];
	int x = pow(4, n);
	int ret = 1145141919;
	for (int i = 0; i < x; i++)
	{
		int aa = 0, bb = 0, cc = 0, uni = n;
		for (int j = 0; j < n; j++)
		{
			int k = pow(4, j);
			switch (i / k % 4)
			{
			case 1:
				{
					aa += l[j];
					break;
				}
			case 2:
				{
					bb += l[j];
					break;
				}
			case 3:
				{
					cc += l[j];
					break;
				}
			default:
				{
					uni--;
					break;
				}
			}
		}
		if (aa * bb * cc == 0)continue;
		ret = min(ret, abs(a - aa) + abs(b - bb) + abs(c - cc) + (uni - 3) * 10);
	}
	cout << ret << endl;
	return 0;
}


Measured memory_bytes: 384
//Radhe Radhe
#include<bits/stdc++.h>
#define godspeed  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod 1000000007
#define ll long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define en '\n'
#define rep(i,n)    for(ll i=0; i<n; i++)
#define rep1(i,a,b)    for(ll i=a; i<=b; i++)
#define repVect(i,n)    for(ll i=0; i<sum.size(); i++)
#define fixed cout.setf(ios::fixed);
#define Precise cout.precision(7);
#define yes cout<<"Yes"<<'\n'
#define no cout<<"No"<<'\n'
using namespace std;

int main()
{
    godspeed
   ll  n,i,j;
    string s;
    cin>>n;
    ll a[n],b[n];
    for(i=0; i<n; i++)
        cin>>a[i]>>b[i];


    for(i=0; i+2<n; i++)
    {
        if(a[i]==b[i]&&a[i+1]==b[i+1]&&a[i+2]==b[i+2])
            return yes,0;
    }

no;
    return 0;
}






Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;





int N;
ll a[405];
ll prefsum[405];
ll dp[405][405]; // dp[L][R] = {minimum cost for segment [L, R]

ll dfs(int L, int R) {
    ll& res = dp[L][R];
    if (res == -1) {
        if (L >= R) {
            res = 0;
        } else if (L+1 == R) {
            res = a[L] + a[L+1];
        } else {
            res = 1e18;
            for (int i = L; i+1 <= R; ++i) {
                ll leftcost = dfs(L, i);
                ll leftsize = prefsum[i] - prefsum[L-1];
                ll rightcost = dfs(i+1, R);
                ll rightsize = prefsum[R] - prefsum[i];
                ll totalcost = leftcost + rightcost + (leftsize + rightsize);
                res = min(res, totalcost);
            }
        }
    }
    return res;
}

void Main() {
    cin >> N;
    for (int i = 1; i <= N; ++i) {
        cin >> a[i];
    }
    prefsum[0] = 0;
    for (int i = 1; i <= N; ++i) {
        prefsum[i] = prefsum[i-1] + a[i];
    }
    memset(dp, -1, sizeof(dp));
    ll ans = dfs(1, N);
    cout << ans << '\n';
}

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


Measured memory_bytes: 1536
import java.util.Scanner

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner(System.in)
  val N, X = sc.nextInt
  val xs = Seq.fill(N)(Math.abs(sc.nextInt - X))

  @tailrec def gcd(a: Int, b: Int): Int =
    if (b == 0) a else gcd(b, a % b)

  println(xs.foldLeft(xs.head) { (acc, next) => gcd(acc, next) })
}


Measured memory_bytes: 54396
#include <bits/stdc++.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
int gcd(int a,int b){return b ? gcd(b,a%b) : a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}

main() {
    string S,P; cin >> S >> P;
    bool can = false;
    S+=S;
    rep(i,S.size()-P.size()){
        if(S.substr(i, P.size())==P)
        can = true;
    }
    if(can) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3212
#include <iostream>
#include <string>

using namespace std;

int main()
{
	long long a;
	string s;
	cin >> a >> s;
	
	long long b = 0;
	b += (s[0] - '0') * 100;
	b += (s[2] - '0') * 10;
	b += (s[3] - '0');
	long long ans = a * b;
	cout << ans / 100 << endl;

	return 0;
}

Measured memory_bytes: 3628
<?php
/*
 * ぐぬぬーーー
 * YES → Yes
 * NO → No
 * 
 * 間違いーーーー！！！
 */
$cnt = fgets(STDIN);

$x = array();
$y = array();
$t = array();
for ($i = 1; $i <= $cnt; $i++) {
    fscanf(STDIN, "%d %d %d", $t[], $x[], $y[]);
}

$is_possible = true;
for ($i = 0; $i < $cnt; $i++) {
    if ($i > 0) {
        $distance = abs($x[$i] - $x[$i - 1]) + abs($y[$i] - $y[$i - 1]);
        $dt = $t[$i] - $t[$i - 1];
    } else {

        $distance = abs($x[$i]) + abs($y[$i]);
        $dt = $t[$i];
    }
    if ($dt < $distance) {
        $is_possible = false;
        break;
    }
    if ($distance % 2 !== $dt % 2) {
        $is_possible = false;
        break;
    }
}
if ($is_possible) {
    echo 'Yes';
} else {
    echo 'No';
}


Measured memory_bytes: 47092
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        new Program().Calc();
    }

    Scanner cin;

    public Program() { }

    bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }

    void Calc()
    {
        cin = new Scanner();

        int X = cin.nextInt();
        int A = cin.nextInt();

        WriteLine((X<A)? 0:10);
    }
}

public static class StringExtension
{
    public static char GetChar1(this string str, int indexOneBase)
    {
        return str[indexOneBase - 1];
    }
}

class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


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

int main()
{
  string S;
  cin>>S;
  int cnt = 0;
  char prev = S[0];
  for(int i = 1; i<3; i++)
  {
      //cout<<prev<<"\t"<<S[i]<<endl;
      if(prev == S[i] && S[i] == 'R')
        cnt++;
      prev = S[i];
  }
  int r_counter = 0;
  for(char x: S)
  {
      if(x == 'R') r_counter++;
  }
  //cout<<r_counter<<endl;
  if(r_counter>0)
    cout<<cnt+1<<endl;
  else cout<<cnt<<endl;
  return 0;
}

Measured memory_bytes: 3616
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    static int N;

    public static void main(String[] args) throws IOException {
        FastScanner sc = new FastScanner(System.in);
        N = sc.nextInt();

        PrintWriter pw = new PrintWriter(System.out);
        solve( i -> {
            pw.println(i);
            pw.flush();
            return sc.next().charAt(0);
        });

        sc.reader.close();
        pw.close();
        System.exit(0);
    }

    interface Query {
        char run(int i);
    }

    static void solve(Query q) {
        char c = q.run(0);
        if( c == 'V' ) return;

        int from = 1;
        int to = N-1;

        for (int i = 0; i < 19; i++) {
            // M2M型かM1F型に分類される
            // M2M -> M1?2M or M2?1M
            // M1?2M -> M1M2M or M1F2M
            // M2?1M -> M2M1M or M2M1M
            // M1F -> M2?2F or M1?1F
            // M2?2F -> M2M2F or M2F2F
            // M1?1F -> M1M1F or M1F1F
            // それぞれの場合で M2MかM1Fが存在するのでそちらに分岐していく

            int qi = (from + to)/2;
            char qc = q.run(qi);
            if( qc == 'V' ) return; // ok

            boolean mm = (c == qc);
            boolean even = (qi - from) % 2 == 0;
            if( mm && even || !mm && !even ) {
                to = qi-1;

            } else {
                from = qi+1;
                c = qc;
            }
        }

        // 21回目で死ぬと思われる
        q.run(0);
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


Measured memory_bytes: 28960
# Problem B - Touitsu

# input
N = int(input())
A = list(input())
B = list(input())
C = list(input())

# initialization
min_count = 0
cur_char = ''

# string search
for i in range(N):
    tmp = []
    tmp.append(A[i])
    tmp.append(B[i])
    tmp.append(C[i])
    tmp = set(tmp)

    if len(tmp)>=3:
        min_count += 2
    elif len(tmp)==2:
        min_count += 1

# output
print(min_count)


Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;


int main(){
    ll N, M;
    cin >> N >> M;
    vector<ll> A(M);
    REP(i, M) cin >> A[i];
    ll res = N;
    REP(i, M) res -= A[i];
    if (res < 0) res = -1;
    cout << res << "\n";
}


Measured memory_bytes: 3684
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
int main(){
  ll a,b,c;cin>>a>>b>>c;
  ll e=a*b*c,f=max(a,max(b,c));
  ll g=e/f;
  if(e%2==0)cout<<0;
  else cout<<min(min(a*b,a*c),b*c);
}


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

using namespace std;
typedef long long ll;
#define int ll

template<typename T1,typename T2> inline void chmin(T1 &a, T2 b){ if(a > b) a = b; }
template<typename T1,typename T2> inline void chmax(T1 &a, T2 b){ if(a < b) a = b; }

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
const int MAX_N = 100010;

template< typename T >
class CumulativeSum
{
public:
    CumulativeSum() {}
    CumulativeSum(int sz) : m_Data(sz, T(0)) {};

    void Init(int sz) { m_Data.assign(sz, T(0)); }

    // k に x を加える O(1)
    void Add(int k, T x) {
        assert(static_cast<int>(m_Data.size()) >= k);
        if(static_cast<int>(m_Data.size()) <= k) { m_Data.push_back(x); }
        else { m_Data[k] = (m_Data[k] + x); }
    }

    // 累積和の構築 O(m_Data.size())
    void Build() {
        for(int i = 1; i < static_cast<int>(m_Data.size()); i++) {
            m_Data[i] = (m_Data[i] + m_Data[i - 1]);
        }
    }

    // 区間 [0, k] の和を返す O(1)
    // 閉区間なので k が含まれることに注意
    T Query(int k) {
        if(k < 0) { return T(0); }
        return (m_Data[min(k, static_cast<int>(m_Data.size()) - 1)]);
    }

    // 区間 [l, h] の和を返す O(1)
    // 閉区間なので k が含まれることに注意
    T Query(int l, int h) {
        return (this->Query(h) - this->Query(l-1));
    }
private:
    vector< T > m_Data;
};


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

    string S;
    cin >> S;

    reverse(S.begin(), S.end());

    // [0, i] で表される数を 2019 で割ったあまり
    vector<int> mod(S.length());
    mod[0] = S[0] - '0';
    int mul = 10;
    for(int i = 1; i < S.length(); ++i) {
        int num = S[i] - '0';
        num = (num * mul) % 2019;
        mod[i] = (mod[i-1] + num) % 2019;
        mul *= 10;
        mul %= 2019;
    }

    // 数字 i の出現数
    vector<int> cnt(2100, 0);

    int ans = 0;
    for(int i = 0; i < S.length(); ++i) {
        ans += cnt[mod[i]];
        if(mod[i] == 0) { ans++; }
        cnt[mod[i]]++;
    } 
    printf("%lld\n", ans);

    return 0;
}



Measured memory_bytes: 5068
//abc099_c.cpp
//Sun Jun 10 20:59:34 2018

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
using ll=long long;

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

	int ans = n;

	for (int i=0;i<=n;i++){
		int payment = 0;
		int t = i;
		while (t>0){
			payment = payment + t%6;
			t = t/6;
		}
		t = n-i;
		while (t>0){
			payment = payment + t%9;
			t = t/9;
		}
		if (payment < ans){
			ans = payment;
		}
	}


	cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            out.println(in.next().startsWith("YAKI") ? "Yes" : "No");
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

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

    }
}



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

typedef long long ll;
const ll INF = 1010000000000000017LL;
const ll MOD = 1000000007LL;

#define REP(i, n) for(ll i = 0 ; i < n; i++)

//#define DEBUG(fmt, ...)
#define DEBUG(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)

bool isPalindrome(string s){
    string r = s;
    reverse(r.begin(), r.end());
    return r == s;
}

int main(){
    std::cout<<std::fixed<<std::setprecision(10);

    string S;
    cin >> S;

    string s1 = S.substr(0, (S.size()-1)/2);
    string s2 = S.substr(S.size()/2+1, (S.size()-1)/2);

    if( isPalindrome(S) && isPalindrome(s1) && isPalindrome(s2)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

}


Measured memory_bytes: 256
n,k=map(int, input().split())
R,S,P=map(int, input().split())
t=list(input())
aite=[]
tetuple=('r','s','p')
def kati(te,ans):
  if te=='r':
    ans+=P
  elif te=='s':
    ans+=R
  else:
    ans+=S
  return ans
for _ in range(k):
  aite.append([])
for i in range(n):
  aite[i%k].append(t[i])
ans=0
for i in range(k):
  ans=kati(aite[i][0],ans)
  for j in range(1,len(aite[i])):
    if aite[i][j]!=aite[i][j-1]:
      ans=kati(aite[i][j],ans)
    else:
      for m in range(3):
        if j!=len(aite[i])-1 and aite[i][j]==aite[i][j+1]==tetuple[m]:
          aite[i][j]=tetuple[(m+1)%3]
        elif j!=len(aite[i])-1 and aite[i][j]!=aite[i][j+1] and aite[i][j]!=tetuple[m] and aite[i][j+1]!=tetuple[m]:
          aite[i][j]=tetuple[m]
print(ans)

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

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int _i=(first);_i<(last);++_i){cout<<#a<<"["<<_i<<"] = "<<(a)[_i]<<endl;}
#define PRINTI(a,i)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<#i<<"] = "<<#a<<"["<<(i)<<"] = "<<(a)[i]<<endl;
#define dprintf(...) printf(__VA_ARGS__)
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#define PRINTI(a,i)
#define dprintf(...)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define MOD 1000000007
//#define MOD 998244353

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

template <class T, class U>
std::ostream& operator<<(std::ostream &os, const std::pair<T, U> &p) {
	os << "(" << p.first << ", " << p.second << ")";
	return os;
}
 
template <class T>
std::ostream& operator<<(std::ostream &os, const std::vector<T> &v) {
    os << "[";
	for (int i = 0; i < v.size(); ++i) {
        if (i) {
            if (i % 5 == 0) {
                os << ",\n ";
            } else {
                os << ", ";
            }
        }
		os << v[i];
	}
	os << "]";
	return os;
}

template <class T>
using vec2 = vector<vector<T>>;

template <class T>
using vec3 = vector<vector<vector<T>>>;

template <class T>
vec2<T> vec2_init(int n0, int n1, T x = 0) {
    return vec2<T>(n0, vector<T>(n1, x));
}

template <class T>
vec3<T> vec3_init(int n0, int n1, int n2, T x = 0) {
    return vec3<T>(n0, vec2_init(n1, n2, x));
}

/*
 *           U P
 *           - x
 *            ^
 *            |
 * LEFT -y <--+--> +y RIGHT
 *            |
 *            v
 *           + x
 *         D O W N
 */

const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

enum {
    DOWN,
    RIGHT,
    UP,
    LEFT,
};

constexpr double inf = numeric_limits<double>::infinity();

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

    int N;
    cin >> N;
    vector<int> x(N), y(N), xpy(N), xmy(N);
    REP(i, N) {
        cin >> x[i] >> y[i];
        xpy[i] = x[i] + y[i];
        xmy[i] = x[i] - y[i];
    }
    sort(all(xpy));
    sort(all(xmy));

    ll result = 0;

    REP(i, N) {
        amax(result, xpy[i] - xpy[0]);
        amax(result, -xpy[i] + xpy[N - 1]);
        amax(result, xmy[i] - xmy[0]);
        amax(result, -xmy[i] + xmy[N - 1]);
    }

    cout << result << endl;

    return 0;
}


Measured memory_bytes: 6368
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>

using namespace std;

#define mod 1000000007

int main()
{
	int n, k;
	cin >> n >> k;
	long long int a[100001];
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	// sum[i] : a[0] ~ a[i - 1]までの和
	// sum_only_pos : a[0] 〜 a[i - 1]までのうち正整数のみの和
	long long int sum[100001] = {}, sum_only_pos[100001] = {};
	for(int i = 1; i <= n; i++){
		sum[i] = sum[i - 1] + a[i - 1];
		sum_only_pos[i] = sum_only_pos[i - 1];
		if(a[i - 1] > 0) sum_only_pos[i] += a[i - 1];
	}
	long long int ans = 0;
	for(int i = 0; i + k <= n; i++){
		long long int left = sum_only_pos[i];
		long long int right = sum_only_pos[n] - sum_only_pos[i + k];
		long long int mid = sum[i + k] - sum[i];
		// cout << i << " " << left << " " << mid << " " << right << endl;
		ans = max(ans, left + right + max((long long int)0, mid));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll n;
cin >> n;
set<string> a;
for(int i = 0; i < n; i++){
    string s;
    cin >> s;
    a.insert(s);
}
cout << a.size() << endl;
}

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

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

    int n = s.size();
    bool isEasy = true;
    rep (i, n)
        if (((i + 1) % 2 == 1 && s[i] == 'L') || (i + 1) % 2 == 0 && s[i] == 'R')
            isEasy = false;

    if (isEasy)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string to_string(const string& s) {
	return '"' + s + '"';
}
string to_string(const bool b) {
	return (b ? "true" : "false");
}
string to_string(const char* s) {
	return to_string((string)s);
}
string to_string(const char c) {
	string s = "'";
	s += c;
	s += "'";
	return s;
}
template<class T, class U>
string to_string(const pair<T, U>& p) {
	string s = "(";
	s += to_string(p.first);
	s += ", ";
	s += to_string(p.second);
	s += ")";
	return s;
}
template<class T>
string to_string(const T& a) {
	bool first = true;
	string s = "{";
	for (const auto& x : a) {
		if(!first){
			s += ", ";
		}
		first = false;
		s += to_string(x);
	}
	s += "}";
	return s;
}
void debug_out() {cerr << '\n';}
template<class Head, class... Tail>
void debug_out(Head head, Tail... tail) {
	cerr << ' ' << to_string(head);
	debug_out(tail...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "] = ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const int inf = 1e9 + 100;
const ll inf64 = 7e18l;
const double PI = acos(-1);
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(20);
	ld a, b, x;
	cin >> a >> b >> x;
	ld ang;
	x /= a;
	debug(x);
	if (a * b / 2 >= x) {
		ld y = 2 * x / b;
		debug(y);
		ang = 180 * atanl(y / b) / PI;
	} else {
		ld y = 2 * x / a - b;
		ang = 180 * atanl(a / (b - y)) / PI;
	}
	cout << 90 - ang << '\n';
 	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, const char * argv[]) {
    int a[11],i=0;
    while(scanf("%d",&a[i])!=EOF){
        if(a[i]==0){
            while(1){
                i--;
                if(a[i]!=0){
                    printf("%d\n",a[i]);
                    a[i]=0;
                    break;
                }
            }
        }
        i++;
    }
    
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define ll long long
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define VAR(v, i) __typeof( i) v=(i)
#define forit(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
 
using namespace std;
 
const int maxn = (int)1e5 + 10;
const int maxM = (int)1.5e7 + 100;
const int mod = (int)1e9 + 7;
const int P = (int) 1e6 + 7; 
const double pi = acos(-1.0);
 
#define inf mod
 	
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;   
typedef vector<ll> Vll;               
typedef vector<pair<int, int> > vpii;
typedef vector<pair<ll, ll> > vpll;                        
typedef array<int, 3> triple;

void solve(){
	int x;
	cin >> x;
	if(400 <= x && x <= 599){
		puts("8");
	}
	if(600 <= x && x <= 799){
		puts("7");
	}
	if(800 <= x && x <= 999){
		puts("6");
	}
	if(1000 <= x && x <= 1199){
		puts("5");
	}
	if(1200 <= x && x <= 1399){
		puts("4");
	}
	if(1400 <= x && x <= 1599){
		puts("3");
	}
	if(1600 <= x && x <= 1799){
		puts("2");
	}
	if(1800 <= x && x <= 1999){
		puts("1");
	}
}

main () {
	int t = 1;
	//cin >> t;
	while(t--)
		solve(); 
}	    

Measured memory_bytes: 3640
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <string>
#include <limits>
#include <algorithm>
#include <map>

using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;

using namespace std;

int main()
{
  ll A, B;
  cin >> A >> B;
  if ((A * B) % 2 == 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256