akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define int long long
const int MOD=1e9+7;
const int N=3e5+10;
int32_t main()
{
	IOS;
	int n;
	cin>>n;
	map<string,int>mp;
	for(int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		mp[s]++;
	}
	int mx=0;
	vector<string>vp;
	for(auto it:mp)
	{
		if(mx<it.ss)
			mx=it.ss;
	}
	for(auto it:mp)
	{
		if(mx==it.ss)
			vp.pb(it.ff);
	}
	sort(all(vp));
	for(auto it:vp)
		cout<<it<<endl;

	
}

Measured memory_bytes: 25584
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main(){
    long double N,K;
    long double S = 0;
    cin >> N >> K;
    for(int i = 1;i <= N;i++){
        long double T = i;
        long double c = 1.0/N;
        while(true){
            if(T < K){
                T *= 2;
                c /= 2;
            }else{
                break;
            }
        }
        S += c;
    }
    cout <<fixed<<setprecision(12)<< S << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string.h>
#include <iomanip>
using namespace std;
#define int long long
#define ull unsigned long long
#define F first
#define S second
#define nl "\n"
#define ld long double
#define div 1000000007
#define pi 3.14159265358979323846

int power(int a,int b,int p)
{
    if(b==0)
        return 1;
    else if(b%2==0)
        return power((a*a)%p,b/2,p);
    else
        return (a*power((a*a)%p,(b-1)/2,p))%p;
}

void solve()
{
    string s;cin>>s;
    int n=s.length();
    int p=2019;
    map<int,int> d;
    d[0]=1;
    int r=0;
    for(int i=0;i<n;i++)
    {
        int x=s[i]-'0';
        r=r+x*power(10,n-1-i,p);
        r%=p;
        d[r]++;
    }
    int ans=0;
    for(auto it:d)
        ans+=(it.second)*(it.second-1)/2;
    cout<<ans<<nl;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

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


Measured memory_bytes: 3812
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
# print(a,v)
# print(b,w)
# print(t)

dl = abs(a-b)
dv = v-w # 鬼のほうが速い？＋
# print(dl,dv)
if dl == 0:
    print('YES')
else:
    if dv > 0:
        # print(dl//dv)
        if (dl+dv-1)//abs(dv) <= t:
        # if dl//dv <= t:
            print('YES')
        else:
            print('NO')
    else:
        print('NO')


Measured memory_bytes: 9184
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb emplace_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define dame(a) {out(a);return 0;}
#define decimal cout<<fixed<<setprecision(15);
#define dupli(a) erase(unique(all(a)),a.end())
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
typedef multiset<ll> S;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vp=vector<P>;
using vvp=vector<vp>;
using vb=vector<bool>;
using vvb=vector<vb>;
const ll inf=1001001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
void outs(ll a,ll b){if(a>=inf-100)out(b);else out(a);}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*modpow(a,b-1)%mod;ll k=modpow(a,b/2);return k*k%mod;}

int main(){
    ll n;cin>>n;
    vi v(n);
    rep(i,n)cin>>v[i];
    sort(all(v));
    if(n%3){
        YesNo(v[0]==v[n-1]);
    }
    else{
        n/=3;
        rep(i,3)if(v[i*n]!=v[i*n+n-1])dame("No");
        if(v[0]^v[n]^v[n*2])dame("No");
        out("Yes");
    }
}

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

int main() {
    int n;
    cin >> n;
    vector<tuple<string, int, int>> book(n);
    for (int i = 0; i < n; i++) {
        int point;
        cin >> get<0>(book.at(i)) >> point;
        get<1>(book.at(i)) = -1 * point;
        get<2>(book.at(i)) = i+1;
    }
    sort(book.begin(), book.end());
    for (auto b : book) {
        cout << get<2>(b) << endl;
    }
}

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

int main()
{
  int n, m, x;
  cin >> n >> m >> x;
  
  vector<vector<int>> a(n, vector<int>(m + 1));
  for (int i = 0; i < n; i ++)
  {
    for (int j = 0; j < m + 1; j ++)
    {
      cin >> a.at(i).at(j);
    }
  }
    
  int min_sum = 13 * 100000;
  
  const int mask = (int)pow(2, n) - 1;
  for (int k = 0; k <= mask; k ++)
  {
    vector<int> skills(m);
    int price = 0;
    
    for (int i = 0; i < n; i ++)
    {
      int bit = (int)pow(2, i);
      if ((mask & k & bit) == 0)
      {
        continue;
      }
      
      price += a.at(i).at(0);

      for (int j = 1; j < m + 1; j ++)
      {
        skills.at(j - 1) += a.at(i).at(j);
      }
    }
    
    bool flag = true;
    for (int j = 0; j < m; j ++)
    {
      if (skills.at(j) < x)
      {
        flag = false;
        break;
      }
    }
    
    if (flag)
    {
      if (price < min_sum) min_sum = price;
    }
  }
  
  if (min_sum == 13 * 100000) cout << -1 << endl;
  else cout << min_sum << endl;
  
  return 0;
}

Measured memory_bytes: 4112
#include <cstdio>
#include <vector>
#include <algorithm>

constexpr int N=1000000;

int main() {
  std::vector<int> all, odd;

  for (int i=1; true; ++i) {
    int n=i*(i+1)*(i+2)/6;
    if (n > 1000000)
      break;

    all.push_back(n);
    if (n % 2 == 1)
      odd.push_back(n);
  }

  std::vector<int> dp_all(N, N), dp_odd(N, N);
  dp_all[0] = dp_odd[0] = 0;
  dp_all[1] = dp_odd[1] = 1;
  for (int i=1; i<N; ++i) {
    for (int a: all) {
      if (a > i) break;

      dp_all[i] = std::min(dp_all[i], dp_all[i-a]+1);
    }

    for (int o: odd) {
      if (o > i) break;

      dp_odd[i] = std::min(dp_odd[i], dp_odd[i-o]+1);
    }
  }

  while (true) {
    int q;
    scanf("%d", &q);
    if (q == 0)
      break;

    printf("%d %d\n", dp_all[q], dp_odd[q]);
  }

  return 0;
}

Measured memory_bytes: 9784
#include <bits/stdc++.h>
#define ll long long 
using namespace std;
const ll mod = 1e9 + 7;
const ll MAXX = 1e18;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen("INP.txt", "r", stdin);
	//freopen("OUT.txt", "w", stdout);
	string s;
	cin >> s;
	s = ' ' + s;
	for (ll i = 1; i < s.size(); i++) {
		if (s[i] == 'U' || s[i] == 'D') {
			continue;
		}
		if (s[i] == 'L' && i % 2 != 0) {
			cout << "No" << '\n';
			return 0;
		}
		if (s[i] == 'R' && i % 2 == 0) {
			cout << "No" << '\n';
			return 0;
		}
	}
	cout << "Yes" << '\n';
	return 0;
}	

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int gcd(int a,int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int n,m,cnt=0,o,p,aa[220000],cntl=0,ab[220000];
pair<int,int> pp[220000];
string s,ss[220000];
char c,cc[5000][5000]={};
queue<int> que;
signed main(){
    cin>>n;
    rep(i,n){
        cin>>aa[i];
        pp[i].first=aa[i]+i+1;
        pp[i].second=i+1-aa[i];
        if(pp[i].second>=2){
            ab[pp[i].second]++;
        }
    }
    rep(i,n){
        if(pp[i].first<200010){
            cnt+=ab[pp[i].first];
        }
        if(pp[i].second>=2){
            ab[pp[i].second]--;
        }
    }
    cout<<cnt;
}

Measured memory_bytes: 16744
#include<bits/stdc++.h>
using namespace std;
#define ll long long;
#define ld long double
#define pb push_back
const int mod=1e9+7;
const int mxN=2e6+3;

int main(){
    int s;
    cin>>s;
    int a[2010];
    a[3]=1;
    a[4]=1;
    a[5]=1;
    for(int i=6;i<=s;i++){
        a[i]=a[i-1]+a[i-3];
        a[i]%=mod;
    }
    cout<<a[s]<<endl;
    return 0;
}

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

int main() {
  int n, s, tmp;
  cin >> n >> s;
  for(int i = 0; i <= n; i++){
    for(int j = 0; j <= n - i; j++){
      tmp = i * 10000 + j * 5000 + (n - i - j) * 1000;
      if(s == tmp){
        cout << i << " " << j << " " << (n - i - j) << endl;
        return 0;
      }
    }
  }
  cout << -1 << " " << -1 << " " << -1 << endl;
}

Measured memory_bytes: 256
/**Bismillahir Rahmanir Rahim.**/

/**
 *    author:  nasimnoob
**/

#include<bits/stdc++.h>
#include<stdlib.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<cstring>
#include<cstdio>

using namespace std;

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

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

//-----------------------------------------------------------//
#define      test                       int t; cin>>t;  while(t--)

#define      cube(x)                    (x*x*x)
#define      sqr(x)                     (x*x)

#define      sc1(x)                     scanf("%lld",&x);
#define      sc2(x,y)                   scanf("%lld %lld", &x, &y)
#define      scf1(x)                    scanf("%lf",&x)
#define      scf2(x,y)                  scanf("%lf %lf", &x, &y)

#define      srev                       reverse(s.begin(),s.end())
#define      sortstr                    sort(s.begin(), s.end());
#define      gtl(x)                     getline(cin, (x))

#define      PI                         acos(-1) // 3.1415926535897932
#define      MIN                        9999999

#define      Faster                     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

//scanf("%[^\n]%*c", str);
//sort(s,s+n,greater<int>());
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);


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

int main()
{
    Faster;
    string s , s1;

    cin >> s >> s1 ;

    int len =  s.size();
    int cnt = 0;

    for(int i = 0 ; i < len ; i++)
    {
        if(s[i] != s1[i])
            cnt++;
    }
    cout << cnt << endl;
    return 0;
}






Measured memory_bytes: 3808
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] a = new int[N];

        long black = 0;
        long white = 0;
        long tmp = 0;
        for (int i=0;i<N;i++) {
            a[i] = sc.nextInt();
            if (i<K) black+=a[i];
            if (i>=K) tmp+=Math.max(0, a[i]);
        }

        long ans = Math.max(black, white);
        for (int i=K;i<N;i++) {
            tmp-=Math.max(0, a[i]);
            tmp+=Math.max(0, a[i-K]);
            black+=a[i];
            black-=a[i-K];
            ans = Math.max(ans, tmp+black);
            ans = Math.max(ans, tmp+white);
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 52592
#include<stdio.h>
int PN(int A,int B){
  int i;
  int a,b,c,d,f,e;
  int count=0;
  for(i=A;i<=B;i++){
    a=i/1000;
    b=i/100;
    c=i-b*100;
    d=c/10;
    f=c-10*d;
    e=10*f+d;
    if(a==e){
      count++;
    }
  }
  return count;

}
int main(){
  int A,B;
  scanf("%d%d",&A,&B);
  printf("%d",PN(A,B));
}



Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<deque>
using namespace std;
const int N=3000+5;
const int mod=1e9+7;
int d[N][N][2];
int n,m;
int main()
{
    scanf("%d%d",&n,&m);
    d[0][0][1]=1;
    for(int i=1;i<=n;i++)
        d[0][i][0]=1;
    for(int i=0;i<m;i++)
        for(int j=0;j<=n;j++)
            for(int k=0;k<2;k++)
                if(d[i][j][k]){
                    if(j){
                        d[i+1][j-1][k|(j==1)]+=d[i][j][k];
                        d[i+1][j-1][k|(j==1)]%=mod;
                        d[i+1][j][k|(j==1)]+=d[i][j][k];
                        d[i+1][j][k|(j==1)]%=mod;
                    }
                    if(j<n){
                        d[i+1][j][k]+=d[i][j][k];
                        d[i+1][j][k]%=mod;
                        d[i+1][j+1][k]+=d[i][j][k];
                        d[i+1][j+1][k]%=mod;
                    }
                }
    int ans=0;
    for(int i=0;i<=n;i++){
        ans+=d[m][i][1];
        ans%=mod;
    }
    printf("%d\n",ans);
}


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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

#define REP(k, n) for (ll k = 0; k < (ll)(n); ++k)
#define REPREV(k, n) for (ll k = (ll)(n)-1; k >= 0; --k)
#define FOR(k, a, b) for (ll k = (ll)(a); k < (ll)(b); ++k)
#define FORREV(k, a, b) for (ll k = (ll)(b)-1; k >= (ll)(a); --k)
#define FOREACH(e, v) for (auto& e : v)

#define TGET(t, i) get<i>(t)
#define TSET(t, i, a) get<i>(t) = a
// MinHeap - priority_queue<ll, vll, greater<ll>> pq;

#define EVEN(n) ((n)&1) == 0
#define ODD(n) ((n)&1) == 1

#define SORT(v) sort(v.begin(), v.end())
#define SORTREV(v) sort(v.rbegin(), v.rend())
#define SHUFFLE(v) random_shuffle(v.begin(), v.end())
//srand(unsigned(time(0)));

#define REMOVEAT(v, i) v.erase(v.begin() + i)
#define REVERSE(v) reverse(v.begin(), v.end())

ostream& operator<<(ostream& str, const pll& p) {
    str << p.first << " " << p.second;
    return str;
}


const ll md = 1e9 + 7;

#define POS "POSSIBLE"
#define IMPOS "IMPOSSIBLE"

// #define INF LLONG_MAX
// #define MINF LLONG_MIN
#define INF 1e18
#define MINF -INF

void solve() {
    ll n, k;
    cin >> n >> k;
    vll a(n);
    REP(i, n){
        cin >> a[i];
    }
    ll res = 0;

    ll lo = 1;
    ll hi = *max_element(a.begin(), a.end());
    if (k == 0) {
        cout << hi << "\n";
        return;
    }
    res = hi;
    while (lo <= hi) {
        ll mid = lo + (hi - lo) / 2;
        ll cuts = 0;
        REP(i, n) {
            if (a[i] <= mid)
                continue;
            cuts += a[i] / mid;
        }
        if (cuts > k) {
            lo = mid + 1;
        } else {
            res = mid;
            hi = mid - 1;
        }
    }

    // cout << fixed << setprecision(6);
    cout << res << "\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int tt = 1;
    // cin >> tt;
    for (int t = 1; t <= tt; t++) {
        // cout << "Case #" << t << ": ";
        solve();
    }
    //cin.rdbuf()->in_avail()
    return 0;
}


Measured memory_bytes: 4764
#include <iostream>

int main(int argc, char const* argv[])
{
    int n;
    std::cin >> n;

    int min, max;
    std::cin >> min;
    max = min;

    for(int i=1;i<n; ++i)
    {
        int tmp;
        std::cin >> tmp;
        min = std::min(tmp, min);
        max = std::max(tmp, max);
    }
    std::cout << max - min << std::endl;
    return 0;
}

Measured memory_bytes: 256
import sys

n, m = map(int, sys.stdin.readline().strip().split())
c = list(map(int, sys.stdin.readline().strip().split()))

dp = [float("inf") for _ in range(n+1)]
dp[0] = 0

for i in range(n+1):
    for c_i in c:
        if i - c_i >= 0:
            dp[i] = min(dp[i], dp[i - c_i] + 1)

print(dp[n])


Measured memory_bytes: 7384
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Numerics;

namespace competitive
{
    class Program
    {
        static void Main(string[] args)
        {
            var scanner = new Scanner();
            var str = scanner.Next();
            for (int i = 0; i < str.Length - 1; i++)
            {
                var first = str[i];
                var second = str[i + 1];
                if (first == second)
                {
                    Console.WriteLine($"{i + 1} {i + 2}");
                    return;
                }
            }
            for (int i = 0; i < str.Length - 2; i++)
            {
                var first = str[i];
                var second = str[i + 1];
                var third = str[i + 2];
                if (first == third)
                {
                    Console.WriteLine($"{i + 1} {i + 3}");
                    return;
                }
            }
            Console.WriteLine("-1 -1");
        }
    }


    #region
    public static class Extensions
    {
        public static int ToInt(this string str) => int.Parse(str);
        public static double ToDouble(this string str) => double.Parse(str);
        public static long ToLong(this string str) => long.Parse(str);
        public static BigInteger ToBigInteger(this string str) => BigInteger.Parse(str);
    }

    public class Scanner
    {
        private TextReader reader;
        public Scanner()
        {
            reader = Console.In;
        }
        public Scanner(TextReader reader)
        {
            this.reader = reader;
        }
        private string NextWord()
        {
            var sb = new StringBuilder();
            while (true)
            {
                var c = reader.Read();
                if ((c == 13 || c == 10 || c == 32) && sb.Length > 0 || c == -1)
                {
                    break;
                }
                sb.Append((char)c);
            }
            return sb.ToString();
        }
        public int NextInt() => NextWord().ToInt();
        public string Next() => NextWord();
        public double NextDouble() => NextWord().ToDouble();
        public long NextLong() => NextWord().ToLong();
        public BigInteger NextBigInteger() => NextWord().ToBigInteger();
        public string NextLine()
        {
            var str = reader.ReadLine();
            if (string.IsNullOrWhiteSpace(str))
            {
                return reader.ReadLine();
            }
            else
            {
                return str;
            }
        }
        private List<string> NextLineToList() => NextLine().Split(new char[] { ' ' },
                                                                  StringSplitOptions.RemoveEmptyEntries)
                                                           .ToList();
        public List<int> NextLineToIntList() => NextLineToList().Select(x => int.Parse(x))
                                                                .ToList();
    }
    #endregion
}


Measured memory_bytes: 13280
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var nums = input.trim().split('\n');

var f = [];
nums.forEach(function(num) {
	var o = f[num];
	if (!o) {
		o = {id: +num, cnt: 0};
		f[num] = o;
	}
	o.cnt++;
});

f.sort(function(a,b){return b.cnt - a.cnt;});
var maxCnt = f[0].cnt;

f = f.filter(function(o){return o.cnt == maxCnt});
f.sort(function(a,b){return a.id - b.id;});

f.forEach(function(o) {
	console.log(o.id);
});

Measured memory_bytes: 7636
/*
 * ALDS1_4_A.cpp
 *
 *  Created on: Apr 26, 2018
 *      Author: 13743
 */

#include<iostream>

using namespace std;

bool binarySearch(int* a, int l, int r, int x) {
	if(l == r) return false;
	int mid = (r - l) / 2;
	if(a[mid] == x) return true;
	if(x < a[mid]) binarySearch(a, l, mid, x);
	else binarySearch(a, mid, r, x);

}

int main() {
	int cnt = 0;
	int n, q;
	int S[100000];
	cin >> n;
	for(int i=0; i<n; i++) {
		cin >> S[i];
	}
	cin >> q;
	for(int i=0; i<q; i++) {
		int x;
		cin >> x;
		int l = 0;
		int r = n;
		while(l < r) {
			int mid = (l + r) / 2;
			if(S[mid] == x) {
				cnt++; break;
			}
			else if(S[mid] < x) {
				l = mid + 1;
			}
			else {
				r = mid;
			}
		}
	}
	cout << cnt << endl;


}





Measured memory_bytes: 3456
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {
  
ll n; cin>>n;  
long double a=sqrt(n);
  ll b=a/1;
  
  ll ans;
  rep(i,n){if(n%(b-i)==0){ans=b-i;break;}}
  
  ll answer=n/ans;
  
  cout<<ans+answer-2<<endl;
  
  
  
}

Measured memory_bytes: 3712
#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cassert>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
//le ----  re
// l < r
double ans =0;
void search(const int n,const double t,const double p,int now,double l,double r,const double le,const double re,double prob){
  assert(l <= r && le <= re);
  //cout << now <<" " << n << " " << le <<" " << re << " " << l <<" " << r << endl;
  if (n == now){
    double tmp=(r+l)/2;
    //cout << re <<" " << tmp <<" " << le << endl;
    if (le <= tmp && tmp <= re){
      ans+=prob;
    }
    return;
  }
  //out of range
  if (r < le || re <= l)return;

  //strictly inside
  if (le <= l && r <= re){
    ans+=prob;
    return;
  }

  double next=(r+l)/2;
  if (next < t){
    //ok:l=next,r=r
    search(n,t,p,now+1,next,r,le,re,prob*(1-p));
    //ng:l=l,r=next
    search(n,t,p,now+1,l,next,le,re,prob*p);
  }else {
    //ok:l=l,r=next
    search(n,t,p,now+1,l,next,le,re,prob*(1-p));
    //ng:l=next,r=r
    search(n,t,p,now+1,next,r,le,re,prob*p);
  }
}

main(){
  int n;
  double r,l;
  while(cin>>n>>l>>r){
    double p,e,t;
    cin>>p>>e>>t;
    ans=0;
    search(n,t,p,0,l,r,t-e,t+e,1);
    printf("%.12lf\n",ans);
  }
}

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

int paper[10][10];

int drop[3][5][5]  = {
  {
  {0, 0, 0, 0, 0},
  {0, 0, 1, 0, 0},
  {0, 1, 1, 1, 0},
  {0, 0, 1, 0, 0},
  {0, 0, 0, 0, 0},
  },
  {
  {0, 0, 0, 0, 0},
  {0, 1, 1, 1, 0},
  {0, 1, 1, 1, 0},
  {0, 1, 1, 1, 0},
  {0, 0, 0, 0, 0},
  },
  {
  {0, 0, 1, 0, 0},
  {0, 1, 1, 1, 0},
  {1, 1, 1, 1, 1},
  {0, 1, 1, 1, 0},
  {0, 0, 1, 0, 0},
  },
};

int main()
{
  fill((int*) paper, (int*) paper+100, 0);
  int x, y, size;
  char d;
  while (cin >> x >> d >> y >> d >> size) {
    for (int dx = -2; dx <= 2; dx++) {
      for (int dy = -2; dy <= 2; dy++) {
        if (x + dx >= 0 && x + dx < 10 && y + dy >= 0 && y + dy < 10)
          paper[x + dx][y + dy] += drop[size - 1][2+dx][2+dy];
      }
    }
  }
  int max_drop = 0;
  int space = 0;
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
      if (paper[i][j] == 0) space++;
      max_drop = max(max_drop, paper[i][j]);
    }
  }
  cout << space << endl << max_drop << endl;
}

Measured memory_bytes: 1160
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    if((a*b) %2 == 0)
      System.out.println("Even");
    else
      System.out.println("Odd");
  }
}

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

int main(){
  ll a, ans, c;
  double b;
  cin >> a >> b;
  c=b*100+0.1;
  ans=a*c/100;
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3672
#include<bits/stdc++.h>
using namespace std;
string s[2001];
int arr[2001][2001];
int main(){
	int h,w;
	cin>>h>>w;
	for(int i=0;i<h;i++)
		cin>>s[i],s[i]+='#';
	s[h]=string(w,'#');
	for(int i=0;i<=h;i++){
		int l=0,r=0;
		for(int j=0;j<=w;j++){
			if(s[i][j]=='#'){
				for(int k=l;k<r;k++)
					arr[i][k]+=r-l;
				l=r=j+1;
			}else
				r++;
		}
	}
	for(int j=0;j<=w;j++){
		int l=0,r=0;
		for(int i=0;i<=h;i++){
			if(s[i][j]=='#'){
				for(int k=l;k<r;k++)
					arr[k][j]+=r-l;
				l=r=i+1;
			}else
				r++;
		}
	}
	int ans=0;
	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			ans=max(ans,arr[i][j]);
	cout<<ans-1<<endl;
}

Measured memory_bytes: 19968
#include <iostream>
#include <limits>

constexpr int MAXN = 100;
int C[MAXN + 1][MAXN + 1];
int M[MAXN][2];

int main() {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; i++) {
        std::cin >> M[i][0] >> M[i][1];
    }

    for (int i = 0; i < n; i++) {
        C[i][i] = 0;
    }

    for (int j = 1; j < n; j++) {
        for (int i = j - 1; i >= 0; i--) {
            C[i][j] = std::numeric_limits<int>::max();
            for (int k = i; k < j; k++) {
                C[i][j] = std::min(C[i][j], C[i][k] + C[k+1][j] + M[i][0] * M[j][1] * M[k][1]);
            }
        }
    }
    std::cout << C[0][n-1] << std::endl;
}


Measured memory_bytes: 3140
import math
class SegmentTree:
    __slots__ = ["elem_size", "tree_size", "tree", "default"]

    def __init__(self, a: list, default: int):
        real_size = len(a)
        self.elem_size = 1 << math.ceil(math.log2(real_size))
        self.tree_size = 2 * self.elem_size
        self.tree = [default] * self.elem_size + a + [default] * (self.elem_size - real_size)
        self.default = default
        self.init_tree()

    def init_tree(self) -> None:
        tree = self.tree
        for i in range(self.elem_size - 1, 0, -1):
            left, right = tree[i << 1], tree[(i << 1) + 1]
            # ===== change me =====
            tree[i] = left if left < right else right

    def get_value(self, x: int, y: int):
        l, r = x + self.elem_size, y + self.elem_size
        tree, result = self.tree, self.default
        while l < r:
            if l & 1:
                # ===== change me =====
                result = tree[l] if tree[l] < result else result
                l += 1
            if r & 1:
                r -= 1
                # ===== change me =====
                result = tree[r] if tree[r] < result else result
            l, r = l >> 1, r >> 1

        return result

    def set_value(self, i: int, value: int, op: str = "="):
        tree = self.tree
        k = self.elem_size + i
        if op == "=":
            tree[k] = value
        elif op == "+":
            tree[k] += value
        elif op == "?":
            # ===== change me =====
            tree[k] = value if value < tree[k] else tree[k]

        while k > 1:
            k >>= 1
            left, right = tree[k << 1], tree[(k << 1) + 1]
            # ===== change me =====
            tree[k] = left if left < right else right

import sys
n, q = map(int, input().split())
tree = SegmentTree([2**31-1]*n, 2**31-1)
ans = []
append = ans.append
for com, x, y in (map(int, l.split()) for l in sys.stdin.readlines()):
    if com == 0:
        tree.set_value(x, y)
    else:
        append(tree.get_value(x, y+1))
print(*ans, sep="\n")


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

#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
template <class T> bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

using vi = vector<int>;
using vvi = vector<vi>;
using P = pair<int, int>;

/*
 *  */

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

  vector<P> v;
  rep(i, 0, n) {
    int l, r;
    cin >> l >> r;
    v.emplace_back(l, r);
  }

  sort(all(v));

  int inf = 1e10;
  vi lf(n + 1), lb(n + 1), rf(n + 1, inf), rb(n + 1, inf);
  rep(i, 0, n) {
    lf[i + 1] = max(lf[i], v[i].first);
    rf[i + 1] = min(rf[i], v[i].second);
    lb[n - i - 1] = max(lb[n - i], v[n - 1 - i].first);
    rb[n - i - 1] = min(rb[n - i], v[n - 1 - i].second);
  }

  int ans = 0;
  rep(i, 0, n) {
    chmax(ans, v[i].second - v[i].first + 1 + max(0LL, min(rf[i], rb[i]) - max(lf[i], lb[i]) + 1));
    if(i+1 < n) chmax(ans, max(0LL, rf[i+1]-lf[i+1]+1) + max(0LL, rb[i+1]-lb[i+1]+1));
  }

  cout << ans << endl;

  return 0;
}


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


int main(){

  ll n;
  cin>>n;
  vector<ll> a(n);
  rep(i,n)cin>>a[i];
  sort(a.rbegin(),a.rend());
  ll ans=0;
  ll now=0;
  rep(i,n){
    ans+=a[now];
//    cout<<ans<<endl;
    if (i%2==1)now++;
  }
  ans-=a[0];
  cout<<ans;


}


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

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

typedef long long ll;

int main()
{
    int n;
    int a[100001];

    cin >> n;
    REP(i, n) cin >> a[i];
    a[n] = 0;

    ll cur = 0, ans = 1;
    sort(a, a+n);

    REP(i, n){
        if(cur * 2 < a[i]) ans = 1;
        else ans++;
        
        cur += a[i];
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;

int g[210][210];

int main(){
	int n; cin >> n;
	for(int i=0;i<200;i++){
		g[i][i]=1;
	}
	for(int i=0;i<n;i++){
		int p,q; string s; cin >> p >> s >> q;
		p--; q--;
		if(s[0]=='l'){
			g[p][q+100]=1;
		}
		else{
			g[q+100][p]=1;
		}
	}
	for(int k=0;k<200;k++){
		for(int i=0;i<200;i++){
			for(int j=0;j<200;j++){
				if(g[i][k]&&g[k][j]){
					g[i][j]=1;
				}
			}
		}
	}
	for(int i=0;i<200;i++){
		for(int j=i+1;j<200;j++){
			if(g[i][j]&&g[j][i]){
				cout << 1 << endl;
				return 0;
			}
		}
	}
	cout << 0 << endl;
}


Measured memory_bytes: 3380
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>
#include <set>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

const ll MOD = 1e9 + 7;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define fr first
#define sc second


int main() {
	ll n, y;
	cin >> n >> y;
	for (int i = 0;i <= n;i++) {
		for (int j = 0;j <= n - i;j++) {
			int sum = i * 10000 + j * 5000 + 1000 * (n - i - j);
			if (sum == y) {
				cout << i << ' ' << j << ' ' << n - i - j << endl;
				return 0;
			}
		}
	}
	cout << -1 << ' ' << -1 << ' ' << -1 << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	int n;
	cin >> n;
	int ans[7]={0};
	for(int i=0;i<n;i++)
	{
		double k;
		cin >> k;
		if(k<165.0)ans[0]++;
		else if(k<170.0)ans[1]++;
		else if(k<175.0)ans[2]++;
		else if(k<180.0)ans[3]++;
		else if(k<185.0)ans[4]++;
		else ans[5]++;
	}
	for(int i=0;i<6;i++)
	{
		printf("%d:",i+1);
		for(int j=0;j<ans[i];j++)cout << '*';
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1252
#pragma comment(linker, "/STACK:102400000,102400000")
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define inf 1000000007
#define mod 1000000009
#define x first
#define y second
#define pi acos(-1.0)
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";
//#define dprintf(...) 
#define hash _hash
//#define dprintf(...) fprintf(outFile,__VA_ARGS__)
 
#define FOREACH(it,x) for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define ull unsigned long long
#define ll long long
#define N 100010
 
template <class T,class U>inline void Max(T &a,U b){if(a<b)a=b;}
template <class T,class U>inline void Min(T &a,U b){if(a>b)a=b;}
 
//FILE* outFile;
 
inline void add(int &a,int b){a+=b;while(a>=mod)a-=mod;}
 
 
int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=ans*(ll)a%mod;
        a=(ll)a*a%mod;b>>=1;
    }
    return ans;
}

int a[20010];
int main(){
    //freopen("atlarge.in","r",stdin);
    //freopen("atlarge.out","w",stdout);
    //cout<<setprecision(9)<<fixed;
    int j,i,k,ca=0,m=0,n,K;
    scanf("%d",&n);
    m=n;
    if(n==3){
        puts("2 5 63");return 0;
    }
    else if(n==4){
        puts("2 5 20 63");return 0;
    }
    else if(n<100){
        k=0;
        a[k++]=2,a[k++]=3,a[k++]=5,a[k++]=20;
        a[k++]=30;
        while(k<n)a[k]=a[k-1]+30,k++;
    }
    else{
        k=0;
        if(n%2)a[--n]=15000;
        a[k++]=2,a[k++]=3,a[k++]=5;
        K=n/2;
        int s=10,d=0;
        rep(i,30,15000)if(i%2==0||i%3==0||i%5==0){
            if(k+2==K)break;
            a[k++]=i,s+=i;
        }
        //cerr<<k<<" "<<K<<"\n";
        s%=15;
        if(s==0)a[k++]=6,a[k++]=9;
        else if(s&1){
            if(s<7)a[k++]=4,a[k++]=15-s-4;
            else if(s==7)a[k++]=8,a[k++]=15;
            else if(s==9)a[k++]=15,a[k++]=6;
            else if(s==11)a[k++]=10,a[k++]=9;
            else if(s==13)a[k++]=8,a[k++]=9;
        }
        else a[k++]=6,a[k++]=30-s-6;
        rep(l,0,K)a[K+l]=15000+a[l];
        n=m;    
    }
    rep(i,0,n)printf("%d ",a[i]);
    /*
    int s=0,d=0;
    rep(i,0,n)s+=a[i],d=__gcd(a[i],d);
    if(d!=1){
        DBG(n)
    }
    rep(i,0,n)if(__gcd(a[i],s)==1){
        DBG(n)break;
    }*/
    
    //cerr<<1.*clock()/CLOCKS_PER_SEC<<"ms"<<"\n";
    return 0;
}   


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9+7;
#define REP(i,j,n) for(int i=j;i<n;i++)
#define rep(i,n) REP(i,0,n)


// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    ll ary[n];
    rep(i,n) cin >> ary[i];

    priority_queue<ll> que;
    sort(ary, ary+n, greater<int>());

    que.push(ary[0]);
    ll ans = 0;
    rep(i,n-1)
    {
        ans += que.top();
        que.pop();
        que.push(ary[i+1]);
        que.push(ary[i+1]);
        // cout << ans << endl;
    }
    cout << ans << endl;
}


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

/*
code credits : ਜ਼ੈਲਦਾਰ
dashan jot singh
*/
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define inf LLONG_MAX
#define pl pair<ll,ll>

void solve(){
	ll n,x,y;
	cin>>n>>x>>y;
	ll freq[2020];
	memset(freq,0,sizeof(freq));
	for(ll i=1;i<=n;i++){
		for(ll j=i+1;j<=n;j++){
			ll dis=min(abs(i-j),min(abs(x-i)+abs(y-j)+1,abs(x-j)+abs(y-i)+1));
			freq[dis-1]++;
		}
	}    
	for(ll i=0;i<n-1;i++){
		cout<<freq[i]<<"\n";
	}
}
int main(){
	fast;
	int t=1;
	// cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long calc(int n,long x,vector<long>p,vector<long>b){
  long ans = 0;
  if(n==0||x==0){
    return min(x,1l);
  }else{
    if(x<=1+p[n-1]+b[n-1])return calc(n-1,x-1,p,b);
    else return p[n-1]+1+calc(n-1,x-2-b[n-1]-p[n-1],p,b);
  }
}

int main(){
  int n;
  long x;
  cin >> n >> x;
  vector<long>p(51);
  vector<long>b(51);
  int i;
  p[0] = 1;
  b[0] = 0;
  for(i=1;i<=50;i++){
    p[i] = 2*p[i-1]+1;
    b[i] = 2*b[i-1]+2;
  }
  cout << calc(n,x,p,b) << endl;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
use std::collections::HashSet;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let mut open = HashSet::<usize>::new();
    for _ in 0..n {
        let a: usize = read();
        if open.contains(&a) {
            open.remove(&a);
        } else {
            open.insert(a);
        }
    }
    println!("{}", open.len());
}


Measured memory_bytes: 8444
/**
 *  author: said_v15
 *  created with web_programmer
**/
#include <bits/stdc++.h>
using namespace std;
int main()
{
   int a,b;
   cin>>a>>b;
   int ans;
   if(a>b) ans=a+(a-1);
   else if(a<b) ans=b+(b-1);
   else if(a=b) ans=a+b;
   cout<<ans<<"\n";
   return 0;
}

Measured memory_bytes: 256
S=input()
T=input()
def condition(str,num):
    flag=0
    for i in range(num,num+len(str)):
        if S[i]!='?' and S[i]!=str[i-num]:
            flag=1
    return flag==0
data=[]
for i in range(0,len(S)-len(T)+1):
    if condition(T,i):
        data.append(i)
if data!=[]:
    m=max(data)
    ans=''
    for i in range(0,len(S)):
        if i<m:
            if S[i]!='?':
                ans+=S[i]
            else:
                ans+='a'
        elif m+len(T)-1>=i:
            ans+=T[i-m]
        else:
            if S[i]!='?':
                ans+=S[i]
            else:
                ans+='a'
    print(ans)
else:
    print('UNRESTORABLE')


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	int n,a=0,b=0,c=0,d=0;
	cin>>n;
	while(n!=0){
		cin>>s;
		if(s=="AC") a++;
		if(s=="WA") b++;
		if(s=="TLE") c++;
		if(s=="RE") d++;
		n--;
	}
	cout<<"AC"<<" x "<<a<<endl;
	cout<<"WA"<<" x "<<b<<endl;
	cout<<"TLE"<<" x "<<c<<endl;
	cout<<"RE"<<" x "<<d<<endl;
	return 0;
}

Measured memory_bytes: 3604
N = int(input())
A = list(map(int, input().split()))
L = [0 for i in range(max(A)+1)]
for i in range(N):
  L[A[i]] += 1
mL = []
if len(L) >= 3:
  for j in range(len(L)-2):
    mL.append(L[j] + L[j+1] + L[j+2])
else:
  for j in range(3-len(L)):
    L.append(0)
  mL = [L[0]+L[1]+L[2]]
print(max(mL))

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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var ans = n / 2;
            if (n % 2 == 0) ans--;

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11092
import sys
input = sys.stdin.readline
N, A, B = map(int, input().split())
S = list(input())[: - 1]
res = ["No"] * N
a = 0
b = 0
for i in range(N):
  if S[i] == "a" and (a + b < A + B):
    a += 1
    res[i] = "Yes"
  elif S[i] == "b" and (a + b < A + B) and (b < B):
    b += 1
    res[i] = "Yes"
for r in res: print(r)

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

int main(){
  int n,d,x;
  cin>>n>>d>>x;
  vector<int> data(n);
  for (int i=0;i<n;i++){
    cin>>data.at(i);
  }
  
  int answer=x;
  
  for (int i=0;i<n;i++){
    answer+=((d-1)/data.at(i))+1;
  }
  
  cout<<answer<<endl;
  
  
  
}

  













Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define INF 2147483647
using namespace std;
using Graph=vector<vector<int>>;

int main(){
  int n,m,k;
  int x=0;
  cin>>n>>m>>k;
  for(int a=0;a<=n;a++){
    for(int b=0;b<=m;b++){
      if(a*b+(n-a)*(m-b)==k){
        x=1;
      }
    }
  }
  x==1?cout<<"Yes":cout<<"No";
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
int x;
cin>>x;
if(x%10==2||x%10==4||x%10==5||x%10==7||x%10==9)
cout << "hon" << endl;
else if(x%10==3)
cout << "bon" << endl;
else
cout << "pon" << endl;

    return 0;
}


Measured memory_bytes: 3624
import Control.Monad
import Data.List

main = do
    n <- readLn
    nums <- replicateM n getLine
    nums
        |> group . sort -- 同じ文字ごとにまとめる
        |> map length   -- 文字ごとの出現回数
        |> filter odd   -- 奇数の場合のみ文字が残る
        |> length       -- 残った文字の個数
        |> print


infixl 1 |>
(|>) :: a -> (a -> b) -> b
v |> f = f v

Measured memory_bytes: 80252
<?php
while (1) {
    list($height, $width) = getSpacesByExplodeTrimInput();

    if ($height == 0 && $width == 0) {
        break;
    }

    for ($i = 0; $i < $height; $i++) {
        for($j = 0; $j < $width; $j++) {
            echo '#';
        }
    echo PHP_EOL;
    }
    echo PHP_EOL; 
}
 
function getSpacesByExplodeTrimInput()
{
    return explode(' ', trim(fgets(STDIN)));
}

Measured memory_bytes: 15244
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    string s;
    cin >> s;
    string t = "";
    for(int i=0;i<s.size();++i){
        if(s[i] != 'x')t.push_back(s[i]);
    }
 
    int left = 0, right = t.size() - 1;
    bool flag = true;
    while(right > left){
        if(t[right] != t[left]){
            flag = false;
            break;
        }
        right--;
        left++;
    }
 
    if(flag){
        int l = 0, r = s.size() - 1, cnt = 0;
        while(r > l){
            if(s[r] == 'x' && s[l] != 'x'){
                r--;
                cnt++;
            }else if(s[r] != 'x' && s[l] == 'x'){
                l++;
                cnt++;
            }else{
                r--;
                l++;
            }
        }
        cout << cnt << endl;
    }else{
        cout << -1 << endl;
    }
 
    return 0;
}

Measured memory_bytes: 640
n = gets.chomp.to_i

n.times do
  l = gets.chomp.split
  3.times do |i|
    l[i] = l[i].to_i
  end
  l.sort!
  if l[0]**2 +l[1]**2 == l[2]**2
    puts "YES"
  else
    puts "NO"
  end
end



Measured memory_bytes: 6844
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) (v).begin(),(v).end()
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main() {
	ll N;
	cin >> N;
    ll h, n, w;
    for (int i = 1; i <= 3500; i++) {
        for (int j = 1; j <= 3500; j++) {
            if (((4*i*j-N*i-N*j)>0) && ((N*i*j)%(4*i*j-N*i-N*j)==0)) {
                w = (N*i*j)/(4*i*j-N*i-N*j);
                h = i;
                n = j;
                cout << h << ' ' << n << ' ' << w << endl;
                return 0;
            }
        }
    }
}


Measured memory_bytes: 256
import sys
import math
import queue
import copy
import bisect#2分探索

def input():
    return sys.stdin.readline()[:-1]
def inputi():
    return int(input())
def inputl():
    return list(map(int, input().split()))
def printl(li):
    print(*li, sep="\n")
def argsort(s):
    return sorted(range(len(s)), key=lambda k: s[k])

#mod = 10**9+7

N = inputi()
#N, K = inputl()
#L = [int(input()) for i in range(N)]
A = inputl()
B = inputl()
C = inputl()
#S = [inputl() for i in range(H)]
#q = queue.Queue() #q.put(i) #q.get() 
#q = queue.LifoQueue() #q.put(i) #q.get() 

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b=copy.deepcopy(a)  #2次元配列はこうコピーする
#w.sort(key=lambda x:x[1],reverse=True)  #二個目の要素で降順並び替え

#素数リスト
# n = 100
# primes = set(range(2, n+1))
# for i in range(2, int(n**0.5+1)):
#     primes.difference_update(range(i*2, n+1, i))
# primes=list(primes)

#bisect.bisect_left(a, 4)#aはソート済みである必要あり。aの中から最も左の4位置を返す。
#bisect.insort_left(a, 4)#挿入


##TLE
# A.sort(reverse=True)
# B.sort()
# C.sort()
# tot=0
# cut=N
# for a in A:
#     cut=bisect.bisect_right(B[0:cut], a)
#     cut2=N
#     for i in reversed(range(cut,N)):
#         b=B[i]
#         cut2=bisect.bisect_right(C[0:cut2], b)
#         tot+=N-cut2

#right ans
tot=0
A.sort()
C.sort()
for b in B:
    cut1=bisect.bisect_left(A, b)
    cut2=bisect.bisect_right(C, b)
    tot+=cut1*(N-cut2)
print(tot)

Measured memory_bytes: 99684
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	int N;
	cin >> N;
	vector<int> t(N + 2);
	vector<int> v(N + 2);
	for (auto i = 0; i < N; ++i)
	{
		cin >> t[i + 1];
	}
	for (auto i = 0; i < N; ++i)
	{
		cin >> v[i + 1];
	}

	vector<int> sum(N + 3);
	for (auto i = 0; i < N + 2; ++i)
	{
		sum[i + 1] += sum[i] + t[i];
	}

	auto ans = 0.0;
	vector<double> minV;
	for (auto ct = 0.0; ct <= sum[N + 2]; ct += 0.5)
	{
		double temp = INT_MAX;
		for (auto i = 0; i < N + 2; ++i)
		{
			auto vel = 0.0;
			if (ct < sum[i])
			{
				vel = v[i] + sum[i] - ct;
			}
			else if (ct > sum[i + 1])
			{
				vel = v[i] + ct - sum[i + 1];
			}
			else
			{
				vel = v[i];
			}
			temp = min(temp, vel);
		}
		minV.push_back(temp);
	}
	for (auto i = 0; i < (int)minV.size() - 1; ++i)
	{
		ans += (minV[i] + minV[i + 1]) / 4;
	}
	cout << fixed << setprecision(7) << ans << endl;

	return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int> 
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int n;
vector<int> a;
vector<int> c;
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        a.pb(x);
    }
    for(int i=0;i<n;i++){
        c.pb(i+1);
    }
    if(a==c){
        puts("YES");
        return 0;
    }
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++){
            vector<int> b=a;
            int cc=b[i];
            b[i]=b[j];
            b[j]=cc;
            if(b==c){
                puts("YES");
                return 0;
            }
        }
    puts("NO");
    return 0;
}

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

int main() {
  int n;
  cin>>n;
  long long m=0,a=0,r=0,c=0,h=0;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    if(s.at(0)=='M')m++;
    if(s.at(0)=='A')a++;
    if(s.at(0)=='R')r++;
    if(s.at(0)=='C')c++;
    if(s.at(0)=='H')h++;
  }
  cout<<m*(a*r+a*c+a*h+r*c+r*h+c*h)+a*(r*c+r*h+c*h)+r*c*h<<endl;
}


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

typedef long long ll;
const int NMAX = 2e5 + 10;
const int MOD = 1e9 + 7;
int main(int argc, char const *argv[])
{
	int a[6];
	for(register int i = 1;i <= 5;i++)
		scanf("%d",a+i);
	for(register int i = 1;i <= 5;i++)
		if(!a[i])
			return 0*printf("%d\n",i );
	return 0;
}

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

using namespace std;

int pd[1000000];
int v[1000000] , n;

int ms(){
    pd[1] = 0;
    pd[2] = abs(v[2] - v[1]);
    
    for(int i = 3; i <= n; i++){
        pd[i] = min(pd[i-1] + abs(v[i] - v[i-1]), pd[i-2] + abs(v[i] - v[i-2]));
    }
    return pd[n];
}





int main(){
    scanf("%d" , &n);
    for(int i = 1 ; i <= n; i++){
        scanf("%d" , &v[i]);
    }
    printf("%d\n" , ms());
}

Measured memory_bytes: 4736