akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//#include <math.h>
using namespace std;

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<int,P> PP;

struct edge {
	int to, cost;
	edge(int t,int c):to(t),cost(c) {}
};
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

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

int n,m,q;
vector<int> g[100000];
int c[100000],v,d;
int dp[11][100000];

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

	REP(i,11) fill(dp[i],dp[i]+100000,-1);

	cin>>n>>m;
	REP(i,m) {
		int x,y;cin>>x>>y;x--,y--;
		g[x].pb(y),g[y].pb(x);
	}
	cin>>q;
	REP(i,q) {
		cin>>v>>d>>c[i];
		v--;
		dp[d][v]=i;
	}

	for(int i=10;i>0;i--) {
		REP(j,n) {
			if(dp[i][j]!=-1) {
				dp[i-1][j]=max(dp[i-1][j],dp[i][j]);
				for(auto u:g[j]) dp[i-1][u]=max(dp[i-1][u],dp[i][j]);
			}
		}
	}
	REP(i,n) cout<<(dp[0][i]==-1?0:c[dp[0][i]])<<endl;

	return 0;
}


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

#define ll long long

const ll MAX_N = 100001;
ll n,k;
ll one_jump_cost, two_jump_cost;
ll h[MAX_N];
ll cost[MAX_N] = {MAX_N};

void enableFastIO(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

void solve(){
	cin>>n>>k;
  	for(ll i = 1; i <= n ; i++)
      	cin>>h[i];
  	for(ll i = 2; i <= n ; i++){
      	cost[i] = cost[i-1] + abs(h[i-1] - h[i]);
      	for(ll j = 2 ; (i - j >= 1) && (j <= k) ; j++)
      		cost[i] = min(cost[i], cost[i-j] + abs(h[i] - h[i-j]));
    }
    cout<<cost[n];
}

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

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

int main()
{
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    unsigned long long int result = ((a[2] * 10)+a[1]) + a[0];
    cout<<result<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define All(a) a.begin(),a.end()
#define INF 1000000007
const int MOD = 1000000007;
//accumulate(vec.begin(), vec.end(), 0)

int gcd(int x,int y){
  if(x%y==0) return y;
  else return gcd(y,x%y);
}

int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  cout<< a*(n/(a+b)) + min(a,n%(a+b)) <<endl;
}


Measured memory_bytes: 256
"""
i - j = A[i] + A[j]
> i - A[i] = j + A[j]
i > j
"""
from collections import defaultdict

N = int(input())
high = list(map(int, input().split()))

ans = 0
calc = defaultdict(int)
for i in range(1, N+1):
  ans += calc[i - high[i-1]]
  calc[i + high[i-1]] += 1

print(ans)

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


int main() {
  static const double pi = 3.141592653589793;
  int A,B;
  int H,M;
  cin >> A >> B >> H >> M;
  double K = cos(2*(pi)*(60*H - 11*M)/720);
  long double L = sqrt(A*A + B*B - 2*A*B*K );
  cout << fixed << setprecision(10);
  cout << L << endl;
  
  
}


Measured memory_bytes: 4188
using System;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.IO;


namespace SolutionCS
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string t = Console.ReadLine();

            HashSet<int>[] StoT = new HashSet<int>[26];
            HashSet<int>[] TtoS = new HashSet<int>[26];
            for (int i = 0; i < 26; i++)
            {
                StoT[i] = new HashSet<int>();
                TtoS[i] = new HashSet<int>();
            }

            for (int i = 0; i < s.Length; i++)
            {
                StoT[s[i] - 'a'].Add(t[i]);
                TtoS[t[i] - 'a'].Add(s[i]);
            }

            for (int i = 0; i < 26; i++)
            {
                if (StoT[i].Count > 1)
                {
                    Console.WriteLine("No");
                    return;
                }
                if (TtoS[i].Count > 1)
                {
                    Console.WriteLine("No");
                    return;
                }
            }

            Console.WriteLine("Yes");
        }
    }
}


Measured memory_bytes: 14816
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REPR(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define FOR(i, n, m) for (ll i = (n); i < (m); ++i)
#define FORR(i, n, m) for (ll i = (m) - 1; i >= (n); --i) 
#define FORE(x, xs) for (auto &x: (xs))
#define ALL(v) v.begin(), v.end()
#define ZERO(a) memset(a,0,sizeof(a))

const int INF = 1000000009;
const int MOD = 1000000007;
const double EPS = 1e-14;
const double PI = acos(-1);

const int MAX = 410;
int N, C;
ll A[MAX], B[MAX];
ll dp[MAX][MAX];// dp[i][k]: i人決定していて、k個配っている
ll happy[MAX][MAX]; // happy[x][k] : 活発度xの子供にk子の飴を上げた時のうれしさ

void init() {
    FOR (i, 1, MAX) {
        happy[i][0] = 1;
        REP (k, MAX-1) (happy[i][k+1] = happy[i][k]*i) %= MOD;
    }
    REP (k, MAX) {
        REP (i, MAX-1) (happy[i+1][k] += happy[i][k]) %= MOD;
    }
}

inline ll getHappy(ll a, ll b, ll k) { // 活発度がa~bのこどもにk個の飴を上げた時の幸福度
    return (MOD+happy[b][k]-happy[a-1][k]) % MOD;
}

int main() {
    init();

    cin >> N >> C;
    REP (i, N) cin >> A[i];
    REP (i, N) cin >> B[i];

    dp[0][0] = 1;
    REP (i, N) {
        REP (j, C+1) {
            REP (k, j+1) {
                (dp[i+1][j] += dp[i][k] * getHappy(A[i], B[i], j-k)) %= MOD;
            }
        }
    }
    /*
    REP (i, N+1) {
        REP (j, C+1) cout << dp[i][j] << " ";
        cout << "\n";
    }
    */

    cout << dp[N][C] << endl;
}

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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

int main(){
    int x;
    cin>>x;
    
    if(x==3 || x==5 || x==7){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }

    return 0;
}

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

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

 
    ll n, m;
  cin >> n >> m;
  ll arr, days=0;
  for(ll i=0; i<m; i++){
    cin >> arr;
    days += arr;
  }
  
  if(days > n) cout << -1 << endl;
  else cout << n-days << endl;
  
  

    return 0;
}


Measured memory_bytes: 3612
#include <queue>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <map>
#include <functional>
#include <set>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define MAX(a, b) (((a) < (b)) ? (b) : (a))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))

using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
const ll inf = (1LL << 60);
const ll mod = 1000000007;
ll max(ll a, ll b) {
	if (a < b)
		return b;
	else
		return a;

}
ll min(ll a, ll b) {
	if (a < b)
		return a;
	else
		return b;

}



int main() {
	ll N;

	cin >> N;
	vector<ll> A(N + 1), T(N + 1);
	rep(i, N) {
		cin >> A[i];
		T[A[i]] = i + 1;
	}

	set<ll> S, M;
	ll sum = 0;
	S.insert(0), S.insert(N + 1);
	M.insert(0), M.insert(-(N + 1));
	for (int i = 1; i <= N; i++) {

		auto it = S.lower_bound(T[i]);
		auto it2 = M.lower_bound(-T[i]);
		int a = *it;
		int b = -*it2;
		sum += i * (a - T[i]) * (T[i] - b);
		S.insert(T[i]);
		M.insert(-T[i]);
	}


	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 22144
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
 
int main() {
   ll x;
   cin >> x;
   ll cnt = (x / 11) * 2;
   x %= 11;
 
   if (x == 0) {
      cout << cnt << endl;
   } else if (x <= 6) {
      cout << cnt + 1 << endl;
   } else {
      cout << cnt + 2 << endl;
   }
 
   return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<set>
#include<map>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
int n,m;
int main()
{
    char ch[10];
    cin>>ch;
    int flag=0;
    for(int i=0;i<strlen(ch)-1;i++)
    {
        if(ch[i]=='A'&&ch[i+1]=='C')
        {
            flag=1;
            break;
        }
    }
    if(flag) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<cstdio>
#include<algorithm>

using namespace std;

int r[12],n;
double tbl_sqrt[101];

// memo[stat][last] :
//  Ì¶[©çÉcakeðu¢Ä¢­B
// u¢½cakeªstat(bitÅ\»)AÅãÉu¢½cakeªlastÌÆ«ÉA
// cèÌcakeðu­ÌÉKvÈÅ¬ªmemo[stat][last]B
double memo[1<<12][12];

double solve(int stat,int last)
{
//printf("stat : %d\n",stat);
	if(memo[stat][last]>1e-6)	return memo[stat][last];

	if(stat==0)	return memo[stat][last]=r[last];

	double wmin=10000;
	for(int i=0;i<n;i++){
		if((stat&(1<<i))==0)	continue;
		stat&=~(1<<i);
		wmin=min(wmin,2*tbl_sqrt[r[last]*r[i]]+solve(stat,i));
		stat|=(1<<i);
	}
//printf("stat : %d, wmin : %.3f\n",stat,wmin);
	return memo[stat][last]=wmin;
}

int main()
{
	for(int i=1;i<=100;i++)	tbl_sqrt[i]=sqrt(i);

	int box;
	while(~scanf("%d ",&box)){
		for(n=1;;n++){
			scanf("%d",r+n-1);
			if(getchar()=='\n')	break;
		}

		for(int i=0;i<n;i++)for(int j=0;j<(1<<n);j++)memo[j][i]=0;

//printf("n=%d\n",n);
		double ans=10000;
		for(int i=0;i<n;i++){
			int stat=((1<<n)-1)&~(1<<i);
//printf("start stat : %d\n",stat);
			ans=min(ans,r[i]+solve(stat,i));
//printf("stat : %d, ans : %.3f\n",stat,ans);
		}
//printf("ans = %.5f\n",ans);
		puts(ans<=box?"OK":"NA");
	}

	return 0;
}

Measured memory_bytes: 0
x=input()
stones=input()
swit=0
maru=0


for st in stones:
    if st=='#':
        maru+=1

l=len(stones)
if maru>l-maru:
    kouho=l-maru
else:
    kouho=maru

minkouho=l-maru
kouho2=l-maru

for st in stones:
    if st=='.':
        kouho2-=1
    else:
        kouho2+=1
    if kouho2<minkouho:
        minkouho=kouho2


print(min(maru,minkouho))

Measured memory_bytes: 3500
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10
    a = input()
    if 0 <= ord(a) - ord('a') <= 25:
        print('a')
    else:
        print('A')
    
main()

Measured memory_bytes: 65164
#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <string.h>
#include <string>
#include <math.h>
#include <iomanip>
using namespace std;

#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define pb push_back

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

const int mod = (int)1e9 + 7;
const int mod2 = 998244353;

ll exp(ll taban, ll us, ll md) {
    ll carpan = taban % md;
	if(carpan == 0) return 0;
    ll temp = us;
    ll res = 1;
    while(temp){
        if(temp % 2) res = (res*carpan) % md;
        temp /= 2;
        carpan = (carpan*carpan) % md;
    }
    return res;
}
 
ll ebob(ll a, ll b){
    if(!a)return b;
    return ebob(b%a, a);
}

ll ekok(ll a, ll b){
    return (a*b)/ebob(a, b);
}
ll mul(ll a, ll b, ll md){
	return a*b % md;
}
vector<ll> fact;
vector<ll> inv_fact;
void fact_init(int n){
	fact.resize(n+5);
	inv_fact.resize(n+5);
	fact[0] = inv_fact[0] = 1;
	for(int i = 1; i <= n; i++){
		fact[i] = (fact[i-1] * i) % mod;
		inv_fact[i] = exp(fact[i], mod-2, mod);
	}
}
ll komb(ll a, ll b){
	return fact[a] * (inv_fact[a-b] * inv_fact[b] % mod) % mod;
}
const int N = 1e6+5;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
	ll n; cin>>n;
	ll ans = 0;
	for(ll i = 2; i*i <= n; i++){
		int cnt = 0;
		while(n % i == 0){
			n /= i;
			cnt++;
		}
		int tmp = 0;
		while(tmp * (tmp+1)/2 < cnt) tmp++;
		if(tmp * (tmp+1)/2 > cnt) tmp--;
		ans += tmp;
	}
	if(n > 1) ans++;
	cout<<ans<<endl;
}

Measured memory_bytes: 3652
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        get(N).stream().forEach(System.out::println);
    }

    private static List<String> get(int N){
        if(N == 1){
            return Arrays.asList("a");
        }
        List<String> bef = get(N-1);
        return bef.stream().flatMap(Main::generate).collect(Collectors.toList());
    }

    private static Stream<String> generate(String s){
        char maxc=0;
        for(char c:s.toCharArray()){
            maxc = c<maxc ? maxc: c;
        }
        List<String> res = new ArrayList<>();
        for(char c='a';c<=maxc+1;c++){
            StringBuilder bld = new StringBuilder();
            bld.append(s);
            bld.append(c);
            res.add(bld.toString());
        }
        return res.stream();
    }

}


Measured memory_bytes: 52148
#include<stdio.h>
int main(){
  int a,n, i;
  long long max=-1000000 ,min=1000000 ,sum=0;
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&a);
    sum+=a;
    if(max < a) max=a;
    if(a < min) min=a;
  }
  printf("%lld %lld %lld\n",min,max,sum);
  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P std::pair<int,int>
#define PiP std::pair<int,std::pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp std::make_pair
#define prique(T) std::priority_queue<T,vector<T>,greater<T>>
using namespace std;
template<class T> inline void chmax(T& a, T b) { a = std::max(a, b); }
template<class T> inline void chmin(T& a, T b) { a = std::min(a, b); }

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
int get_rand(int MIN, int MAX) {
	std::random_device rnd;
	std::mt19937 mt32(rnd());
	std::uniform_int_distribution<int>engine(MIN, MAX);
	return engine(mt32);
}
/*--------Library Zone!--------*/

int n;
int cnt[114514];
signed main() {
	cin >> n;
	rep(i, n) {
		int a; cin >> a; cnt[a]++;
		if (i == 0 && a != 0) {
			cout << 0 << endl; return 0;
		}
	}
	if (cnt[0] != 1) {
		cout << 0 << endl; return 0;
	}
	bool flag = false;
	rep(i, n) {
		if (cnt[i] == 0)flag = true;
		if (flag && cnt[i]) {
			cout << 0 << endl; return 0;
		}
	}
	int ans = 1;
	REP(i, n) {
		ans *= mod_pow(cnt[i - 1], cnt[i], 998244353);
		ans %= 998244353;
	}
	cout << ans << endl;
}

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

int Q;

int main(){
  cin >> Q;
  for(int i=0;i<Q;i++){
    set<int> F;
    string n; cin >> n;
    int cnt = 0;
    while( n.size() > 1 ){
      int mn = -1;      
      for(int i=1;i<n.size();i++){
        string a = n.substr(i), b = n.substr(0,i);
        int x = stoi(a);
        int y = stoi(b);
        mn = max( mn, x*y );
      }
      if( F.count( mn ) == 0 ) {
        cnt++;
        F.insert( mn );
        n = to_string( mn );
      } else {
        cnt = -1;
        break;
      }
    }
    cout << cnt << endl;
  }
}

Measured memory_bytes: 3292
use std::cmp;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        k: usize,
        a: usize,
        b: usize
    }

    let mut ride = 0;
    let mut ok = false;

    while ride < b {
        ride += k;
        if a <= ride && b >= ride {
            ok = true;
        }
    }

    println!("{}", if ok { "OK" } else { "NG" });
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 2260
from collections import Counter
H,W=map(int,input().split())
li=[]
for i in range(H):
    a=list(input())
    li+=a
c=Counter(li)
t,o=0,0
for x,y in c.items():
    l=y%4
    t+=l//2
    o+=l%2
isok=True
if(H%2==0 and W%2==0):
    if t!=0 or o!=0:
        isok=False
elif(H%2==0 and W%2==1):
    if(t>H//2 or o>0):
        isok=False
elif(H%2==1 and W%2==0):
    if(t>W//2 or o>0):
        isok=False
else:
    if(t>W//2+H//2 or o>1):
        isok=False
print('Yes' if isok else 'No')

Measured memory_bytes: 3444
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal

INF = 1 << 50


def run():
    N, *A = map(int, read().split())
    M = 200003
    P = [0] * (M-1)
    A = [a for a in A if a != 0]
    val2arr = {}
    arr2val = {}
    val = 1
    for p in range(M-1):
        val2arr[val] = p
        arr2val[p] = val
        val *= 2
        val %= M

    for a in A:
        k = val2arr[a]
        P[k] += 1

    L = 1 << (2 * M - 3).bit_length()

    fft_f = np.fft.ifft(np.fft.fft(P, L) ** 2)
    fft_f = [round(val.real) for val in fft_f]
    sum = 0
    for i in range(L):
        k = i % (M-1)
        sum += fft_f[i] * arr2val[k]

    sub = 0
    for a in A:
        sub += (a * a) % M
    print(int((sum - sub) // 2))



if __name__ == "__main__":
    run()

Measured memory_bytes: 104396
/*                         _
                        _ooOoo_
                       o8888888o
                       88" . "88
                       (| -_- |)
                       O\  =  /O
                    ____/`---'\____
                  .'  \\|     |//  `.
                 /  \\|||  :  |||//  \
                /  _||||| -:- |||||_  \
                |   | \\\  -  /'| |   |
                | \_|  `\`---'//  |_/ |
                \  .-\__ `-. -'__/-.  /
              ___`. .'  /--.--\  `. .'___
           ."" '<  `.___\_<|>_/___.' _> \"".
          | | :  `- \`. ;`. _/; .'/ /  .' ; |
          \  \ `-.   \_\_`. _.'_/_/  -' _.' /
===========`-.`___`-.__\ \___  /__.-'_.'_.-'================

                  Please give me AC.
*/

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <bitset>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <chrono>
#include <random>

using namespace std;

using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define print2(x, y) cout << (x) << ' ' << (y) << '\n'
#define print3(x, y, z) cout << (x) << ' ' << (y) << ' ' << (z) << '\n'
#define printn(v) rep(i, (v).size() - 1) cout << (v)[i] << ' '; cout << (v)[n - 1] << '\n';
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;

template<typename T> T gcd(T a, T b) {
    if (a < b) return gcd(b, a);
    T r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

template<typename T> T lcm(const T a, const T b) {
    return a / gcd(a, b) * b;
}

template<typename T> bool chmin(T& a, const T& b) {
    if (a > b) return a = b, true; else return false;
}

template<typename T> bool chmax(T& a, const T& b) {
    if (a < b) return a = b, true; else return false;
}

// End of template.

int main() {
    cout << fixed << setprecision(15);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    // cin.read(buf, sizeof buf); // 注意: ./a.out < in か pbp | ./a.out で入力すること

    int64 a, b, n;
    cin >> a >> b >> n;

    int64 x = min(b - 1, n);
    int64 ans = a * x / b - a * (x / b);
    print(max(0LL, ans));

    return 0;
}



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

#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028L;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N;
int a[110000];
signed main() {
    cin >> N;
    bool ans = false;
    rep(i, N) {
        cin >> a[i];
        ans |= a[i] & 1;
    }
    if (ans) { cout << "first" << endl; }
    else { cout << "second" << endl; }
}


Measured memory_bytes: 1024
n = int(input())
ar = [[] for i in range(n)]
for i in range(n-1):
    ipt = list(map(int,input().split()))
    ar[ipt[0]-1].append((ipt[1]-1,ipt[2]))
    ar[ipt[1]-1].append((ipt[0]-1,ipt[2]))

ans = [-1 for i in range(n)]
u = 0
ans[u] = 0
queue = [u] #キュー
l = 1
while True:
    if l == 0:
        break
    u = queue.pop(0)
    l -= 1
    for v in ar[u]:
        if ans[v[0]] < 0:
            ans[v[0]] = ans[u] + v[1]
            queue.append(v[0])
            l+=1

for i in range(n):
    print(ans[i]%2)

Measured memory_bytes: 70048
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

const int N=1e6+5, mod=1e9+7;
LL n,fac[N],inv[N],tot,Ans;

LL qpow(LL x,int y)
{
	LL ret=1;
	while(y)
	{
		if(y&1) ret=ret*x%mod;
		x=x*x%mod, y>>=1;
	}
	return ret; 
}
LL C(int x,int y) {return fac[x]*inv[y]%mod*inv[x-y]%mod;}
LL calc(int x) {return C(n-2-x,x)%mod*fac[n-1-x]%mod*fac[x]%mod;}
int main()
{
	scanf("%lld",&n);
	if(n < 5)
	{
		if(n == 2) puts("1");
		if(n == 3) puts("4");
		if(n == 4) puts("16");
		return 0;
	}
	fac[0]=1;
	for(int i=1;i<N;++i) fac[i]=fac[i-1]*i%mod;
	inv[N-1]=qpow(fac[N-1],mod-2);
	for(int i=N-2;i>=0;--i) inv[i]=inv[i+1]*(i+1)%mod;
	int tmp=(n-2)/2;
	for(int i=tmp;i>=0;--i)
	{
		tot=calc(i)-calc(i+1);
		Ans+=tot*(n-i-1)%mod, Ans%=mod;
	}
	//cout<<Ans<<endl;
	Ans+=mod, Ans%=mod;
	printf("%lld",Ans);
	return 0;
}

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

int main()
{
    int A, B, C;
    cin >> A >> B >> C;

    int x[3] = {A, B, C};
    sort(x, x + 3);

    if (x[1] == C)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


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

using namespace std;

const int N = 52, mod = 1e9 + 7;
char s[3][N + 3];
int n;
int dp[N + 3];
int obj[N + 3];
int main() {

	cin >> n;
	for(int i = 1; i <= 2; ++i)
		cin >> (s[i] + 1);
	dp[0] = 1;
	int j = 1;
	int sz = 0;
	for(j = 1; j <= n; ++j) {
		if(s[1][j] == s[2][j]) {
			obj[++sz] = 1;
		} else {
			obj[++sz] = 2;
			j ++;
		}
	}
	dp[0] = 1;
	for(int i = 1; i <= sz; ++i) {
		if(obj[i] == 1) {
			if(i == 1)
				dp[i] = 3;
			else if(obj[i - 1] == 1) dp[i] = 2LL*dp[i - 1] % mod;
			else dp[i] = dp[i - 1];
		} else {
            if(i == 1) {
              dp[i] = 6;
            }
			else if(obj[i - 1] == 1)
				dp[i] = 2LL * dp[i - 1] % mod;
			else dp[i] = 3LL * dp[i - 1] % mod;
		}
	}
	cout << dp[sz];
}


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

using namespace std;
typedef long long ll;
typedef vector<ll> vel;
typedef vector<string> ves;
typedef vector<int> vei;
typedef vector<vector<int>> vvei;
typedef vector<vector<ll>> vvel;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REP(a, b, m) for (ll a = (ll)(b); a < (ll)(m); a++)

int main() {
    int n,m;
    cin >>n>>m;
    ll x;
    cin>>x;
    vei c(n);
    vvei a(n,vei(m+1));
rep(i,n){
        cin>>c[i];
        rep(j,m){
            cin>>a[i][j];
        }
    }
    int ans=1000000000;
    rep(i,1<<n) {
        int money =0;
        vei syuuzyuku(m,0);
        rep(j,n) {
            if(i>>j&1) {
                money +=c[j];
                rep(l,m) {
                    syuuzyuku[l]+=a[j][l];
                }
            }
            bool flag =true;
            rep(l,m) {
                if(syuuzyuku[l]<x) flag =false;
            }
            if(flag) {
                ans =min(ans,money);
            }
        }
    }
    if(ans==1000000000) {
        cout<<-1<<endl;
    }
    else {
    cout <<ans<<endl;
    }
}

Measured memory_bytes: 3584
#include <stdio.h>

int main(void){
    char S[10+2];
    char T[10+3];

    fgets(S, sizeof(S), stdin);
    fgets(T, sizeof(T), stdin);
    
    int i = 0;
    while(S[i] != '\n'){
        if(S[i] != T[i]){
            break;
        }
        i++;
    }

    if(S[i] == '\n'){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}


Measured memory_bytes: 1484
#include <stdio.h>
int A[2][100],dp[2][100];
int max(int a,int b){return (a>b)?a:b;}
int main()
{
    int N,i,j;
    scanf("%d",&N);
    for(i=0;i<2;i++)
    {
        for(j=0;j<N;j++) scanf("%d",&A[i][j]);
    }
    for(i=0;i<2;i++)
    {
        for(j=0;j<N;j++)
        {
            dp[i][j]=A[i][j];
            if(i>0) dp[i][j]=max(dp[i][j],dp[i-1][j]+A[i][j]);
            if(j>0) dp[i][j]=max(dp[i][j],dp[i][j-1]+A[i][j]);
        }
    }
    printf("%d\n",dp[1][N-1]);
    return 0;
} 

Measured memory_bytes: 128
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var axb = long.Parse(string.Join("", ReadLine().Split()));
            for (var i = 1; i * i <= axb; ++i)
                if (i * i == axb)
                {
                    WriteLine("Yes");
                    return;
                }
            WriteLine("No");
        }
        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 27448
N, M, Q = gets.split.map(&:to_i)
$query = Array.new(N).map { Array.new }

$<.read.split.map(&:to_i).each_slice(4) do |a, b, c, d|
    $query[b-1].push [a-1, b-1, c, d]
end


$key = Array.new(N)
@max = 0

def solve(index, last, value)
    if N <= index
        @max = value if @max < value
        return
    end
        
    last.upto(M) do |i|
        $key[index] = i
        plus = 0
        
        $query[index].each do |q|
            plus += q[3] if $key[q[1]] == $key[q[0]] + q[2]
        end
        
        solve(index + 1, i, value + plus)
    end
end
    
solve(0, 1, 0)

puts @max

Measured memory_bytes: 14304
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;

// 最大公約数
ll gcd(ll a, ll b)
{
   if (a%b == 0) {
       return(b);
   } else {
       return(gcd(b, a%b));
   }
}

// 最小公倍数
ll lcm(ll a, ll b){
   return a / gcd(a, b) * b;
}

//素数判定
bool is_prime(const unsigned n){
    switch(n){
        case 0: // fall-through
        case 1: return false;
        case 2: // fall-through
        case 3: return true;
    } // n > 3 が保証された
    if(n % 2 == 0 || n % 3 == 0) return false;
    for(unsigned i = 5; i * i <= n; i += 6) {
        if(n % i     == 0) return false; // (6の倍数)-1
        if(n % (i+2) == 0) return false; // (6の倍数)+1
    }
    return true;
}

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

/*   *   *   *   *   *   *   *   *   *   *   */

void solve() {
    ll n; cin >> n;
    Vl a(n), b(n);
    rep(i, 0, n) cin >> a[i] >> b[i];
    ll ans = 0, c = 0;
    for(int i = n-1; i >= 0; i--){
        if(((a[i]+c)%b[i]) == 0) continue;
        ans += b[i]-((a[i]+c)%b[i]);
        c += b[i]-((a[i]+c)%b[i]);
    }
    cout << ans << endl;
}

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

    solve();
    return 0;
}


Measured memory_bytes: 1792
A = int(input()) # 500
B = int(input()) # 100
C = int(input()) # 50
X = int(input())

count = 0

for i in range(min(A, X // 500) + 1):
  tmp = X - 500 * i
  for j in range(min(B, tmp // 100) + 1):
    tmp2 = tmp - 100 * j
    k = tmp2 / 50
    if 0 <= k <= C:
      # print(i, j, k)
      count += 1
      
print(count)
      
  



Measured memory_bytes: 3060
#include<bits/stdc++.h>
///...................................*****.................................................///
///        Author :  MD. Rakibul Islam ( mmdrakibul2912@gmail.com )                         ///
///                  Department of Computer Science                                         ///
///                  & Engineering,                                                         ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///
using namespace std;
int main()
{
    int n, m, i, j, k, l;
    cin>>n;
    int a[n+2];
    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    double sum=((a[0]+a[1])*1.0)/2;
    for(i=2; i<n; i++)
    {
        sum=(((sum+a[i])*1.0)/(2));
    }
    cout<<sum<<endl;
    return 0;
}


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

using ll = long long;
using namespace std;

const int N = 2e9;

void solveCase() {

   int n, x;
   cin >> n >> x;
   vector <int> v(n);
   for(auto &e: v) {
      cin >> e;
   }

   sort(v.begin(), v.end());


   int idx = 0;
   int ans = 0;
   while(x > 0 && idx < n) {
      if(x >= v[idx]) {
         x -= v[idx];
         ans++;
         if(idx + 1 == n && x > 0) {
            ans--;
         }
      } else {
         break;
      }
      idx++;
   }
   cout << ans << endl;
}


int main() {
   cin.tie(0);
   cin.sync_with_stdio(0);
   
   int testcase = 1;
   // cin >> testcase;
 
   for(int i = 0; i < testcase; i++) {
      solveCase();
   }
 
   return 0;
}


Measured memory_bytes: 3588
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

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

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


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

A, B, X = getNM()

def small_tlit(a, b, x):
    return (2 * b / a) - (2 * x / (a ** 3))

def big_tlit(a, b, x):
    return a * (b ** 2) / (2 * x)

def tan(angle):
    return math.tan(math.radians(angle))

left = 0
right = 90

for _ in range(100):
    mid = (left + right) / 2
    res = 0
    if 2 * X >= (A ** 2) * B:
        res = small_tlit(A, B, X)
    else:
        res = big_tlit(A, B, X)

    if tan(mid) <= res:
        left = mid
    else:
        right = mid
print(right)

Measured memory_bytes: 62572
import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val n = in.readLine()

    out.println(
      n
        .replace('1', 'X')
        .replace('9', '1')
        .replace('X', '9')
    )

    out.flush()
  }
}


Measured memory_bytes: 27328
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

bool check(vector<ll> &a, ll x)
{
    ll n = a.size();
    ll sum = a[x];
    for (ll i = 0; i < x; i++)
    {
        sum += a[i];
    }
    for (ll i = x + 1; i < n; i++)
    {
        if (sum * 2 >= a[i])
        {
            sum += a[i];
        }
        else
        {
            return false;
        }
    }
    return true;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> a(n);
    for (ll i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(ALL(a));
    ll ok = n - 1;
    ll ng = -1;
    while (llabs(ok - ng) > 1)
    {
        ll mid = (ok + ng) / 2;
        if (check(a, mid))
        {
            ok = mid;
        }
        else
        {
            ng = mid;
        }
    }
    cout << n - ok << endl;
}

Measured memory_bytes: 1024
#include <stdio.h>
 
int main(void) {
int height[10],temp,i,j;
for(i=0;i<10;i++) scanf("%d",&height[i]);
for(i=0;i<9;i++){
for(j=0;j<9-i;j++){
if (height[j]>height[j+1]){
temp=height[j];
height[j]=height[j+1];
height[j+1]=temp;
}
}
}
for(i=0;i<3;i++) printf("%d\n",height[9-i]);
return 0;
}

Measured memory_bytes: 600
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
ans = 0
for i in range(n):
  a = list(map(int,input().split()))
  count = 0
  for j in range(m):
    count += b[j]*a[j]
  count += c
  if count > 0:
    ans += 1
print(ans)


Measured memory_bytes: 3060
n = int(input())
while n>0:
    if n%4==0:
        print("Yes")
        break
    elif n%7==0:
        print("Yes")
        break
    elif n%11==0:
        print("Yes")
        break
    elif(1):
            i=1
            n = n-4*i
            if n%7==0:
                print("Yes")
                break
            if n<=0:
                print("No")

Measured memory_bytes: 3060
/*https://atcoder.jp/contests/abc161/tasks/abc161_c*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
	long long n, k, e, dif;
	cin >> n >> k;
	e = n % k;
	dif = abs(e - k);
	cout << min(dif, e);
}

Measured memory_bytes: 3648
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < n ; i++) {
            a[i] = sc.nextInt();
        }
        long ans = 0;
        int t = a[0];
        for (int i = 1 ; i < n ; i++) {
            if (a[i] < t) {
                ans += (long)( t - a[i]);
            }
            if (a[i] > t) {
                t = a[i];
            }
        }
        System.out.println(ans);
    }

}

Measured memory_bytes: 59620
import java.util.Scanner;

public class Main {
    public static void main(String args[])
    {
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int d = x % 10;
        x /= 10;
        int c = x % 10;
        x /= 10;
        int b = x % 10;
        x /= 10;
        int a = x % 10;

        int y;
        while (true) {
            y = a + b + c + d;
            if (y == 7) {
                System.out.println(a + "+" + b + "+" + c + "+" + d + "=7");
                break;
            }
            y = a + b + c - d;
            if (y == 7) {
                System.out.println(a + "+" + b + "+" + c + "-" + d+ "=7");
                break;
            }
            y = a + b - c + d;
            if (y == 7) {
                System.out.println(a + "+" + b + "-" + c + "+" + d+ "=7");
                break;
            }
            y = a + b - c - d;
            if (y == 7) {
                System.out.println(a + "+" + b + "-" + c + "-" + d+ "=7");
                break;
            }
            y = a - b + c + d;
            if (y == 7) {
                System.out.println(a + "-" + b + "+" + c + "+" + d+ "=7");
                break;
            }
            y = a - b + c - d;
            if (y == 7) {
                System.out.println(a + "-" + b + "+" + c + "-" + d+ "=7");
                break;
            }
            y = a - b - c + d;
            if (y == 7) {
                System.out.println(a + "-" + b + "-" + c + "+" + d+ "=7");
                break;
            }
            y = a - b - +c - d;
            if (y == 7) {
                System.out.println(a + "-" + b + "-" + c + "-" + d+ "=7");
                break;
            }
        }
    }
}


Measured memory_bytes: 23892
#include<iostream>


using namespace std;
using ll = long long;

int n;
ll a[100005];
ll x[100005];

void input(){
  cin >> n;
  for(int i = 0; i < n; ++i){
    cin >> a[i];
  }
}

ll sum_value(){

  ll ans = 0;
  for(int i = 0; i < n; ++i){
    ans += a[i];
  }
  return ans;
}

void solve(){
  x[0] = sum_value();
  for(int i = 1; i < n; i = i + 2){
    x[0] -= 2 * (a[i]);
  }
  //return x[0];
  for(int i = 1; i < n; ++i){
    x[i] = 2 * a[i - 1] - x[i - 1];
  }
  for(int i = 0; i < n; ++i){
    cout << x[i] << " ";
  }
  cout << endl;
}

int main(){
  input();
  //cout << solve() << endl;
  solve();
}

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

int main(){
    int a,b,c,x;
    cin>>a>>b>>c >>x;
    int ans = 0;
    for(int i=0;i<=a;i++){
        for(int j=0;j<=b;j++){
            for(int k=0;k<=c;k++){
                if(500*i+100*j+50*k == x){
                    ans ++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
	 public class Main{
	   public static void main(String[]args){
	     Scanner in=new Scanner(System.in);
	     int D=in.nextInt();
	     int T=in.nextInt();
	     int S=in.nextInt();
	     System.out.println(T * S >= D ? "Yes" : "No");
	   }
	 }

Measured memory_bytes: 35772
import sys
input = sys.stdin.readline

n = int(input())
A = [int(i) for i in input().strip().split()]
q = int(input())
M = [int(i) for i in input().strip().split()]

comb = set()

for i in range(2 ** n):
    _tmp = 0
    for j in range(n):
        if (i >> j) & 1:
            _tmp += A[j]
    comb.add(_tmp)

for m in M:
    if m in comb:
        print("yes")
    else:
        print("no")



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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;

struct edge{
  int g;
  int c;
};

int main(){
  int n;
  cin >> n;
  vector<list<struct edge>> e(n);
  int a,b,c;
  for(int i=0;i<n-1;i++){
    cin >> a >> b >> c;
    a--;
    b--;
    e[a].push_back({b,c});
    e[b].push_back({a,c});
  }
  int q,k;
  cin >> q >> k;
  k--;
  vector<LL> d(n);
  queue<int> bfs;
  vector<bool> searched(n,false);
  d[k]=0;
  bfs.push(k);
  searched[k]=true;
  int now;
  while(!bfs.empty()){
    now=bfs.front();
    bfs.pop();
    // cout << now << endl;
    for(auto itr=e[now].begin();itr!=e[now].end();itr++){
      if(!searched[itr->g]){
        d[itr->g]=d[now]+itr->c;
        searched[itr->g]=true;
        bfs.push(itr->g);
      }
    }
  }
  // for(int i=0;i<n;i++){
  //   cout << d[i] << endl;
  // }
  int x,y;
  for(int i=0;i<q;i++){
    cin >> x >> y;
    cout << d[x-1]+d[y-1] << endl;
  }
  return 0;
}


Measured memory_bytes: 10368
// テ・ツ淞コテヲツ慊ャテ」ツδ?」ツδウテ」ツδ療」ツδャテ」ツδシテ」ツδ?

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

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

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

signed main() {
    int N, M; cin >> N >> M;
    vector<int> v;
    rep(i,0,M) {
        int a, b; cin >> a >> b;
        int diff = max(0LL, (b - a) / 2);
        v.push_back(diff);
        // printf("diff = %lld\n", diff);
    }
    sort(v.begin(), v.end());

    cout << accumulate(v.begin(), v.begin() + M - 1, 0LL) << endl;
    return 0;
}

Measured memory_bytes: 3108