akhauriyash/Code-Regression huggingface dataset:
# include <cstdio>
# include <cstring>

int ri, rj, ans, n;

int main(void) {
    // freopen("data.in", "r", stdin);
    // freopen("data.out", "w", stdout);
    while (scanf("%d", &n) == 1) {
        scanf("%d%d", &ri, &rj);
        ans = rj - ri;
        int t, na, tt;
        int len = n - 2;
        for (int i = 0; i < len; i++) {
            scanf("%d", &t);
            if (t > rj) {
                tt = rj;
                rj = t;
                if (tt < ri) ri = tt;
                na = rj - ri;
                if (na > ans) ans = na;
            }
            else if (t < ri) {
                ri = t;
                if (i != len - 1) {
                    scanf("%d", &rj);
                    na = rj - ri;
                    if (na > ans) ans = na;
                    i++;
                }
            }
        }
        printf("%d\n", ans);
    }
    return 0;
}



Measured memory_bytes: 2744
import java.util.Scanner;

public class Main{

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

	    String[] S = sc.next().split("");

	    System.out.println(S[0]+S[1]+S[2]+S[3]+" "+S[4]+S[5]+S[6]+S[7]+S[8]+S[9]+S[10]+S[11]);
	}
}

Measured memory_bytes: 9684
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
#define PI 3.141592653589
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << 0 << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl

signed main(){
    int N;
    string S;
    cin >> N;
    cin >> S;
    int Ans=1;
    string T=S;
    REP(i,2*N){
        if(i==0){
            T[i]='L';
            continue;
        }
        if(S[i-1]==S[i]){
            T[i]=T[i-1]^'L'^'R';
        }else{
            T[i]=T[i-1];
        }
    }
    //REP(i,2*N){cout << T[i] << " ";}cout << endl;
    if(T[2*N-1]=='L')GOODBYE;
    if(S[0]=='W')GOODBYE;
    if(S[2*N-1]=='W')GOODBYE;
    int L=0,R=0;
    REP(i,2*N){
        if(T[i]=='L'){
            L++;
        }else{
            R++;
        }
    }
    if(L!=R)GOODBYE;
    L=0;R=0;
    REP(i,2*N){
        if(T[i]=='L'){
            L++;
        }else{
            Ans=(Ans*L)%MOD;
            L--;
        }
        if(L<0)GOODBYE;
    }
    REP(i,N){
        Ans=(Ans*(i+1))%MOD;
    }
    cout << Ans << endl;
    return 0;
}   


Measured memory_bytes: 772
#include <stdio.h>
#include <math.h>
#define MAX 1000

int main()
{
  int a, d, n, i=0, j, k, sum, t=0, sosuucheck=0;
  int sosuu[MAX];

  while(t!=1)
    {
      scanf("%d %d %d",&a,&d,&n);

      if(n==0)
	t = 1;
      else
	{
	  sum = a;
	  i = 0;
	  while(i!=n)
	    {
	      if(sum==2)
		{
		  sosuucheck = 0;
		}
	      else if(sum==1)
		{
		  sosuucheck = 1;
		}
	      else
		{
		  if(sum%2==0)
		    {
		      sosuucheck = 1;
		    }
		  else
		    {
		      for(j=3;j<=sqrt(sum);j=j+2)
			{
			  if(sum%j==0)
			    {
			      sosuucheck = 1;
			    }
			}
		    }
		}

	      if(sosuucheck==0)
		{
		  sosuu[i] = sum;
		  i++;
		}
	      sosuucheck = 0;
	      sum = sum + d;
	    }
	  printf("%d\n",sosuu[n-1]);
	  /*
	  for(k=0;k<=MAX;k++)
	    {
	      sosuu[k] = 0;
	    }
	  */
	}
    }
  return 0;
}

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

int main()
{
    int n , mx = 0;
    cin >> n;

    map<string , int> mp;

    for(int i = 0; i < n; ++i){
        string s;
        cin >> s;
        mp[s]++;
    }

    for(const auto & x : mp){
        int l = x.second;
        if(l > mx)
            mx = l;
    }

    for(auto it = mp.begin(); it != mp.end(); ++it){
        if(it->second == mx)
            cout << it->first << "\n";
    }

    return 0;
}


Measured memory_bytes: 25216
#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", n)
#define pc(n) printf("%c", n)
#define pdd(n, m) printf("%d %d\n", n, m)
#define pddd(n, m, z) printf("%d %d %d\n", n, m, z)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) printf("%lld %lld\n", n, m)
#define plddd(n, m, z) printf("%lld %lld %lld\n", n, m, z)
#define sld(n) scanf("%lld", &n)
#define sldd(n, m) scanf("%lld%lld", &n, &m)
#define slddd(n, m, k) scanf("%lld%lld%lld", &n, &m, &k)
#define sf(n) scanf("%lf", &n)
#define sc(n) scanf("%c", &n)
#define sff(n, m) scanf("%lf%lf", &n, &m)
#define sfff(n, m, k) scanf("%lf%lf%lf", &n, &m, &k)
#define ss(str) scanf("%s", str)
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = a; i >= n; i--)
#define mem(a, n) memset(a, n, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define ce i == n ? '\n' : ' '
#define mod(x) ((x) % MOD)
#define gcd(a, b) __gcd(a, b)
#define lowbit(x) (x & -x)
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
inline int read()
{
	int ret = 0, sgn = 1;
	char ch = getchar();
	while (ch < '0' || ch > '9')
	{
		if (ch == '-')
			sgn = -1;
		ch = getchar();
	}
	while (ch >= '0' && ch <= '9')
	{
		ret = ret * 10 + ch - '0';
		ch = getchar();
	}
	return ret * sgn;
}
inline void Out(int a) //ê?3?ía1ò
{
	if (a > 9)
		Out(a / 10);
	putchar(a % 10 + '0');
}

ll gcd(ll a, ll b)
{
	return b == 0 ? a : gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
///快速幂m^k%mod
ll qpow(ll x, ll n, ll mod)
{
	ll res = 1;
	while (n)
	{
		if (n & 1)
			res = (res * x) % mod;
		x = x * x % mod, n >>= 1;
	}
	return res;
}

const int N = 1e6 + 50;
int n, m;
int u, v;
int ans[N];
vector<int> s[N];

void bfs()
{
	queue<int> q;
	q.push(1);
	ans[1] = 1;
	while (!q.empty())
	{
		int tmp = q.front();
		q.pop();
		for (auto w : s[tmp])
		{
			if (ans[w] == 0)
			{
				ans[w] = tmp;
				q.push(w);
			}
		}
	}
}

int main()
{
	sdd(n, m);
	rep(i, 1, m)
	{
		sdd(u, v);
		s[u].pb(v);
		s[v].pb(u);
	}
	bfs();
	rep(i, 1, n)
	{
		if (ans[i] == 0)
		{
			puts("No");
			return 0;
		}
	}
	puts("Yes");
	rep(i, 2, n)
		pd(ans[i]);
	return 0;
}

Measured memory_bytes: 31656
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 998244353
inf = float("INF")
class BinaryIndexedTree:
    # http://hos.ac/slides/20140319_bit.pdf
    def __init__(self, size):
        """
        :param int size:
        """
        self.bit = [0 for _ in range(size)]
        self.size = size

    def add(self, i, w):
        """
        i番目にwを加える
        :param int i:
        :param int w:
        :return:
        """
        if i < 0:
            return
        x = i + 1
        while x <= self.size:
            self.bit[x - 1] += w
            x += x & -x
        return

    def sum(self, i):
        """
        [0,i]の合計
        :param int i:
        :return:
        """
        res = 0
        x = i + 1
        while x > 0:
            res += self.bit[x - 1]
            x -= x & -x
        return res

    def search(self, x):
        """
        二分探索。和がx以上となる最小のインデックス(>= 1)を返す
        :param int x:
        :return :
        """
        i = 0
        s = 0
        step = 1 << self.size.bit_length()
        while step:
            if i + step <= self.size and s + self.bit[i + step - 1] < x:
                print(self.bit[i + step - 1], i, step)
                i += step
                s += self.bit[i - 1]
            step >>= 1
        return i

    def __len__(self):
        return self.size
    
    def __str__(self):
        res = [None] * self.size
        for i in range(self.size):
            res[i] = str(self.sum(i) -self.sum(i - 1))
        return ", ".join(res)
#solve
def solve():
    n, k = LI()
    lr = LIR(k)
    dp = [0] * (n + 1)
    dp[1] = 1
    dp[2] = -1
    for i in range(1, n):
        for l, r in lr:
            if i + l <= n:
                dp[i + l] += dp[i]
                if i + r + 1 <= n:
                    dp[i + r + 1] -= dp[i]
        dp[i + 1] = (dp[i+1]+dp[i])%mod
    print(dp[-1])


    return


#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 79584
N,K = map(int,input().split())
D = {}
for i in range(N) :
    a,b = map(int,input().split())
    if a not in D :
        D[a] = b
    else :
        D[a] += b
D = sorted(D.items(),key=lambda x: x[0])        

ctr = 0
for i in range(len(D)) :
    ctr += D[i][1]
    if ctr >= K :
        ans = D[i][0]
        break
print(ans)


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

int main()
{
    int n, m, c;
    cin >> n >> m >> c;
    vector<int> b(m);
    rep(i, m) cin >> b[i];
    int count = 0;

    rep(i, n)
    {
        int sum = c;
        rep(i, m)
        {
            int a;
            cin >> a;
            sum += a * b[i];
        }
        if (sum > 0)
            count++;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<math.h>
#include<limits>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i = 0;i < (n); ++i)

int main() {
	int n, r;
	cin >> n >> r;
	if (n >= 10)cout << r << endl;
	else {
		cout << r + 1000 - 100 * n << endl;
	}

	return 0;
}


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

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef long double ld;

const ll mod = (ll)1e9 + 7;
const ll mxN = 200200;

void solve() {
	ll d,n;
	cin>>d>>n;vll A(n),dist;
	for(int i=0;i<n;i++) cin>>A[i];
	for(int i=0;i+1<n;i++)
		dist.pb(A[i+1]-A[i]);
	dist.pb(d-A[n-1]+A[0]);
	sort(rall(dist));
	cout<<accumulate(all(dist),0)-dist[0];
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(20);
	cout << fixed;

	//ll t;cin>>t;while(t--)
	solve();

}


Measured memory_bytes: 3956
#include <bits/stdc++.h>
#define ri register
#define int long long
#define E (n+1)
using namespace std; const int N=200010;
inline int read()
{
    int s=0, w=1; ri char ch=getchar();
    while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }
    while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48), ch=getchar();
    return s*w;
}
signed main()
{
    int a=read();
    printf("%lld\n",48-a);
    return 0;
}

Measured memory_bytes: 3696
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repa(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define ALL(a) (a).begin(), (a).end()
#define COUT(x) cout << (x) << endl
#define VIEW(x) do{cout << "--" << #x << "--" << endl; view(x);}while(0)
template<typename T> void view(T e){COUT(e);}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
#define _GLIBCXX_DEBUG

int main(){
  
  char a, b;
  cin >> a >> b;
  if (a < b)
    cout << '<' << endl;
  else if (a > b)
    cout << '>' << endl;
  else
    cout << '=' << endl;
  
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>

#define REP(i, a, b) for ( int i = (a); i < (b); i++ )
#define REVREP(i, a, b) for ( int i = (a); i >= (b); i--)
#define DEBUG_INT(var) printf("the value of "#var" is %d\n", var)
#define PRINT_ARRAY(name, i) printf("the value of "#name"[%d] is %d\n", (i), name[(i)])
#define DEBUG_ARRAY(name, begin, end) REP(i, begin, end) PRINT_ARRAY(name, i)

#define YES puts("YES")
#define NO  puts("NO")
#define Yes puts("Yes")
#define No  puts("No")

using namespace std;

typedef long long ll;

int ans;
char c[3][5];

int main(void) {
	REP(i, 0, 3) scanf("%s", &c[i]);

  
    printf("%c%c%c\n", c[0][0], c[1][1], c[2][2]);

	return 0;
}


Measured memory_bytes: 256
import sys

input = sys.stdin.readline

n = int(input())

s_list = []
not_10_s_list = []

for _ in range(n):
    s = int(input())
    if not s % 10 == 0:
        not_10_s_list.append(s)
    s_list.append(s)

if len(not_10_s_list) == 0:
    print(0)
    exit(0)

else:
    sum_s = sum(s_list)
    if not sum_s % 10 == 0:
        max_s = sum_s
        print(max_s)
        exit(0)

    max_s = -1
    for not_10_s in not_10_s_list:
        if not sum_s - not_10_s % 10 == 0:
            max_s = max(max_s,sum_s - not_10_s)
    print(max_s)
    exit(0)

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

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define rep(i,n) for(int i=0; i<(int)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using P = pair<ll, ll>;

//constexpr ll mod = 998244353;
constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int k, n; cin >> k >> n;
  if (k%2==0) {
    cout << k/2 << ' ';
    rep(i, n-1) {
      cout << k << ' ';
    }
    cout << endl;
    return 0;
  }

  vector<int> ans(n, (k+1)/2);
  int p = n/2;
  int pos = n-1;
  rep(i, p) {
    if (ans[pos]>1) {
      ans[pos]--;
      for(int j=pos+1; j<n; j++) {
        ans[j] = k;
      }
      pos = n-1;
    } else {
      ans[pos]--;
      pos--;
    }
  }
  for(auto& e: ans) {
    if (e==0) break;
    cout << e << ' ';
  }
  cout << endl;
}

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


// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3") 
// #pragma GCC optimization ("unroll-loops")
 
#define ll  long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define S second
#define F first
#define die() return 0;
 
#define MD          1000000007
#define M           100011

long long  md=MD;


int solve(){
	int n,i,j,k,m;
	cin>>m>>k;
	if(k>=(1<<m)){
		cout<<"-1\n";die();
	}
	if(m==1){
		if(k==0){
			cout<<"0 0 1 1\n";
			die();


		}else{
			cout<<"-1\n";die();
		}
	}
	else{
		vector<int> v;
		for(i=0;i<(1<<m);++i){
			if(i!=k)v.pb(i);
		}
		for(int x:v)cout<<x<<" ";
		reverse(all(v));
		cout<<k<<" ";
		for(int x:v)cout<<x<<" ";
		cout<<k<<"\n";
	}


	return 0;
}


int main(){

 
     
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t;

    t=1;
    // cin>>t;

    while(t--){
    	solve();
    }



    

}



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

int main(){
    string s;
    cin >> s;
    ll ans = 0;
    for(int bit = 0; bit < (1<<(s.size()-1)); ++bit){//範囲注意
        ll num = s[0]-'0';//これで数字にできるんだ
        for(ll i = 0; i < s.size()-1; ++i){//範囲ちゅうい
            if(bit & (1<<i)){
                ans+=num;
                num=0;
            }
            num=num*10+s[i+1]-'0';
        }
        ans+=num;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
const double Pi=3.14159265358979323846;
const double sa=0.5;
const double sb=6;
int a,b;//hours, minutes
int h,m;
inline double Abs(double x) {
	return x>0.0?x:-x;
}
int main() {
	scanf("%d%d%d%d",&a,&b,&h,&m);
	m+=60.0*h;
	double da=m*sa;
	double db=m*sb;
	while (db>360.0) db-=360.0;
	double ang=Abs(da-db)*Pi/180;
	printf("%.20lf\n",sqrt(-2.0*a*b*cos(ang)+a*a+b*b));
	return 0;
}

Measured memory_bytes: 4208
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#include<iostream>
#include<map>
#include<cstring>
#define INF 0x3f3f3f3f
#define eps 1e-10
using namespace std;
int H,W,m,x,y,h[300005],w[300005],mh=-1,mw=-1,ans,b=0;
map<int,int>ht;
map<int,int>wt;
map<pair<int,int>,bool>pt;
vector<int>mah;
vector<int>maw;
int main(){
    scanf("%d%d%d",&H,&W,&m);
    for(int i=1;i<=m;i++){
        scanf("%d%d",&h[i],&w[i]);
        pt[{h[i],w[i]}]=1;
        ht[h[i]]++;
        wt[w[i]]++;
        if(ht[h[i]]>mh)
            mh=ht[h[i]];
        if(wt[w[i]]>mw)
            mw=wt[w[i]];
    }
    for(int i=1;i<=H;i++)
        if(ht[i]==mh)
            mah.push_back(i);
    for(int i=1;i<=W;i++)
        if(wt[i]==mw)
            maw.push_back(i);
    ans=mh+mw-1;
    for(int i=0;i<mah.size();i++){
        for(int j=0;j<maw.size();j++){
            if(pt[{mah[i],maw[j]}]==0){
                ans=mh+mw;
                b=1;
                break;
            }
        }
            if(b)
                break;
        }
    printf("%d",ans);
}

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

inline void fastio () {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
}

#define whats(x) cerr << #x << " = " << (x) << "\n"; 

using LL = long long;
using LD = long double;

const LL INF = LLONG_MAX;
const LL MOD = static_cast<LL>(1e9+7);
const LL N = 1e6+1;

int main() {
	fastio();

	string s, t;
	cin >> s >> t;

	LL cnt = 0;

	for (LL i = 0; i < s.size() ; ++i) {
		if (s[i] != t[i]) cnt++;
	}
	cout << cnt << "\n";

}

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

int main() {
    long long N, M;
    cin >> N >> M;
    priority_queue<long long, vector<long long>, greater<long long>>Q;
    for (long long i = 0; i < N; i++) {
        long long num;
        cin >> num;
        Q.push(num);
    }
    vector<pair<long long, long long>>A(M);
    for (long long i = 0; i < M; i++) {
        cin >> A.at(i).second >> A.at(i).first;
    }
    sort(A.begin(), A.end(), greater<pair<long long, long long>>());
    long long j = 0;
    while (j < M) {
        long long num = Q.top();
        Q.pop();
        if (A.at(j).second > 0 && num < A.at(j).first) {
            num = A.at(j).first;
            Q.push(num);
            A.at(j).second--;
        }
        else {
            Q.push(num);
            j++;
        }
    }
    long long ans = 0;
    while (!Q.empty()) {
        ans += Q.top();
        Q.pop();
    }
    cout << ans << endl;
}

Measured memory_bytes: 2676
#include<iostream>
#include<algorithm>
#include<string>
#include<stdlib.h>
#define ll long long

using namespace std;

const int N = 2e6+5;

long long a[N],b[N];

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

    ll m,n,k;
    ll ans=0;
    cin>>n>>m>>k;
    for(int i=1;i<=n;++i)cin>>a[i];
    ll tot=0;
    for(int i=1;i<=m;++i){
        cin>>b[i];
        tot+=b[i];
    }
    for(ll i=0,j=m;i<=n;++i){
        tot+=a[i];
        while(j>0&&tot>k)tot-=b[j--];
        if(tot>k)break;
        ans=max(ans,i+j);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 6772
k,s = gets.split(" ").map{|v|
	v.to_i
}

if k >= s then
	puts (s+2)*(s+1)/2
	exit
end

if s >= 2*k then
	t = 3*k - s
	puts (t+2)*(t+1)/2
	exit
end

puts (s+2)*(s+1)/2 - (s-k)*(s-k+1) /2*3


Measured memory_bytes: 1788
/*Author- Soumak Poddar*/

#include<bits/stdc++.h>
using namespace std;

#define ll long long int
#define sll signed long long int
#define ull unsigned long long int
#define um unordered_map
#define us unordered_set
#define mm multimap
#define mp make_pair
#define pb push_back
#define M 1000000007

bool comp(pair<int,int> a,pair<int,int> b)
{
   return a.second<b.second;
}

template<typename T>
T gcd(T a,T b)
{
   if(a==0)
      return b;
   return gcd(b%a,a);
}
template<typename T>
T lcm(T a,T b)
{
   T g=gcd<T>(a,b);
   return (a*b)/g;
}
template<typename T>
bool isprime(T n)
{
   if(n<=1)
      return false;
   for(int i=2;i<sqrt(n);i++)
      if(n%i==0)
         return false;
   return true;
}

void solve();
int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);

   #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("error.txt", "w", stderr);
      freopen("output.txt", "w", stdout);
   #endif
   
   int t=1;
   // cin>>t;
   while(t--)
   {
      solve();
      cout<<"\n";
   }
   cerr<<"Time Taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
   return 0;
}
void solve()
{
   string a,b;
   cin>>a;
   cin>>b;
   int ans=INT_MAX;
   int n=a.size(),m=b.size();
   for(int i=0;i<=n-m;i++)
   {
      int c=0;
      for(int j=0;j<m;j++)
      {
         if(b[j]!=a[i+j])
            c++;
      }
      ans=min(c,ans);
   }
   cout<<ans;
}

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

int main() {
  int s1s2s3;
    cin >> s1s2s3;
    cout << (s1s2s3 / 100) + (s1s2s3 % 100) / 10 + (s1s2s3 % 10) << endl;
}

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

int main(){
  int N;
  cin >> N;
  
  vector<int64_t> data(N);
  for(int i=0; i<N; i++){
    cin >> data.at(i);
  }
  sort(data.begin(), data.end());

  int64_t ans= data.back()- data.at(0);
  for(int n=1,offset=1; n+2 <= N-1; n+=2,offset++){
    ans+= data.at(N-1- offset)   - data.at(offset-1);
    ans+= data.at(N-1-(offset-1))- data.at(offset);
  }
  if(N%2 != 0){
    ans+= max(data.at(N/2+ 1)- data.at(N/2), data.at(N/2)- data.at(N/2- 1));
  }

  cout << ans << endl;
}

Measured memory_bytes: 4028
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long int
#define pb push_back

int main() {
  int N, max_n=0, min_n=1000, a;
  cin >> N;

  rep(i, N){
    cin >> a;
    max_n = max(a, max_n);
    min_n = min(a, min_n);
  }
  print(max_n-min_n);

}


Measured memory_bytes: 256
N, X, Y = map(int, input().split())
r = X - 1
l = N - Y
m = Y - X + 1
for i in range(1, N):
    ans = 0
    # mid ok 
    if i * 2 == m:
        ans += i
    elif i * 2 < m:
        ans += m
    # right
    ans += max(0, r + 1 - i)
    for j in range(1, r+1):
        if j >= i:
            continue
        diff = i - j
        # circle
        if diff * 2 == m:
            ans += 1
        elif diff * 2 < m:
            ans += 2
        # outer
        if diff - 1  >= 1 and diff - 1 <= l:
            ans += 1
    # left
    ans += max(0, l + 1 - i)
    for j in range(1, l+1):
        if j >= i:
            continue
        diff = i - j
        # circle
        if diff * 2 == m:
            ans += 1
        elif diff * 2 < m:
            ans += 2
    print(ans)


Measured memory_bytes: 3316
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
  string s;
  cin >> s;
  
  // YYMM
  const int ab = (int)(s[0]-'0')*10 + (int)(s[1]-'0');
  const int cd = (int)(s[2]-'0')*10 + (int)(s[3]-'0');

  bool ab_mm = false, cd_mm = false;
  if(1<=ab && ab<=12) ab_mm = true; //MM ok
  if(1<=cd && cd<=12) cd_mm = true; //MM ok
  
  string ans = "AMBIGUOUS";

  if(!ab_mm) {
    if(!cd_mm) { // FF
      ans = "NA";
    } else { // FT
      ans = "YYMM";
    }
  } else { // TF
    if(!cd_mm) {
      ans = "MMYY";
    }
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}

int main(){
    ll N,M;
    string S;
    cin >> N >> M;
    vector<ll> h(N);
    vector<vector<ll>> g(N);
    rep(i,N){
        cin >> h[i];
    }
    ll a, b;
    rep(i,M){
        cin >> a >> b;
        g[--a].push_back(--b);
        g[b].push_back(a);
    }
    ll cnt = 0;
    rep(i,N){
        if(g[i].size() == 0){
            cnt++;
            continue;
        }
        ll ph = h[i];
        bool flag = true;
        rep(j,g[i].size()){
            if(h[g[i][j]] >= ph){
                flag = false;
                break;
            }
        }
        if(flag){
            cnt++;
        }
    }
    cout << cnt <<endl;
}

Measured memory_bytes: 9860
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] args) throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String str = br.readLine();
			if(str == null || str == ""){
				break;
			}
			int input = Integer.parseInt(str);
			int count = 0;
			
			for (int i = 1; i <= input; i++) {
				if(isPrimeNum(i)){
					count++;
				}
			}
			System.out.println(count);
		}
	}
	
	static boolean isPrimeNum( int x ) {
		if( x == 2 ) return true;
		if( x < 2 || x % 2 == 0 ) return false;
		for( int n = 3; n <= Math.sqrt((double)x); n += 2 )
			if( x % n == 0 ) return false;
		return true;
	}
}

Measured memory_bytes: 18952
#include <bits/stdc++.h>
using namespace std;
int main()
{
  long long l, r; cin >> l >> r;
  if (r - l + 1 >= 673)
  {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 2020;
  for (int i = l; i < r; i++)
  {
    for (int j = i + 1; j <= r; j++)
    {
      ans = min(ans, 1ll * ((i % 2019) * (j % 2019)) % 2019);
    }
  }
  cout << ans << endl;
  return 0;
}

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

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

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

  vector<int> t(N+1);
  vector<int> x(N+1);
  vector<int> y(N+1);
  t[0] = 0;
  x[0] = 0;
  y[0] = 0;
  rep(i, N) {
    cin >> t[i+1] >> x[i+1] >> y[i+1];
  }

  rep(i, N) {
    int diff_t = t[i+1] - t[i];
    int diff_x = std::abs(x[i+1] - x[i]);
    int diff_y = std::abs(y[i+1] - y[i]);
    if (diff_t < diff_x + diff_y || (diff_t - diff_x - diff_y) % 2 != 0) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
#define  mem(a,x) memset(a,x,sizeof(a));
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
#define  pi  pair<int,int>
#define  pb  push_back
#define  F   first
#define  S   second
#define  B   begin()
#define  E   end()
int main()
{
    ft
    int t,i,j,n,m,l,r;
    cin>>n;
    int a[n+1];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    map<int,int>mp;
    vector<pi>v[2];
    for(i=0;i<n;i+=2)
    {
        mp[a[i]]++;
    }
    for(auto it=mp.B;it!=mp.E;it++)
    {
        v[0].pb({it->S,it->F});
    }
    mp.clear();
    for(i=1;i<n;i+=2)
    {
        mp[a[i]]++;
    }
    for(auto it=mp.B;it!=mp.E;it++)
    {
        v[1].pb({it->S,it->F});
    }
    sort(v[0].rbegin(),v[0].rend());
    sort(v[1].rbegin(),v[1].rend());
    if(v[0][0].S!=v[1][0].S)
    {
        cout<<n-v[0][0].F-v[1][0].F<<"\n";
    }
    else
    {
        l=v[0].size(),r=v[1].size();
        if(l>1 && r>1)
        {
            cout<<min(n-v[0][1].F-v[1][0].F,n-v[0][0].F-v[1][1].F)<<"\n";
        }
        else if(l>1)
        {
            cout<<n-v[0][1].F-v[1][0].F<<"\n";
        }
        else if(r>1)
        {
            cout<<n-v[0][0].F-v[1][1].F<<"\n";
        }
        else
        {
            cout<<(n/2)<<"\n";
        }
    }
    return 0;
}

Measured memory_bytes: 6988
a,b,k=map(int,input().split())
if k*2>b:
    for i in range(a,b+1):
        if i<a+k:
            print(i)
        elif b-k<i:
            print(i)
else:
    for i in range(a,min(a+k,b+1)):
        print(i)
    for i in range(max(a+k,b-k+1),b+1):
        print(i)

Measured memory_bytes: 3064
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    int n, x, tmp = 0, c = 0;
    cin >> n >> x;
    vector<int> l(n);
    for (int i = 0; i < n; ++i) {
        cin >> l[i];
        tmp += l[i];
        if (tmp <= x) c++;
    }
    cout << c + 1 << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AGC002RangeProduct
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] vals = Console.ReadLine().Split(' ');
            int a = int.Parse(vals[0]);
            int b = int.Parse(vals[1]);

            if(1 <= a)
            {
                Console.WriteLine("Positive");
            }
            else
            {
                if (0 <= b)
                {
                    Console.WriteLine("Zero");
                }
                else
                {
                    if((a * (-1) - b * (-1)) % 2 == 1)
                    {
                        Console.WriteLine("Positive");
                    }
                    else
                    {
                        Console.WriteLine("Negative");
                    }
                }
            }
        }
    }
}


Measured memory_bytes: 11092
/* << IN THE NAME OF GOD >> */
#include <bits/stdc++.h>
using namespace std;



#define err(x) cerr << #x  << " = "<<  x << '\n'
#define out(x) cout << x << '\n'
#define forp(i, r, l) for(int i = int(r); i < int(l); i++)
#define forn(i, r, l) for(int i = int(r); i > int(l); i--)
#define FAST ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll ,ll> pll;
const int maxn = 5e5 + 120;


int main(){FAST;   
    int a , b;
    cin >> a >> b;
    cout << (a*b - a -b + 1);

    
return 0;
}
 










Measured memory_bytes: 256
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        List<Integer>[] s = new ArrayList[m];
        for (int i = 0; i < m; i++) {
            s[i] = new ArrayList<>();
            int k = scanner.nextInt();
            for (int i1 = 0; i1 < k; i1++) {
                s[i].add(scanner.nextInt() - 1);
            }
        }

        int[] p = new int[m];
        for (int i = 0; i < m; i++) {
            p[i] = scanner.nextInt();
        }

        int ans = 0;
        l: for (int i = 0; i < 1 << n; i++) {
            char[] aChar = String.format("%0" + n + "d", Integer.parseInt(Integer.toBinaryString(i))).toCharArray();
            for (int i1 = 0; i1 < m; i1++) {
                int r = 0;
                for (Integer i2 : s[i1]) {
                    if (aChar[i2] == '1')
                        r++;
                }
                if (r % 2 != p[i1]) {
                    continue l;
                }
            }
            ans++;

        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 26268
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
  cin>>n;
  int c=0;
  while(n){
     if(n%10==7)
     c=1;
    n=n/10;
  }
  if(c==1)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}


Measured memory_bytes: 3636
// In the name of ALlah //
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
typedef long long ll;
// tamam tarif ha inja //
//{
int n , a[101] , ans;
vector<vector<int>> c;
vector<int> tmp;

//}
int main()
{
    cin >> n;
    for (int i = 0; i < n; i ++){
        cin >> a[i];
    }
    sort(a , a + n);
    for (int i = 0; i < n - 2; i ++){
        for (int j = i + 1; j < n - 1; j++){
            for (int u = j + 1; u < n; u++){
                if (a[u] < a[i] + a[j]){
                    tmp = {};
                    if (a[u] != a[i] && a[i] != a[j] && a[u] != a[j]){
                    tmp.push_back(a[i]); tmp.push_back(a[j]);tmp.push_back(a[u]);
                    c.push_back(tmp);
                    }
                }
            }
        }
    }
    ans = c.size();
    /*for (int i = 0; i < ans; i ++){
        for (auto x : c[i])
            cout << x << " ";
        cout << endl;
    }
     */
    cout << ans;
    return 0;
}


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

int main() {
	string T;
	cin >> T;
	for (int i = 0; i < T.size(); i++) {
		if (T[i] != '?') {
			continue;
		}
		//コーナーケースの処理
		if (T.size() == 1) {
			T[0] = 'D';
			continue;
		}
		if (i == 0) {
			if (T[i + 1] == '?')
				T[i] = 'P';
			else if (T[i + 1] == 'D')
				T[i] = 'P';
			else if (T[i + 1] == 'P')
				T[i] = 'D';
			continue;
		}
		if (i == T.size() - 1) {
			T[i] = 'D';
			continue;
		}

		//通常処理
		if (T[i - 1] == 'P') {
			T[i] = 'D';
		} else if (T[i - 1] == 'D') {
			if (T[i + 1] == '?')
				T[i] = 'P';
			else if (T[i + 1] == 'D')
				T[i] = 'P';
			else if (T[i + 1] == 'P')
				T[i] = 'D';
		}

	}
	cout << T << endl;

	return 0;
}


Measured memory_bytes: 3756
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define each(i,c) for(auto i=(c).begin();i!=(c).end();++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define clr(a) memset((a),0,sizeof(a))
#define nclr(a) memset((a),-1,sizoef(a))
#define sz(s) (int)((s).size())
#define INRANGE(x,s,e) ((s)<=(x) && (x)<(e))
#define pb push_back
#define MP(x,y) make_pair((x),(y))

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
const ll MAX_N = 300003LL;
const ll MAX_M = 300003LL;
vector<ll> a, suma;
ll b[MAX_M], c[MAX_M];
ll score[MAX_M];
int main()
{
	a.clear(), suma.clear();
	memset (b, 0LL, sizeof (b ) );
	memset (c, 0LL, sizeof (c ) );
 	memset (score, 0LL, sizeof (score ) );

	ios_base::sync_with_stdio(0);
	int N; cin >> N;
	a.resize (N+1, 0LL );
	suma.resize (N+1, 0LL );
	rep (i, N ) cin >> a[i+1];
	sort (ALL (a ) );

	suma[0] = a[0];
	for (int i = 1; i <= N; i++ ){
		suma[i] = suma[i-1] + a[i];
	} // end for

	int M; cin >> M;
	rep (j, M ) cin >> b[j];
	rep (j, M ) cin >> c[j];
	rep (j, M ){
		int ind = upper_bound (ALL (a ), b[j] ) - a.begin();
		score[j] = suma[ind-1];
	} // end rep

	rep (j, M ) 
		cout << (score[j] >= c[j] ? "Yes" : "No" ) << endl;

	return 0;
}

Measured memory_bytes: 12752
#include <iostream>
#include <cstdio>
#define N 100005
using namespace std;

typedef long long ll;
ll n, c, s, ans, a[N], b[N], mx[N], mx2[N];
int main()
{
	ll i, j;
	cin >> n >> c;
	for (i = 0; i < n; i++) {
		scanf ("%lld %lld", &a[i], &b[i]);
	}
	for (i = n - 1; i >= 0; i--) {
		s += b[i];
		mx[i] = max(mx[i + 1], s - (c - a[i]));
		mx2[i] = max(mx2[i + 1], s - (c - a[i]) * 2);
	}
	ans = max(mx[0], mx2[0]);
	s = 0;
	for (i = 0; i < n; i++) {
		s += b[i];
		ans = max(ans, s - a[i] * 2 + mx[i + 1]);
		ans = max(ans, s - a[i] + mx2[i + 1]);
	}
	cout <<ans;
    return 0;
}


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

int main() {
  int l, r, d;
  cin >> l >> r >> d;
  cout << r / d - (l - 1) / d << endl;
  return 0;
}


Measured memory_bytes: 3592
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int main()
{
	int n,m;
	long long ans;
	cin >> n >> m;
	vector<pair<int, int>> vec(n);

	for(int i=0; i<n;i++){
		cin >> vec[i].first >> vec[i].second;
	}
	sort(vec.begin(), vec.end());

	int sum=0;
	ans=0;
	for(int i=0; i<n; i++){
		if(vec[i].second <= (m-sum)){
			ans += (long long)vec[i].first * vec[i].second;	
			sum += vec[i].second;
		}else{
			ans += (long long)vec[i].first * (m-sum);
			break;
		}
	}

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

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

using namespace std;

int main(){

long double a,b,x;
long double PI = (acos(-1));
cin >> a >> b >> x;

long double theta;
 if (a*a*b /2.0 <= x)
 {
	theta = (long double)atan(2.0*(pow(a,2.0)*b-x)/(pow(a,3.0)));
}
else{
	theta = (long double)atan(a*b*b/(2.0*x)); 
}

theta = 180.0 * theta / PI;
cout << fixed << setprecision(10) <<  theta;

}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int n,i,j,count=0;
    scanf("%d",&n);
    int ara[n];
    for(i=0;i<n;i++){
        scanf("%d",&ara[i]);
    }
    int a=ara[0];
    for(i=1;i<n;i++){
        if(a>=ara[i]){
            count++;
            a=ara[i];
        }
    }
    printf("%d\n",count+1);
    return 0;
}


Measured memory_bytes: 2500
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;



int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);

  int h,w;
  cin>>h>>w;
  int count[30]={};
  for(int i=0;i<h*w;i++){
    char c;
    cin>>c;
    count[c-'a']++;
  }

  if(h%2==0&&w%2==0){
    for(int i=0;i<26;i++){
      if(count[i]%4!=0){
        cout<<"No"<<endl;
        return 0;
      }
    }
    cout<<"Yes"<<endl;
    return 0;
  }else {

    int use_four,use_two,use_one;
    if(h%2==1&&w%2==1){
      use_four=(h-1)/2*(w-1)/2;
      use_two=(h-1)/2+(w-1)/2;
      use_one=1;
    }else if(h%2==1&&w%2==0){
      use_four=(h-1)/2*w/2;
      use_two=w/2;
      use_one=0;
    }else{
      use_four=(w-1)/2*h/2;
      use_two=h/2;
      use_one=0;
    }

    for(int i=0;i<use_one;i++){
      for(int j=0;j<26;j++){
        if(count[j]%2==1){
          count[j]--;
          break;
        }
      }
    }

    for(int i=0;i<use_two;i++){
      for(int j=0;j<26;j++){
        if(count[j]%4==2){
          count[j]-=2;
          break;
        }
      }
    }



    for(int i=0;i<26;i++){
      if(count[i]%4!=0){
        cout<<"No"<<endl;
        return 0;
      }
    }

    // for(int i=0;i<26;i++){
    //   if(count[i]!=0){
    //     cout<<"No"<<endl;
    //     return 0;
    //   }
    // }

    cout<<"Yes"<<endl;

  }

  return 0;
}


Measured memory_bytes: 256
//  Be name khoda
// "Khodaya, be man "Tagwaye setiz" biamooz ta
//  dar anbuh masuliat nalaghzam ..." -Shariati
#include <bits/stdc++.h>
using namespace std;

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

#define F first
#define S second
#define MP make_pair

const int MAX = 1e5+9;
const ll MOD = 1e9+7;

int main () {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	string s, res;
	int t;
	cin >> s >> t;
	for (int i = 0; i < s.length(); i += t)
		res += s[i];
	cout << res << "\n";
}



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

int main(){
	int N; cin >> N;
	if (N==1)
		cout << "Hello World"<<endl;
	else
	{
		int A, B, ans;
		cin >> A >> B;
		ans = A + B;
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 256
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    int n,d,x;
    cin >> n >> d >> x;
    vector<int> a(n);
    int sum = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        int k = 0;
        while(a[i]*k + 1 <= d){
            sum++;
            k++;
        }
    }
    cout << sum + x << endl;

    return 0;
}



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

#define LL long long
typedef pair<int, int> pii;

template< typename T > inline void read(T &x)
{
    static char _c;
    static bool _f;

    x = 0;
    _f = 0;
    _c = getchar();

    while(_c < '0' || '9' < _c) {if(_c == '-') _f = true; _c = getchar();}
    while('0' <= _c && _c <= '9') {x = (x << 1) + (x << 3) + (_c & 15); _c = getchar();}
    if(_f) x = -x;
}

template < typename T > inline void Min(T &x, T y) {if(y < x) x = y;}
template < typename T > inline void Max(T &x, T y) {if(x < y) x = y;}


#define lowbit(x) ((x) & -(x))
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(l,r) ((l)+(((r)-(l))>>1))
#define fi first
#define se second
#define mk make_pair
#define pb push_back

const int MOD = (int) 1e9 + 7;
const int inf = (int) 1e9;
const int maxn = (int) 2e5 + 20;
const int maxm = (int) 5e5 + 20;

void work()
{
    int n, m;
    cin >>n >>m;
    vector<int> d(n + 1, 0), v(n + 1, 0);

    for(int i = 0; i < m; i++)
    {
        int x; cin >>x;
        v[x] = 1;
    }

    d[0] = 1;
    for(int i = 1; i <= n; i++)
    {
        if(v[i]) continue;
        d[i] = d[i - 1];
        if(i >= 2) d[i] += d[i - 2];
        d[i] %= MOD;
    }

    cout <<d[n] <<endl;
}

int main()
{
#ifdef yukihana0416
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif // yukihana0416
    int tc = 1;
//    cin >>tc;
    for(int ca = 1; ca <= tc; ca++)
    {
//        printf("Case #%d: ", ca);
        work();
    }
    return 0;
}


Measured memory_bytes: 1024
A,B,K = map(int,input().split())

for i in range(K):
    if i % 2 == 0:
        if A % 2 == 1:
            A -= 1
        A -= int(A/2)
        B += A
    else:
        if B % 2 == 1:
            B -= 1
        B -= int(B/2)
        A += B
print(A,B)

Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; i++ )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;

int dp[41][500][500];
int main(){
    int n,s,t;
    cin>>n>>s>>t;
    int a[n],b[n],c[n];
    rep(i,n)cin>>a[i]>>b[i]>>c[i];
    rep(k,41)rep(i,500)rep(j,500)dp[k][i][j]=inf;
    dp[0][0][0]=0;
    rep(i,n)rep(j,401)rep(k,401){
        dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k]);
        dp[i+1][j+a[i]][k+b[i]]=min(dp[i+1][j+a[i]][k+b[i]],dp[i][j][k]+c[i]);
    }
    int ans=inf;
    int i=1;
    while(i*(max(s,t))<500){
        ans=min(ans,dp[n][i*s][i*t]);
        i++;
    }
    cout<<(ans==inf?-1:ans)<<endl;
    return 0;
}

Measured memory_bytes: 40320
import java.util.*;
// import java.io.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();

        int num = sc.nextInt();

        ArrayList<Integer> array = new ArrayList<>();
        for (int i = 0; i < num; i++) {
            int tmp = sc.nextInt();
            array.add(tmp);
        }

        int num_query = sc.nextInt();

        for (int i = 0; i < num_query; i++) {
            int b = sc.nextInt();
            int e = sc.nextInt();
            int t = sc.nextInt();

            List<Integer> left = new ArrayList<>(array.subList(b, e));

            for (int j = 0; j < left.size(); j++) {
                array.set(j + b, array.get(j + t));
                array.set(j + t, left.get(j));
            }
        }

        for (int i = 0; i < array.size(); i++) {
            sb.append(array.get(i));
            if (i != array.size() - 1) sb.append(' ');
        }

        System.out.println(sb);
        
        sc.close();
    }
}



Measured memory_bytes: 36704
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using lint = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL << 60;

int main()
{
    double l;
    cin >> l;

    double ans = (l/3)*(l/3)*(l/3);

    cout << fixed << setprecision(12) << ans << endl;

    return 0;
}

Measured memory_bytes: 256