akhauriyash/Code-Regression huggingface dataset:
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

template<typename T>
vector<T> make_vec_nd(T init, size_t size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, size_t size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

ll good_mod(ll val, ll base) {
    return (val % base + base) % base;
};

ll inv0(const vector<ll>& cnt, ll end) {
    return good_mod(cnt[end] + 2 * (end - cnt[end]), 3);
};

ll inv1(const vector<ll>& cnt, ll start, ll end) {
    return good_mod(inv0(cnt, end) - inv0(cnt, start), 3);
};

int main() {
    string S;
    string T;
    cin >> S;
    cin >> T;
    vector<ll> cnt_s(S.size() + 1);
    for (ll n = 1; n <= S.size(); n++) {
        cnt_s[n] = cnt_s[n-1] + (S[n-1] == 'A');
    }
    vector<ll> cnt_t(T.size() + 1);
    for (ll n = 1; n <= T.size(); n++) {
        cnt_t[n] = cnt_t[n-1] + (T[n-1] == 'A');
    }
    ll q;
    cin >> q;
    for (ll i = 0; i < q; i++) {
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        a--;
        c--;
        if (inv1(cnt_s, a, b) == inv1(cnt_t, c, d)) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}



Measured memory_bytes: 2432
import math
a, b, x = map(int,input().split())
if x / a == a * b / 2:
    print(45)
elif x / a > a * b / 2:
    print(math.degrees(math.atan((a * b - x / a) * 2 / a / a)))
else:
    print(math.degrees(math.atan(a * b * b / 2 / x)))

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

int main( void )
{
    int a, b;
    cin >> a >> b;
    if ( ( a * b ) % 2 == 0 )
    {
        cout << "Even" << endl;
    }
    else
    {
        cout << "Odd" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
il1 = input().split()
il2 = input().split()

K = int(il1[0])
N = int(il1[1])
A = [int(i) for i in il2]

import copy

fixed_A = copy.copy(A)

for i in A:
    fixed_A.append(i+K)

ans_list =[]

for i in range(len(A)):
    # print("i = "+str(i))
    ans_list.append(fixed_A[i+N-1] - A[i])

ans_list.sort()

print(ans_list[0])


Measured memory_bytes: 42640
#n,k=map(int,input().split())
n=int(input())
#h=list(map(int,input().split()))
abc=[]
for i in range(n):
    abc.append(list(map(int,input().split())))
dp=[]
dp.append([abc[0][0],abc[0][1],abc[0][2]])
for i in range(1,n):
    dp.append([max(dp[i-1][1]+abc[i][0],dp[i-1][2]+abc[i][0]),max(dp[i-1][0]+abc[i][1],dp[i-1][2]+abc[i][1]),max(dp[i-1][0]+abc[i][2],dp[i-1][1]+abc[i][2])])
print(max(dp[n-1]))

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> inline T bis(T ok, T ng, function<bool(T)> f, T eps = 1) { while (abs(ok - ng) > eps) { T mi = (ok + ng) / 2; (f(mi) ? ok : ng) = mi; } return ok; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int N, K;
  cin >> N >> K;
  vi32 p(N);
  cin >> p;
  vf80 sums(N + 1);
  rep(i, N) {
    sums[i + 1] = (f80) (p[i] + 1) / 2;
    sums[i + 1] += sums[i];
  }
  f80 ans = 0;
  for (int i = 0; i + K <= N; i++) {
    amax(ans, sums[i + K] - sums[i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 4224
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;

int main()
{
	int a, b;
	double S;
	cin >> a >> b;
	S = a * b / 3.305785;
	cout << fixed << setprecision(6) << S << endl;
}

Measured memory_bytes: 1236
#include "bits/stdc++.h"

#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef long long ll;

void solve() {
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif
	int n;
	cin >> n;
	VI v(100001, 0);

	int tmp, dup = 0;
	rep(i, n) {
		cin >> tmp;
		if (v[tmp] > 0) dup++;
		else v[tmp] = 1;
	}

	if (dup % 2) dup++;
	cout << n - dup << endl;

}




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


	solve();
#ifdef _WIN32
	system("PAUSE");
#endif
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
typedef long long ll;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef pair<int,int> P;

const int MOD = 1000000007;

P calc_head_tail(ll x){
  int head,tail;
  head = x%10;
  while(x){
    tail=x;
    x/=10;
  }
  P p;
  p.first= head; p.second=tail;
  return p;
}

int main(int argc, const char * argv[]) {
  ll N; cin >> N;
  map<P,ll> MAP;
  for(ll i=1;i<=N;i++){
    MAP[calc_head_tail(i)]++;
  }

  ll ans=0;
  for(int i=1;i<=N;i++){
    P p = calc_head_tail(i);
    P q(p.second,p.first);
    ans += MAP[q];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#define LINE_BUF_SIZE 1024

int main() {
  char line[LINE_BUF_SIZE];
  int n, a;
  fgets(line, sizeof(line), stdin);
  sscanf(line, "%d", &n);
  fgets(line, sizeof(line), stdin);
  sscanf(line, "%d", &a);
  printf("%d", n*n - a);
  return 0; 
}

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

#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define setbits(x) __builtin_popcount(x)
#define zerobits(x) __builtin_ctz(x)
#define setbitsll(x) __builtin_popcountll(x)
#define zerobitsll(x) __builtin_ctzll(x)
#define inf 1e18
#define ps(x,y) fixed<<setprecision(y)<<x

typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef unsigned long long ull;
typedef map<int,int> mii;

const int MOD = 1e9+7;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll a;
	long double b;
	cin >> a >> b;
	ll c = round(b*100);
	ll res = (a*c)/100;
	cout << res << '\n'; 
	return 0;
}



Measured memory_bytes: 3664
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type_a,class Type_b> void chmax(Type_a &a,const Type_b &b){if(a<b)a=b;}
template<class Type_a,class Type_b> void chmin(Type_a &a,const Type_b &b){if(a>b)a=b;}
template<class Type> Type igcd(Type x,Type y){if(x==0||y==0)return (x>y)?x:y;return (y%x)?igcd(y%x,x):x;}
template<class Type> Type ilcm(Type x,Type y){return x/igcd(x,y)*y;}
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

int main(){
	int n;
	cin>>n;
	
	vi a(n);
	REP(i,n) cin>>a[i];
	sort(ALL(a));
	
	REP(i,n-1){
		if(a[i]==a[i+1]){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	
	cout<<"YES"<<endl;
}

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll INF = 1e9+10;
const ll MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  ll n; cin>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  
  ll ans=0;
  irep(i,1,n){
    if(a[i-1]>a[i]){
      ans+=a[i-1]-a[i];
      a[i]=a[i-1];
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 4752
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn main() {
    let n = read::<usize>();
    let v = read_vec::<u32>();

    let mut max = 0;
    for i in 0..n {
        if i == 0 {
            max = v[i];
            continue;
        }
        if max > v[i] && max - v[i] > 1 {
            yn(false);
            return;
        }
        max = std::cmp::max(max, v[i]);
    }
    yn(true);
}


Measured memory_bytes: 8444
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", x);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using P = pair<int, int>;


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

	int n = s.size();
	rep (i, n) {
		if (i % 2 == !(n % 2 == 0)) continue;
		if (s.substr(0, (n - i - 1) / 2) == s.substr((n - i - 1) / 2, (n - i - 1) / 2) ){
			cout << (n - i - 1) << endl;
			return 0;
		}
	}

	return 0;
}

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

int main() {

    int n, m, s, t, sum;
    for (; ;) {
        scanf("%d", &n);
        scanf("%d", &m);
        if (n == 0 && m == 0) break;
        vector<int> G[n+1];
        int d[n+1];
        for (int i = 0; i < m; i++) {
            scanf("%d %d", &s, &t);
            G[s].push_back(t);
            G[t].push_back(s);
        }
        fill(d, d+n+1, 3);
        sum = 0;
        d[1] = 0;
        queue<int> q;
        q.push(1);
        while(!q.empty()) {
            s = q.front(); q.pop();
            if (d[s] > 1) continue;
            for (int i = 0; i < G[s].size(); i++) {
                t = G[s][i];
                if (d[t] != 3) continue;
                d[t] = d[s]+1;
                q.push(t);
                sum++;
            }
        }
        printf("%d\n", sum);
    }


    return 0;
}



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

/*------------------------------------------------------------------*/

#define ll long long int
#define mp make_pair
#define pb push_back
#define MOD 1000000007

bool isvowel(char c)
{
    if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
        return true;
        return false;
}
ll isprime(ll n)
{
    ll ans=1;
    for(ll i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
            ans = i;
    }
    return ans;
}
ll power(ll a,ll b,ll m)
{
    if(b==0)
        return 1;
    if(b==1)
        return a%m;
    ll temp=power(a,b/2,m);
    if(b%2==0)
        return ((temp%m)*(temp%m))%m;
    else
        return ((((temp%m)*(temp%m))%m)*a%m)%m;
}

/*-----------------------------------------------------------------------------*/

ll c(ll n, ll k)
{
    ll C[n + 1][k + 1];
    ll i, j;

    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {

            if (j == 0 || j == i)
                C[i][j] = 1;

            else
                C[i][j] = (C[i - 1][j - 1]%MOD +
                          C[i - 1][j])%MOD;
        }
    }
    return C[n][k]%MOD;
}
ll modInverse(ll a, ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {

        ll q = a / m;
        ll t = m;
        m = a % m, a = t;
        t = y;


        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
ll func(ll n)
{
    ll ans=0;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            if(i/10==0)
                ans+=1+func(i)*func(n/i);
            else
                ans+=func(i)*func(n/i);
        }
    }
    return ans;
}
ll dp[2001][2001];
ll check(vector<pair<ll,ll> >v,ll l,ll r,ll i)
{ 
   //cout<<l<<" "<<r<<endl;
   if(l>r)
    return 0; 
   if(dp[l][r]!=-1)
    return dp[l][r]; 
   ll ans=0;
   ll p1=v[i].first;
   ll p2=v[i].second;
   ans=max(p1*(p2-l)+check(v,l+1,r,i+1),p1*(r-p2)+check(v,l,r-1,i+1));
   return dp[l][r]=ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);

    //freopen("1.txt","rt",stdin);
    //freopen("output.txt","wwt",stdout);

    ll t;
    t=1;
    //cin>>t;
    //ll t1=0;
    while(t--)
    {
      string s;
      cin>>s;
      ll q;
      cin>>q;
      ll strt=0,end=1,rev=0;
      vector<char>v[2];
      while(q--)
      {
          //cout<<strt<<" "<<end<<endl;
          ll p;
          cin>>p;
          if(p==1)
          {  
            rev++;  
            swap(strt,end);
          }
          else
          {
              ll f;
              cin>>f;
              char c;
              cin>>c;
              if(f==1)
               v[strt].pb(c);
              else
               v[end].pb(c);   
          }
      }
      string ans="";
      for(ll i=v[strt].size()-1;i>=0;i--)
       ans+=v[strt][i];
      if(rev%2)
      {
          for(ll i=s.length()-1;i>=0;i--)
           ans+=s[i];
      }
      else
      {
          for(ll i=0;i<s.length();i++)
           ans+=s[i];
      }
      for(ll i=0;i<v[end].size();i++)
       ans+=v[end][i];
      cout<<ans;  
    }
}


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

using namespace std;

int main() {
    string S; cin>>S;
    char s[4];

    int ans=INT_MAX;
    for (int i=0;i<S.size()-3+1;i++) {
        s[0] = S[i];
        s[1] = S[i+1];
        s[2] = S[i+2];
        s[3] = '\0';

        int x = atoi(s);
        ans = min(ans, abs(753 - x));
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <iomanip>

typedef long double ld;
typedef long long ll;

using namespace std;

ll MOD = ((ll)1e9 + 7);

struct mod {
	ll x;

	mod(ll tx = 0) {
		x = tx;
	}
	
	mod& operator=(const ll & tx) {
		x = tx;
		return *this;
	}
	
	mod& operator=(const mod & m2) {
		x = m2.x;
		return *this;
	}

	mod operator+(const mod& m2) const {
		return (x + m2.x) % MOD;
	}

	mod& operator+=(const mod& m2) {
		x += m2.x;
		x %= MOD;
		return *this;
	}

	mod operator-(const mod & m2) const {
		return (x - m2.x + MOD) % MOD;
	}

	mod& operator-=(const mod & m2) {
		x -= m2.x;
		x = (x + MOD) % MOD;
		return *this;
	}

	mod operator*(const mod & m2) const {
		return (x * m2.x) % MOD;
	}

	mod& operator*=(const mod & m2) {
		x *= m2.x;
		x %= MOD;
		return *this;
	}

	mod mypow(ll k) const {
		mod ret = 1;
		mod cur = x;
		while (k) {
			if (k & 1) {
				ret *= cur;
			}
			cur *= cur;
			k >>= 1;
		}
		return ret;
	}

	mod inv() const {
		return mypow(MOD - 2);
	}

	mod operator/(const mod & m2) const {
		return mod(((*this).x * (*this).inv().x) % MOD);
	}

	mod& operator/=(const mod & m2) {
		x *= m2.inv().x;
		x %= MOD;
		return *this;
	}

	bool operator<(const mod & m2) const {
		return x < m2.x;
	}
};

ostream &operator<<(ostream & os, const mod & m) {
	return os << m.x;
}

/* TEMPLATE ENDS HERE */

#define MAXN (1 << 10)

int a[MAXN];

int main() {
	cout << fixed << setprecision(12);	
	int n, t;
	cin >> n;
	for (int i = 1; i < n; i++) {
		cin >> t;
		if (i == 1) {
			a[0] = t;
			a[1] = t;
		} else {
			a[i - 1] = min(a[i - 1], t);
			a[i] = t;
		}
	}
	int sum = 0;
	for (int i = 0; i < n; i++) {
		sum += a[i];
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 3592
//
// Created by yamunaku on 2019/09/15.
//

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> mti;
typedef vector<ll> vl;
typedef vector<vector<ll>> mtl;

int main(){
    int n;
    string s;
    cin >> n >> s;
    mti dp(n+1,vi(n+1,0));
    int ma=0;
    rep(i,n){
        rep(j,n){
            dp[i+1][j+1]=(s[i]==s[j]?dp[i][j]+1:0);
            ma=max(ma,min(dp[i+1][j+1], abs(i-j)));
        }
    }
    cout << ma << endl;
    return 0;
}


Measured memory_bytes: 98176
#include<stdio.h>

int main(void){
	int N,a,b,c,esc,count,count1;
	scanf("%d",&N);
	for(count=0;count<N;count++){
		scanf("%d %d %d",&a,&b,&c);
		for(count1=0;count1<2;count1++){
			if(a>b){
				esc=b;
				b=a;
				a=esc;
			}
			if(b>c){
				esc=c;
				c=b;
				b=esc;
			}
		}
		if(a*a+b*b==c*c){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

Measured memory_bytes: 576
#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <map>
#include <queue>
#include <unordered_map>
#include <bitset>
#include <unordered_set>
#include <stack>
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define eps 1e-7
#define inf 0x3f3f3f3f
#define mod 1000000007
using namespace std;

int main() {
	speed;
	string s;
	cin >> s;
	int ans = inf;
	for (int i = 0; i < s.size() - 2; ++i) {
		string v = s.substr(i, 3);
		ans = min(ans, abs(753 - atoi(v.c_str())));
	}
	cout << ans;
}

Measured memory_bytes: 384
n=gets.to_i
a=gets.split.map(&:to_i)
i=j=xor=ans=0

while (j < n)
	while(xor&a[j] > 0 && i < j)
		xor^=a[i]
		i+=1
	end
	xor^=a[j]
	j+=1
	ans+=j-i
end
p ans

Measured memory_bytes: 15364
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		if (A%2==1 && B%2==1)
			System.out.println("Yes");
		else
			System.out.println("No");
	}

}


Measured memory_bytes: 21844
#include<cstdio>
#include<algorithm>
#include<cstring>
#define ll long long
using namespace std;
int n,w[105];
ll f[3005];
int main()
{
	scanf("%d%d%d%d",&w[1],&w[2],&w[3],&n);
	f[0]=1;
	for(int i=1;i<=3;i++)
	  for(int j=w[i];j<=n;j++)
	    f[j]+=f[j-w[i]];
	printf("%lld\n",f[n]);
	return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        int[][] A = new int[n][m];
        int[] B = new int[m];
        int[] ans = new int[n];
        
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                A[i][j]=sc.nextInt();
            }
        }
        for(int i=0;i<m;i++){
            B[i]=sc.nextInt();
        }
        
        for(int i=0;i<n;i++){
            int a=0;
            for(int j=0;j<m;j++){
               a+=A[i][j]*B[j];
            }
            System.out.println(a);
        }
    }
}



Measured memory_bytes: 40344
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;
ll A,B,C;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>A>>B>>C;
    if(A%2==0||B%2==0||C%2==0){
        cout <<0<<"\n";
    }
    else{
        ll x[3];
        x[0]=A;
        x[1]=B;
        x[2]=C;
        sort(x,x+3);
        cout <<x[0]*x[1]<<"\n";
    }
}

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

void solve()
{
	for(int i = 1; i < 10; ++i)
	{
		for(int j = 1; j < 10; ++j)
		{
			cout << i << "x" << j << "=" << i * j << endl;
		}
	}
}

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

Measured memory_bytes: 1116
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
//const int N = 1000000;
const ll mod = 1000000007;
//using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dh[8] = {0, 0, 1, 1, 1, -1, -1, -1};
const int dw[8] = {1, -1, 0, 1, -1, 0, 1, -1};
  
ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * (B / gcd(A, B));
}
using Graph = vector<vector<int>>;
Graph G;
  
/*------------------------------------------------------------------*/
string str(int m, char s){
    string re = "";
    rep(i, m) re += s;
    return re;
}

int main(){
    int sx, sy, tx, ty; cin >> sx >> sy >> tx >> ty;
    vector<char> c{'U', 'D', 'L', 'R'};
    int dx = tx - sx;
    int dy = ty - sy;
    
    cout << str(dy, c[0]) << str(dx, c[3]) << str(dy, c[1]) << str(dx, c[2]) 
         << str(1, c[2]) << str(dy + 1, c[0]) << str(dx + 1, c[3]) << str(1, c[1])
         << str(1, c[3]) << str(dy + 1, c[1]) << str(dx + 1, c[2]) << str(1, c[0])
         << endl; 
}

Measured memory_bytes: 256
import 'dart:io';

void main() {
  List abcd = stdin.readLineSync().split(" ").map((x) => int.parse(x)).toList();
  int ans;

  int preAns;
  if ((abcd[2] > abcd[1]) || (abcd[0] > abcd[3])) {
    ans = 0;
  } else {
    int ac = (abcd[0] > abcd[2]) ? abcd[2] : abcd[0];
    int bd = (abcd[3] > abcd[1]) ? abcd[3] : abcd[1];
    preAns = (bd - ac) - (abcd[0] - abcd[2]).abs() - (abcd[1] - abcd[3]).abs();
    ans = (preAns <= 0) ? 0 : preAns;
  }
  print(ans);
}

Measured memory_bytes: 13108
#include <stdio.h>
#include <algorithm>
int n, t;
long long x, y;
long long c[3000], a[3000], b[3000];
long long dp[3000];
long long ans;
int main() {
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n; i++) {
		scanf("%lld%lld", &x, &y);
		c[i] = x * 4000 + y;
	}
	std::sort(c, c + n);
	for (int i = 0; i < n; i++) {
		a[i] = c[i] / 4000;
		b[i] = c[i] % 4000;
	}
	for (int i = 0; i < n; i++) {
		for (int j = t - 1; j >= 0; j--) {
			if (ans < dp[j] + b[i]) {
				ans = dp[j] + b[i];
			}
			if (j + a[i] < 3000) {
				if (dp[j + a[i]] < dp[j] + b[i]) {
					dp[j + a[i]] = dp[j] + b[i];
				}
			}
		}
	}
	printf("%lld\n", ans);
}

Measured memory_bytes: 256
#include <stdio.h>          // printf(), getc()
#include <stdbool.h>

const char NUL = '\0';

bool
ope_line()
{
	char oline[101];
	const char letter[6][5] = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "};

	int c = getc(stdin);
	if (c == EOF)
		return false;

	if (c == '\n')
		return true;

	bool b_na = false;
	int ix = 0;
	while (c != '\n' && c != EOF)
	{
		int s = c - '1';

		c = getc(stdin);
		if (c == '\n' || c == EOF)
		{
			b_na = true;
			break;
		}

		int t = c - '1';
		if (0 <= s && s <= 5 && 0 <= t && t <= 4)
			oline[ix++] = letter[s][t];
		else
			b_na = true;

		c = getc(stdin);
	}

	if (b_na)
		printf("NA\n");
	else
	{
		oline[ix] = NUL;
		printf("%s\n", oline);
	}

	if (c == EOF)
		return false;

	return true;
}

int
main(int argc, char **argv)
{
	while (true)
	{
		if (!ope_line())
			break;
	}

	return 0;
}

Measured memory_bytes: 1652
/**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAjRXBpYiMraXh4bWl6bWJwI2J3I1BxYSNrem1pYmN6bWEjSWEsI0ptbnd6bSN3eiNJbmJteiN3eiNKbXBxdmwjYnBtdTEjVnd6I2FwaXR0I2JwbXwja3d1eGlhYSNJY29wYiN3biNwcWEjc3Z3ZXRtbG9tI017a214YiNpYSNQbSNlcXR0bWJwMSNQcWEjYnB6d3ZtI2x3YnAjbXtibXZsI1dkbXojYnBtI3BtaWRtdmEjSXZsI3d2I21pemJwLyNpdmwjUG0jbm1tdG1icCNWdyNuaWJxb2NtI3F2I29jaXpscXZvI0l2bCN4em1hbXpkcXZvI2JwbXUvI053eiNQbSNxYSNicG0jVXdhYiNQcW9wMSNCcG0jQWN4em11bSMrcXYjb3R3enwsMQ==
*/
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back

const long long MOD = 1e9 + 7;
const long long MAXN = 1e6 + 1;
using namespace std;

typedef long long ll;

long long readInt() {
    bool minus1 = false;
    long long result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus1 = true; else result = ch-'0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus1)
        return -result;
    else
        return result;
}

int main() {
	#ifdef IZI_KATKA
	//freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
	string s;
	cin >> s;
	int ans = 0;
	int res = 0;
	int sum = 0;
	for (char c : s) {
		if (c != '0') { 
			ans++;
			res = c - '0';
		}
		sum += c - '0';
	}
	if (ans >= 2) {
		cout << sum << endl;
	} else {
		cout << (s.size() == 1 ? res : 10 + res - 1);
	}
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < n; i++)
#define P pair<ll, ll>

typedef vector<ll> vec;
typedef vector<vec> mat;

int main(){
    ll n;
    cin >> n;
    ll a[n];
    ll num[100001];
    ll sm = 0;
    rep(i, 100001) num[i] = 0;
    rep(i, n){
        cin >> a[i];
        num[a[i]]++;
        sm += a[i];
    }
    ll q;
    cin >> q;
    ll ans[q];
    rep(i, q){
        ll b, c;
        cin >> b >> c;
        sm = sm - b * num[b] + c * num[b];
        num[c] += num[b];
        num[b] = 0;
        ans[i] = sm;
    }
    // cout << sm << endl;
    rep(i, q){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 5876
import collections

n=int(input())
arr=[[] for _ in range(n+1)]
for i in range(n-1):
  u,v,w=map(int,input().split())
  arr[u].append([v,w])
  arr[v].append([u,w])
m,p=map(int,input().split())
q=collections.deque([p])
check=[False for _ in range(n+1)]
check[p]=True
d=[0 for _ in range(n+1)]
while 1:
  if len(q)==0:
    break
  tmp=q.popleft()
  for i,j in arr[tmp]:
    if check[i]==False:
      check[i]=True
      d[i]=d[tmp]+j
      q.append(i)
for i in range(m):
  u,v=map(int,input().split())
  print(d[u]+d[v])

Measured memory_bytes: 50824
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int):
    if N % 10 == 9 or N // 10 == 9:
        ret = YES
    else:
        ret = NO
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


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

int main() {
    int n,k;
    scanf("%d%d",&n,&k);
    if(k % 2 == 1) {
        ll ans = 1;
        int c = n / k;
        rep(i,3) {
            ans *= c;
        }
        printf("%ld\n",ans);
        return 0;
    } else {
        ll ans = 0,x = 1,y = 1,counter = 0;
        int c = n / k;
        rep(i,3) {
            x *= c;
        }
        ans += x;
        int h = k / 2;
        for(int i = 1; i <= n; i++) {
            if(i % k == h) {
                counter++;
            }
        }
        rep(i,3) {
            y *= counter;
        }
        ans += y;
        printf("%ld\n",ans);
        return 0;
    }
}

Measured memory_bytes: 256
using System;

namespace abc146A
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string S = Console.ReadLine();
            switch (S)
            {
                case "SUN":
                    Console.WriteLine(7);
                    break;
                case "MON":
                    Console.WriteLine(6);
                    break;
                case "TUE":
                    Console.WriteLine(5);
                    break;
                case "WED":
                    Console.WriteLine(4);
                    break;
                case "THU":
                    Console.WriteLine(3);
                    break;
                case "FRI":
                    Console.WriteLine(2);
                    break;
                case "SAT":
                    Console.WriteLine(1);
                    break;
            }
        }
    }
}


Measured memory_bytes: 11104
q, h, s, d = map(int, input().split())
n = int(input())

q4 = 4*q
h2 = 2*h

minimum = min(q4, h2, s)

ans = 0
tmp = n//2
tmp2 = n % 2

ans += tmp * d
ans += tmp2 *minimum

ans2 = minimum * n

print(min(ans, ans2))

Measured memory_bytes: 9192
<?php
  
 	fscanf(STDIN, "%d %d", $a, $b);
	$standard = $a - 1;
    $min = $b - $standard;
    $max = $b + $standard;

    for ($i = $min; $i <= $max; $i++) {
       $hoge[] = $i;
    }
	$space_separated = implode(" ", $hoge);
    echo $space_separated . "\n";

  
  ?>

Measured memory_bytes: 3828
#include <memory.h>

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

#define mod 1000000007

long long int getpow(int x, int n) {
	if (n == 0) return 1;
	long long int tmp = getpow(x, n / 2);
	long long int res = (tmp * tmp) % mod;
	if (n % 2 == 1) res = (res * x) % mod;
	return res;
}

int main() {
	int n;
	cin >> n;
	int a[10000];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	map<int, int> maxcnt;
	for (int i = 0; i < n; i++) {
		int tmp = a[i];
		for (int j = 2; j * j <= a[i]; j++) {
			if (a[i] % j > 0) continue;
			int cnt = 0;
			while (tmp % j == 0) {
				cnt++;
				tmp /= j;
			}
			if (maxcnt.find(j) == maxcnt.end()) {
				maxcnt[j] = cnt;
			} else {
				maxcnt[j] = max(maxcnt[j], cnt);
			}
		}
		if (tmp > 1 && maxcnt.find(tmp) == maxcnt.end()) {
			maxcnt[tmp] = 1;
		}
	}
	long long int k = 1;
	for (auto itr = maxcnt.begin(); itr != maxcnt.end(); itr++) {
		k = (k * getpow((*itr).first, (*itr).second)) % mod;
	}
	long long int ans = 0;
	for (int i = 0; i < n; i++) {
		ans = (ans + ((k * getpow(a[i], mod - 2)) % mod)) % mod;
	}
	cout << ans << endl;
}

Measured memory_bytes: 768
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    //dp[i] = max(dp[i-1],dp[i-wi]+vi);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int[] array = new int[N];

        HashMap<Integer,Integer> map = new HashMap<>();
        for (int i = 0; i< array.length; i++) {
            array[i] = sc.nextInt();
            map.putIfAbsent(array[i],0);
            map.put(array[i], map.get(array[i]) + 1);
        }
        int max = 0 ;
        for (Integer key : map.keySet()) {
            int cnt = map.get(key);
            if (map.containsKey(key-1)) {
                cnt += map.get(key -1);
            }

            if (map.containsKey(key+1)) {
                cnt += map.get(key + 1);
            }

            max = Math.max(max, cnt);
        }


        System.out.println(max);

        sc.close();

    }

}


Measured memory_bytes: 61620
function Main(input){
	input=input.trim().split("\n");
	let x, y, tmp;
	for (let i = 0; i < (input.length - 1); i++){
		tmp = input[i].split(" ");
		x = parseInt(tmp[0], 10);
		y = parseInt(tmp[1], 10);
		if (x > y){
			[x, y] = [y, x];
		}
		console.log("%d %d", x, y);
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



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

int cp(const void *a,const void *b){
  return *(int*)a-*(int*)b;
}

int main(void){
  int a[10],num,index;
  int flag=1,min=125;
 // scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
  for(int i=0;i<5;i++){
    scanf("%d",&a[i]);
    if(a[i]%10!=0 && a[i]%10<min) {
      min=a[i]%10;
      index=i;
      num=a[i];
    }
  }
  int sum=num;
  for(int i=0;i<5;i++){
    if(a[i]!=num || index!=i){
      while(1){
        if(a[i]%10==0)break;
        else a[i]++;
      }
      sum+=a[i];
    }
  }
  printf("%d",sum);
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){
	double x1,y1,x2,y2;
	cin>>x1>>y1>>x2>>y2;
	double x=fabs(x2-x1);
	double y=fabs(y2-y1);
	cout<<fixed<<setprecision(4)<<sqrt(x*x+y*y)<<endl;
	return 0;
}

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

#define N 500000
#define INF 1000000000

int L[N], R[N];
int count = 0;

void merge(int A[], int left, int mid, int right)
{
  int n1, n2, i, j, k;

  n1 = mid - left;
  n2 = right - mid;

  for(i = 0; i < n1; i++) L[i] = A[left + i];
  for(i = 0; i < n2; i++) R[i] = A[mid + i];

  L[n1] = INF;
  R[n2] = INF;

  i = 0;
  j = 0;

  for(k = left; k < right; k++){
    if(L[i] <= R[j]){
      A[k] = L[i];
      i++;
    }
    else{
      A[k] = R[j];
      j++;
    }
    count++;
  }
}

void mergeSort(int A[], int left, int right)
{
  int mid;

  if(left + 1 < right){
    mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main(void)
{
  int i, n, A[N];

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%d", &A[i]);
  }

  mergeSort(A, 0, n);

  for(i = 0; i < n; i++){
    if(i) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
  printf("%d\n", count);

  return 0;
}



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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define collect(arr, size) rep(i,size) cin >> arr[i];
#define int long long

signed main(){
    int K, S;
    cin >> K >> S;
    int pattern = 0;
    rep(X,K+1)rep(Y,K+1){
        int Z = S - X - Y;
        if(0 <= Z && Z <= K) pattern++;
    }
    cout << pattern << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int gcd(long long a,long long b){
	if(b==0){
		return a;
	}
	return(gcd(b,a%b));
}


 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	vector<vector<int>>v;
	int a;
	for(int i=0;i<n;i++){
		vector<int>x;
		for(int j=0;j<2;j++){
			cin>>a;
			x.push_back(a);
		}
		v.push_back(x);
		x.clear();
	}
	int c=0;
	
	for(int i=0;i<n;i++){
		int count=0;
		if(v.at(i).at(0)==v.at(i).at(1)){
			for(int j=i+1;j<n;j++){
				if(v.at(j).at(0)==v.at(j).at(1)){
					count+=1;
				}else{
					break;
				}
				if(count==2){
					c=1;
					break;
				}
			}
			if(c==1){
				break;
			}
		}
	}
	if(c==1){
		cout<<"Yes"<<"\n";
	}else{
		cout<<"No"<<"\n";
	}
	





	







		

		

	
	

	
	
	







	 

	
	

	



	

	



	


 
	
	
	
	
	return 0;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Multiplication3 | diff Multiplication3.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Multiplication3.cpp && ./a.out

/*

 5/31/2020

 5:05-5:07 WA
 5:15 AC

 */

LL A;
string B;

void solve() {
  if(SZ(B)==1) B.push_back('.');
  while(SZ(B)<4) B.push_back('0');
  LL b=(B[0]-'0')*100+(B[2]-'0')*10+B[3]-'0';
  LL res=A*b/100;
  cout<<res<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;

  cin>>A>>B;
  solve();

  return 0;
}


Measured memory_bytes: 3648
import itertools

N, M = map(int, input().split())
ab = list(list(map(int,input().split())) for _ in range(M))

# 辺が存在する箇所にフラグ1を置く
edge = [[0 for _ in range(N)] for _ in range(N)]
for idx in range(M):
    edge[ab[idx][0]-1][ab[idx][1]-1] = 1
    edge[ab[idx][1]-1][ab[idx][0]-1] = 1


# 頂点1から始まる全通りのパスについて実現可能かを調べる
path = list(range(2,N+1))
path = list(itertools.permutations(path))
ans = 0

for out_idx in range(len(path)):
    path[out_idx] = (1,) + path[out_idx]
    miss_flg = 0
    for in_idx in range(1, len(path[out_idx])-1):
        if edge[path[out_idx][in_idx-1]-1][path[out_idx][in_idx]-1] == 0 or edge[path[out_idx][in_idx]-1][path[out_idx][in_idx+1]-1] == 0:
            miss_flg = 1
            break
    if miss_flg == 0:
        ans += 1

print(ans)

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

using namespace std;

#define PI 3.14159265359

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

    double a, b ,h ,m;

    cin >> a >> b >> h >> m;


    double u1 = m * 6.0;

    while(u1 > 360)
        u1-=360;


    double u2 = h * 30.0;
    u2 += m * 0.5;

    while(u2 > 360)
        u2 -=360;



    if(u1 > u2)
        swap(u1,u2);

        double u;

    if(u1 + 180 < u2)
         u = u1 + 360 - u2;
    else
      u = u2 - u1;





    cout << fixed << setprecision(13) << sqrt(a * a + b * b - 2 * a * b * cos(u * PI / 180.0));
    return 0;
}


Measured memory_bytes: 4232
import sys
input = sys.stdin.readline
import numpy as np

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

dp=np.array([[0]*(W+1) for _ in range(N+1)],dtype='int64')

for i in range(1,N+1):
    w,v=map(int,input().split())

    if w<=W:
        dp[i][w:]=np.maximum(dp[i-1][w:],dp[i-1][:W-w+1]+v)
        dp[i][:w]=dp[i-1][:w]
    else:
        dp[i]=dp[i-1]

print(dp[N][W])

Measured memory_bytes: 170444
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    s = tuple(map(int, sys.stdin.readline().strip()))

    n = len(s)
    k = n
    for i in range(1, n):
        if s[i - 1] != s[i]:
            k = min(k, max(i, n - i))

    print(k)

if __name__ == '__main__':
    main()


Measured memory_bytes: 4084
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;

int main(void)
{
    int n, k;
    cin >> n >> k;
    int a[n];
    REP(i, n)
    {
        cin >> a[i];
    }
    long long max = 0;
    long long cur = 0;
    REP(i, k)
    {
        max += a[i] + 1;
        cur += a[i] + 1;
    }
    for (int i = 1; i + k <= n; i++)
    {
        cur += a[i + k - 1];
        cur -= a[i - 1];
        if (cur > max)
            max = cur;
    }
    double ans = max * 0.5;
    printf("%.16f\n", ans);
}

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

using namespace std;

int N;
long long arr[20][20];
long long pre[1<<20];
long long dp[1<<20];

int main(){
    cin >> N;
    for(int i = 0; i<N; i++){
        for(int j = 0; j<N; j++){
            cin >> arr[i][j];
        }
    }
    for(int i = 0; i<(1<<N); i++){
        for(int j = 0; j<N; j++){
            if(i&(1<<j)){
                for(int k = 0; k<N; k++){
                    if(i&(1<<k)){
                        dp[i] += arr[j][k];
                    }
                }
            }
        }
        dp[i] /= 2;
    }
    for(int i = 0; i<1<<N; i++){
        for(int j = ((j-1)&i); j>0; j = ((j-1)&i)){
            dp[i] = max(dp[i], dp[j]+dp[j^i]);
        }
    }
    cout << dp[(1<<N)-1] << endl;
}


Measured memory_bytes: 768
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
                int B = sc.nextInt();
                int C = sc.nextInt();
                int D = sc.nextInt();

                if(A<=C && C<=B) {
                  if(A<=D && D<=B){
                    System.out.println(D-C);
                  }else{
			System.out.println(B-C);
                  }
		}
                else if(C<=A && A<=D){
                  if(C<=B && B<=D){
                    System.out.println(B-A);
                  }else{
			System.out.println(D-A);
                  }
		}
                else{
                       System.out.println("0");
                }
	}
}

Measured memory_bytes: 23636
// luogu-judger-enable-o2
#include<iostream>
#include<cmath>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	for(int i=0;i<=1000;i++){
		if(a*i%b==c){
			cout<<"YES"<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
}

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

int comp(const void *p1,const void *p2){
  int n1,n2;
  n1=*(const int *)p1;
  n2=*(const int *)p2;
  return n1-n2;
}

int main(void){
  int N,L[200];
  int i,j,k;
  scanf("%d",&N);
  N*=2;
  for(i=0;i<N;i++) scanf("%d",L+i);
  
  qsort(L,N,sizeof(L[0]),comp);
  k=0;
  for(i=0;i<N;i+=2) k+=L[i];
  printf("%d\n",k);
  return 0;
}



Measured memory_bytes: 128