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

using ll = long long;
using ld  = long double;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
const int INF=1e9+7;
const ll LINF=9223372036854775807;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld EPS = 1e-10; //微調整用（EPSより小さいと0と判定など）

int ii() { int x; if (scanf("%d", &x)==1) return x; else return 0; }
long long il() { long long x; if (scanf("%lld", &x)==1) return x; else return 0; }
string is() { string x; cin >> x; return x; }
char ic() { char x; cin >> x; return x; }
void oi(int x) { printf("%d ", x); }
void ol(long long x) { printf("%lld ", x); }
void od_nosp(double x) { printf("%.15f", x); } // 古い問題用
void od(double x) { printf("%.15f ", x); }
void os(const string &s) { printf("%s ", s.c_str()); }
void oc(const char &c) { printf("%c ", c); }
#define o_map(v){cerr << #v << endl; for(const auto& xxx: v){cout << xxx.first << " " << xxx.second << "\n";}} //動作未確認
void br() { putchar('\n'); }

// #define gcd __gcd //llは受け取らない C++17~のgcdと違うので注意
// int lcm(int a, int b){return a / gcd(a, b) * b;}
#define b_e(a) a.begin(),a.end() //sort(b_e(vec));
#define REP(i,m,n) for(ll i=(ll)(m) ; i < (ll)(n) ; i++ )
#define DREP(i,m,n) for(ll i=(ll)(m) ; i > (ll)(n) ; i-- )
#define rep(i,n) REP(i,0,n)
#define m_p(a,b) make_pair(a,b)
#define p_b push_back
#define SZ(x) ((ll)(x).size()) //size()がunsignedなのでエラー避けに
#define endk '\n'


// coutによるpairの出力（空白区切り）
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << " " << p.second << ")";}
// coutによるvectorの出力（空白区切り）
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << " "; //"\t"に変えるとTabで見やすく区切る
  }
  return s;
}
// coutによる多次元vectorの出力（空白区切り）
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}

//最大値、最小値の更新。更新したor等しければtrueを返す
template<typename T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<typename T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}

//4近傍（上下左右） rep(i, 2) にすると右・下だけに進む
vector<int> dx_4 = {1, 0, -1, 0};
vector<int> dy_4 = {0, 1, 0, -1};

// -------- template end - //


// - library ------------- //

// #include <atcoder/all>
// using namespace atcoder;



// --------- library end - //



int main(){

  ll N = il();
  string ans = "No";
  ll tmp = 0;
  rep(i, N){
    ll a, b;
    cin >> a >> b;
    if (a == b) tmp++;
    else tmp = 0;
    if (tmp >= 3){
      ans =  "Yes";
    }
  }
  cout << ans << endk;


  

}



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

int main() {
  int n;
  cin>>n;
  for(int a=1;a<=9;a++)for(int b=1;b<=9;b++){
    if(a*b==n){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  cout<<"No"<<endl;
  
}


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

int64_t par[100000];
int64_t rnk[100000];
int64_t siz[100000];

void init(int64_t n){ 
  for (int64_t i = 0; i < n; i++){
    par[i] = i;
    siz[i] = 1;
  }
}

int64_t find(int64_t x){
  if (par[x] == x){
    return x;
  }else{
    return par[x] = find(par[x]);
  }
}

void unite(int64_t x, int64_t y){
  x = find(x);
  y = find(y);
  
  if (x == y){
    return;
  }
  if (siz[x] < siz[y]){
    swap(x, y);
  }
  
  siz[x] += siz[y];
  par[y] = x;
}

bool same(int64_t x, int64_t y){
  return find(x) == find(y);
}

int size(int64_t x) {
  return siz[find(x)];
}

int main(){
  int64_t N, M, a, b, inc;
  cin >> N >> M;
  init(N);
  int64_t A[M], B[M], ans[M];
  inc = N * (N - 1) / 2;
  ans[0] = 0;
  ans[M-1] = inc;
  
  for (int64_t i = 0; i < M; i++){
    cin >> A[i] >> B[i];
  }
  
  for (int64_t i = 0; i < M-1; i++){
    a = A[M-i-1];
    b = B[M-i-1];
    
    if (same(a-1, b-1)){
      ans[M-i-2] = inc;
    }else{
      inc = inc - size(a-1) * size(b-1);
      ans[M-i-2] = inc;
      unite(a-1, b-1);
    }
  }
  
  for (int64_t i = 0; i < M; i++){
    cout << ans[i] << endl;
  }
}

Measured memory_bytes: 5248
function main(input) {
  const args = input.split(' ');
  const a = parseInt(args[0]);
  const b = parseInt(args[1]);
  
  if (a * b % 2 === 0) {
    console.log('Even');
  } else {
    console.log('Odd');
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7496
#include <stdio.h>

int main(void){
	char S[4];
	char T[4];

	scanf("%s",S);
	scanf("%s",T);
	int i;
	int c=0;
	for(i=0; i<3; i++){
		if(S[i]==T[i]) c++;
	}

	printf("%d\n",c );
}

Measured memory_bytes: 128
while line = gets
  n = gets.to_i
  n.times do
    c = gets.split
    x, y = c[1, 2].map(&:to_i)
    s = c[3]
    case c[0]
    when "replace"
      line[x..y] = s
      # pp "replace"
    when "reverse"
      line[x..y] = line[x..y].reverse
    when "print"
      puts line[x..y]
    end
  end
end


Measured memory_bytes: 6908
import sys
import math
from collections import deque
from collections import Counter

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

#nCr
def cmb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n - r)


def main():
    S = SI()
    l = len(S)
    T = [0] * (l+1)
    inv_S = S[::-1]
    for i, s in enumerate(inv_S):
        s = int(s)
        T[i+1] = (T[i] + s * pow(10, i, 2019)) % 2019
    C = Counter(Counter(T).values())
    ans = 0
    for n, x in C.items():
        if n == 1: continue
        ans += cmb(n, 2) * x
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 71376
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def a_int(): return int(read())


def ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from functools import reduce
from math import gcd


def lcm(a, b):
    # 最小公倍数
    g = gcd(a, b)
    return a // g * b


K = int(input())
modks = [7 % K]
for i in range(1, 10**6 + 100):
    modks.append((modks[-1] + 7 * pow(10, i, K)) % K)


for i, m in enumerate(modks, start=1):
    if m == 0:
        exit(i)
print(-1)


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

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	int count = 0;
	for (int i = a; i <= b; i++)
	{
		auto s = to_string(i);
		auto r = s; reverse(r.begin(), r.end());
		if (s == r) count++;
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def mat_mul_opt(_mat_info):
    rc_info = list(map(int, _mat_info[0]))
    rc_info.extend(list(map(lambda x: int(x[1]), _mat_info[1:])))

    ans = [[0] * (mat_num + 1) for _ in range(mat_num + 1)]

    for l in range(2, mat_num + 1):
        for i in range(1, mat_num - l + 2):
            j = i + l - 1
            ans[i][j] = float('inf')
            for k in range(i, j):
                ans[i][j] = min(ans[i][j], ans[i][k] + ans[k + 1][j] +
                                rc_info[i - 1] * rc_info[k] * rc_info[j])

    return ans[1][mat_num]


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    mat_num = int(_input[0])
    mat_info = tuple(map(lambda x: x.split(), _input[1:]))
    # assert len(mat_info) == mat_num

    print(mat_mul_opt(mat_info))

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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;

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

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

    ll A,B,C;
    string S;
    cin >> A>>B>>C;

    if(A==B){
        cout << C << endl;
    }
    else if(B==C){
        cout << A << endl;
    }
    else{
        cout << B << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;
const int mod = 1e9+7;


int dp[100005][2];
// a+b = (a ^ b) + (a & b) * 2 --> (a & b) == 0
// digit dp ----ewwwww
void test_case(){
	string s; cin >> s;
	dp[0][0] = 1;
	int n = s.size();
	for(int i = 0 ; i < (int) s.size() ; i++){
		{
		// a + b = 0;
		if(s[i] == '0'){
			dp[i+1][0] = dp[i][0];
			dp[i+1][1] = dp[i][1];
		}
		else{
			dp[i+1][1] = (dp[i][0]+dp[i][1])%mod;
		}
	}
	{
		if(s[i] == '0'){
			(dp[i+1][1] += dp[i][1]*2%mod)%=mod;
		}
		else{
			(dp[i+1][0] += dp[i][0]*2%mod)%=mod;
			(dp[i+1][1] += dp[i][1]*2%mod)%=mod;
		}
	}
	}
	int ans = (dp[n][0]+dp[n][1])%mod;
	cout<<ans<<"\n";
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int T=1;
	//~ cin >> T;
	while(T--){
		test_case();
	}
	return 0;
}


Measured memory_bytes: 4504
#include<bits/stdc++.h>
using namespace std;
#define ll long long
bool fun(string s,ll l)
{
	ll sum=0,i=0;
	while(i<l)
    {
    	sum+=(s[i]-'0');
      	i++;
    }
  	if(sum%9==0)
    	return 1;
  	else
      	return 0;
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    string s;
    cin>>s;
    ll l=s.length();
  	bool f;
  	f=fun(s,l);
  	if(f)
    	cout<<"Yes";
 	else
      	cout<<"No";
      }


Measured memory_bytes: 3700
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using lint = long;
using llint = long long;
using namespace std;

int main() {
    fastIO;
    int k, x;
    cin >> k >> x;
    if (k * 500 >= x)
        cout << "Yes";
    else
        cout << "No";
}


Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;

int N;
LL sum, ans;
map<LL, int> M;

int main(){
    int A;
    scanf("%d", &N);
    M[0]++;
    for (int i=1; i<=N; i++){
        scanf("%d", &A);
        sum += A;
        ans += M[sum]++;
    }
    printf("%lld\n", ans);
    return 0;
}


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

vector<int> v[200000], a, ret, tmp;
int n;

void dfs(int par, int pos){
    int len = lower_bound(tmp.begin(), tmp.end(), a[pos])-tmp.begin();
    int bef = tmp[len];
    tmp[len] = a[pos];
    ret[pos] = lower_bound(tmp.begin(), tmp.end(), 1<<30)-tmp.begin();
    for(int next : v[pos]){
        if(next == par) continue;
        dfs(pos, next);
    }
    tmp[len] = bef;
}

int main(){
    cin >> n;
    a.resize(n);
    ret.resize(n);
    tmp.resize(n+1, 1<<30);
    for(int i = 0; i < n; i++)  cin >> a[i];
    for(int i = 1; i < n; i++){
        int x, y;
        cin >> x >> y;
        x--, y--;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    dfs(-1, 0);
    for(int i = 0; i < n; i++){
        cout << ret[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 27940
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		int h = scan.nextInt();
		int m = scan.nextInt();

		// 中心角
		double deg = 0;
		deg = (30 * h) + (0.5 * m) - (6 * m);

		// a2 = b2 + c2 - 2bcCOSdeg
		double ans = Math.sqrt((a*a) + (b*b) - (2*a*b*Math.cos(Math.toRadians(deg))));
		System.out.println(ans);

		scan.close();

	}

}


Measured memory_bytes: 35968
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

template <ll Mod>
struct modint {
  ll n;

  modint(const ll x = 0) : n(x % Mod) {}
  modint operator+(const modint r) const { return modint(*this) += r; }
  modint operator-(const modint r) const { return modint(*this) -= r; }
  modint operator*(const modint r) const { return modint(*this) *= r; }
  modint operator/(const modint r) const { return modint(*this) /= r; }
  modint &operator+=(const modint r) {
    n += r.n;
    if (n >= Mod) n -= Mod;
    return *this;
  }
  modint &operator-=(const modint r) {
    if (n < r.n) n += Mod;
    n -= r.n;
    return *this;
  }
  modint &operator*=(const modint r) {
    n = n * r.n % Mod;
    return *this;
  }
  modint &operator/=(const modint r) { return *this *= r.inv(); }
  modint pow(ll x) const {
    modint<Mod> ret(1), tmp(*this);
    while (x) {
      if (x&1) ret *= tmp;
      tmp *= tmp;
      x >>= 1;
    }
    return ret;
  }
  modint inv() const { return pow(Mod-2); }
  friend ostream& operator<<(ostream& os, const modint& obj) { return os << obj.n; }
  friend istream& operator>>(istream& is, modint& obj) { return is >> obj.n; }
};
constexpr ll mod = 1000000007;
using mint = modint<mod>;

// T modint
template<class T>
struct Combination {
  vector<T> fact, inv_fact;
  Combination(ll n) : fact(n+1), inv_fact(n+1) {
    fact[0] = T(1);
    for (ll i = 1; i <= n; i++) fact[i] = fact[i-1] * static_cast<T>(i);
    inv_fact[n] = fact[n].inv();
    for (ll i = n; i > 0; i--) inv_fact[i-1] = inv_fact[i] * static_cast<T>(i);
  }

  T P(ll n, ll k) const {
    return fact[n] * inv_fact[n-k];
  }

  T C(ll n, ll k) const {
    if(n<k||k<0) return T(0);
    return fact[n] * inv_fact[n-k] * inv_fact[k];
  }

  T H(ll n, ll k) const {
    return C(n+k-1, n-1);
  }
};

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

  ll n, k;
  cin >> n >> k;
  vector<ll> b(n);
  rep(i, n) {
    cin >> b[i];
  }
  sort(all(b));
  vector<mint> a(n);
  rep(i, n) {
    if (b[i] < 0) {
      b[i] += mod;
    }
    a[i] = mint(b[i]);
  }

  mint ans = 0;
  Combination<mint> comb(n);
  rep(i, n) {
    ll l = i;
    ans += a[i] * comb.C(l, k-1);
  }
  rep(i, n) {
    ll r = n-1-i;
    ans -= a[i] * comb.C(r, k-1);
  }
  cout << ans << endl;
}


Measured memory_bytes: 3456
#include<stdio.h>
#include<algorithm>
using namespace std;
double dp[20][200000];
int b[20];
int ABS(int a){return max(a,-a);}
int main(){
	int a;
	scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",b+i);
	for(int i=0;i<a;i++)
		for(int j=0;j<200000;j++)
			dp[i][j]=999999999;
	for(int i=1;i<200000;i++)
		dp[0][i]=(double)ABS(i-b[0])/b[0];
	for(int i=0;i<a-1;i++){
		for(int j=1;j<200000;j++){
			for(int k=j;k<200000;k+=j)dp[i+1][k]=min(dp[i+1][k],max(dp[i][j],(double)ABS(k-b[i+1])/b[i+1]));
		}
	}
	double ret=999999999;
	for(int i=0;i<200000;i++)ret=min(ret,dp[a-1][i]);
	printf("%.9f\n",ret);
}

Measured memory_bytes: 32308
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
const int mod = 1000000007;
const int max_n = 200005;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll m;cin >> m;
    ll ans=0;
    ll tmp=0;
    rep(i,m){
        ll d,c;cin >> d >>c;
        ans+=c;
        ans+=(d*c)/9;
        tmp+=(d*c)%9;
    }
    ans+=tmp/9;
    ans--;
    if(tmp%9==0)ans--;
    cout <<ans <<endl;
}

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

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

  vector<vector<int>> dp(1000010, vector<int>(2,0));

  dp[0][0] = 0; dp[0][1] = 11;

  for(int i=1; i<=S.length(); i++){
    int d = S[i-1] - '0';
    dp[i][0] = min(dp[i-1][0], dp[i-1][1]) + d;
    dp[i][1] = min(dp[i-1][0] + 1 + 10-d, dp[i-1][1] - 1 +10-d);
  }

  cout << min(dp[S.length()][0], dp[S.length()][1]) << endl;
}

Measured memory_bytes: 55940
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

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


#include <iostream>

using namespace std;

int main()
{
    int k,l,fl=0;
    cin>>k>>l;
    if(k*2>l||k*4<l)
    {
        cout<<"No"<<endl;
        return 0;
    }
    
    if(k*2==l||k*4==l)
    {
        cout<<"Yes"<<endl;
        return 0;
    }
    
    
    for(int i=1;i<k;i++)
    {
        if((i*2+(k-i)*4)==l)
        {
            fl=1;
            break;
        }
       
    }
    if(fl==1)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
   

    return 0;
}


Measured memory_bytes: 3612
# coding: utf-8
N = gets.to_i
abc = []
N.times do |i|
  abc << gets.split.map {|e| e.to_i}
end

#INF = 10 ** 4 + 10
#p INF
dp = Array.new(100010) { Array.new(3, 0) }

N.times do |i|
  3.times do |j|
    3.times do |k|
      next if j == k
      dp[i+1][k] = dp[i][j] + abc[i][k] if dp[i+1][k] < dp[i][j] + abc[i][k]
    end
  end
end

ans = 0
3.times do |i|
  ans = dp[N][i] if ans < dp[N][i]
end
puts ans


Measured memory_bytes: 12028
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;
//using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

    void solve()
    {
        int N = cin.nextint;

        int ans = int.MaxValue;
        for (int i = 1; i < N; i++)
        {
            int a = i;
            int b = N - i;
            int tmp = 0;
            while (a > 0)
            {
                tmp += a % 10;
                a /= 10;
            }
            while (b > 0)
            {
                tmp += b % 10;
                b /= 10;
            }
            chmin(ref ans, tmp);

        }
        WriteLine(ans);
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 13140
<?php
  list($l, $r) = explode(" ", trim(fgets(STDIN)));

  if($r - $l > 2017){
    echo "0";
    exit;
  }

  $min = PHP_INT_MAX;
  for($i = $l; $i <= $r; $i++){
    for($j = $i + 1; $j <= $r; $j++){
      if($min > $i*$j%2019){
        $min = $i*$j%2019;
      }
    }
  }
  echo $min;

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

int rem[1100];

int main(){
	int n,r,t; cin >> n >> r >> t;
	vector<int> p(n);
	for(int i=0;i<n;i++){
		cin >> p[i];
	}
	int ret=0;
	for(int i=0;i<t;i++){
		for(int j=0;j<n;j++){
			if(rem[(i+1)*p[j]%r]==0){
				ret++;
			}
			else{
				rem[(i+1)*p[j]%r]--;
			}
		}
		if(i){
			for(int j=0;j<n;j++){
				rem[(i+1)*p[j]%r]++;
			}
		}
	}
	cout << ret << endl;
}


Measured memory_bytes: 3104
import Data.List
f a r = if null a then r else f (tail a) ((take ((head.head)a) r)++[(r!!((head.head)a))+1]++(((take (((last.head)a)-((head.head))a-1)).(drop ((head.head)a+1))) r)++[(r!!((last.head)a))+1]++(drop ((last.head)a+1) r))
main=do
 [n,m]<-map read.words<$>getLine ::IO[Int]
 a<-map (map (+(-1)).sort.(map read)).map words.lines<$>getContents
 putStr$unlines$map show$f a (replicate n 0)

Measured memory_bytes: 1020
#include <iostream>
#include <vector>
#include <map>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    vector<int> d(n);
    rep(i, 0, n){
        cin >> d[i];
    }
    int ans = 0;
    rep(i, 0, n-1){
        rep(j, i+1, n){
            ans += d[i] * d[j];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <functional>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cstdlib>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> A(n);

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

    long long ans = 0;
    int mn = 1000000000;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        ans += abs(A[i]);
        if (A[i] < 0) cnt++;
        mn = min(mn, abs(A[i]));
    }

    if (cnt % 2 == 0) {
        cout << ans << endl;
    } else {
        cout << ans - 2 * mn << endl;
    }

    return 0;
}


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

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

    for (int i = 0; i < 3; i++) {
        if (s[i] == '1') s[i] = '9';
        else if (s[i] == '9') s[i] = '1';
    }

    cout << s << endl;

    return 0;
}

Measured memory_bytes: 256
N = int(input())
S = []
T = []
for i in range(N):
    s, t = input().split()
    S.append(s)
    T.append(int(t))
X = input()

for j in range(N):
    if S[j] == X:
        k = j
        break

if j < N-1:
    print(sum(T[j+1:N]))
else:
    print(0)

Measured memory_bytes: 3064
import java.util.*;

public class Main {
    static long MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] array = new long[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextLong();
        }
        
        int digit = 60;
        long[] zero = new long[digit];
        long[] one = new long[digit];
        for (int i = 0; i < n; i++) {
            long num = array[i];
            for (int j = 0; j < digit; j++) {
                long tmp = num % 2;
                if (num == 0 || tmp == 0) {
                    zero[j]++;
                } else {
                    one[j]++;
                }
                
                num /= 2;
            }
        }
        
        long ans = 0;
        long two = 1;
        for (int i = 0; i < digit; i++) {
            long tmp = zero[i] * one[i];
            tmp %= MOD;
            
            tmp *= two;
            tmp %= MOD;
            
            ans += tmp;
            ans %= MOD;
            
            two *= 2;
            two %= MOD;
        }
        System.out.println(ans);
    }
}

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

vector<pair<int , int> > v[100005];
long long dp[100005];
void dfs(int n , int p , long long dis)
{
    dp[n] = dp[p]+1ll*dis;

    for(auto it : v[n])
    {
        if(it.first!=p)
        {
            dfs(it.first , n , it.second);
        }
    }
}
int main()
{
    int n;

    cin >> n;

    for(int i = 1 ; i<n ; i++)
    {
        int x , y , z;

        cin >> x >> y >> z;

        v[x].push_back(make_pair(y , z));
        v[y].push_back(make_pair(x , z));
    }

    int q , k;

    cin >> q >> k;

    dfs(k , 0 , 0);

    while(q--)
    {
        int l , r;

        cin >> l >> r;

        cout << dp[r]+dp[l] << "\n";
    }
    return 0;
}


Measured memory_bytes: 12800
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>

using namespace std;

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

long long int INF = 1e18;
long long int mod = 1000000007;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "RULD";
//↓,→,↑,←

#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<x;
#define re(i,n) for(i=0;i<n;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl

ll rui(ll number1,ll number2){
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
    if(number1 > number2){
        swap(number1 , number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1 , number1);
    }
}


ll i,j,k,ii,jj;
ll n,m;
ll a,b,c,d,e,g,h,r;
ll l,ans,sum;
ll num;
ll x[500005],y[500005],z[500005];
bool dame,flag,ok;
bool used[500005];

void dfs(ll v){
	if(used[v])return;
	used[v] = true;
	for(int i=0;i<G[v].size();i++){
		dfs(G[v][i]);
	}
	return ;
}


int main(){
	cin >> n >> m;
	for(i=0;i<n;i++){
		cin >> k;
		for(j=0;j<k;j++){
			cin >> l;
			G[i+1].pb(l+n+5);
			G[l+n+5].pb(i+1);
		}
	}
	dfs(1);
	ok = true;

	for(i=1;i<=n;i++){
		if(!used[i])ok = false;

	}
	if(ok){
		p("YES");
	}else{
		p("NO");
	}

    return 0;
}

Measured memory_bytes: 29952
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  double a, b;
  in(a);
  b = a / 3;
  kono(10);
  out(b * b * (a - 2 * b));
  memi;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MAX_INT 2100000000
#define rep(i,n) for (i=1;i<=(n);++i)
using namespace std;
typedef long long int ll;
/*
#ifdef COMPILE_IN_VCPP
#include <windows.h>
HWND GetConsoleHwnd(void)
{
#define MY_BUFSIZE 1024 // Buffer size for console window titles.
	HWND hwndFound;         // This is what is returned to the caller.
	char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated// WindowTitle.
	char pszOldWindowTitle[MY_BUFSIZE]; // Contains original// WindowTitle.
	ULARGE_INTEGER nt;
	nt.QuadPart = GetTickCount64();
	GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
	wsprintf(pszNewWindowTitle, "%d%d/%d", nt.HighPart, nt.LowPart, GetCurrentProcessId());
	SetConsoleTitle(pszNewWindowTitle);
	Sleep(40);
	hwndFound = FindWindow(NULL, pszNewWindowTitle);
	SetConsoleTitle(pszOldWindowTitle);
	return(hwndFound);
}
#endif
*/
ll mod = 1e9 + 7;
// abc145d
int countxy(int x, int y)
{
	if (x == 0 && y == 0) return 1;
	if (x >= 2 && y >= 2) return (countxy(x - 1, y - 2) + countxy(x - 2, y - 1))%mod;
	if (x >= 1 && y >= 2) return countxy(x - 1, y - 2)%mod;
	if (x >= 2 && y >= 1) return countxy(x - 2, y - 1)%mod;
	return 0;
}
int main(void)
{
	int x, y, i, j, k;
	cin >> x >> y;
	int t, s;
	if ((2 * x - y) % 3 || (2 * y - x) % 3)
	{
		cout << 0 << endl;
		return 0;
	}
	if ((2 * x - y) < 0 || (2 * y - x) <0)
	{
		cout << 0 << endl;
		return 0;
	}
	s = (2 * x - y) / 3;
	t = (2 * y - x) / 3;
	long long int ans = 1;
	for (i = 1; i <= s + t; i++)
	{
		ans *= i;
		ans %= mod;
	}
	/*
	ll facts=1, factt=1;
	for (i = 1; i <= s; i++)
	{
		facts *= i;
		i %= mod;
	}
	for (i = 1; i <= t; i++)
	{
		factt *= i;
		i %= mod;
	}
	ans *= pow_mod(facts, mod - 2);
	ans %= mod;
	ans *= pow_mod(factt, mod - 2);
	ans %= mod;
	*/

	for (i = 1; i <= s; i++)
	{
		ll res = 1;
		ll a = i, b = mod - 2;
		while (b)
		{
			if (b % 2) res = res * a % mod;
			a = a * a % mod;
			b >>= 1;
		}
		ans *= res;
		ans %= mod;
	}
	for (i = 1; i <= t; i++)
	{
		ll res = 1;
		ll a = i, b = mod - 2;
		while (b)
		{
			if (b % 2) res = res * a % mod;
			a = a * a % mod;
			b >>= 1;
		}
		ans *= res;
		ans %= mod;
	}
	cout << ans << endl;
}


long long pow_mod(long long a, long long b) {
	long long res = 1;
	while (b) {
		if (b % 2) res = res * a % mod;
		a = a * a % mod;
		b >>= 1;
	}
	return res;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	}
}
 

 



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

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPP vector<pair<int,pair<int,int>>>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int  INF = 1 << 30;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;


VI g[200005];


int main() {

	int n;
	ll k;
	cin >> n >> k;

	VI a(n + 1, -1);
	REP(i, n)cin >> a[i];

	REP(i, n) {
		g[a[i]].push_back(i);
	}

	VI loop(200005, -1);

	int now = a[0];
	int now_i = 0;
	int cnt = 1;
	while (true) {
		auto it = upper_bound(ALL(g[now]), now_i);
		if (it == g[now].end()) {
			now_i = g[now][0] + 1;
			cnt++;
		}
		else {
			int b = it - g[now].begin();
			now_i = g[now][b] + 1;
		}
		now = a[now_i];
		if (now_i == n)break;
	}

	k %= cnt;
	if (k == 0) {
		cout << endl;
		return 0;
	}

	k *= n;

	now = a[0];
	now_i = 0;
	while (true) {
		auto it = upper_bound(ALL(g[now]), now_i);
		if (it == g[now].end()) {
			int l = n + 1 - now_i;
			l += g[now][0];
			if (l > k)break;
			else k -= l;
			now_i = g[now][0] + 1;
			cnt++;
		}
		else {
			int b = it - g[now].begin();
			int l = g[now][b] - now_i + 1;
			if (l > k)break;
			else k -= l;
			now_i = g[now][b] + 1;
		}
		now = a[now_i];
	}

	VI v;
	map<int, int> m;
	while (k) {
		k--;
		if (m[a[now_i]]) {
			while (true) {
				m[v[v.size() - 1]]--;
				if (v[v.size() - 1] != a[now_i])v.pop_back();
				else {
					v.pop_back();
					break;
				}
			}
		}
		else {
			v.push_back(a[now_i]);
			m[a[now_i]]++;
		}
		now_i = (now_i + 1) % n;
	}
	
	for (int i : v) {
		cout << i << ' ';
	}



}

Measured memory_bytes: 24180
S=input()
s=list(S)
x='Yes'
for i in range(len(s)):
    if i%2==0:
        if s[i]!='R' and s[i]!='U' and s[i]!='D':
            x='No'
    else:
        if s[i]!='L' and s[i]!='U' and s[i]!='D':
            x='No'
print(x)

Measured memory_bytes: 2940
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <array>

using namespace std;

int N, M;


int main()
{

	cin >> N >> M;
	
	int ans = 0;
	if (N > 1) {
		ans += N * (N - 1) / 2;
	}
	if (M > 1) {
		ans += M * (M - 1) / 2;
	}
	cout << ans << endl;


	return 0;
}



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

#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long 
#define mod 1000000007
#define pb push_back
#define setto(n) cout << fixed << setprecision(n)
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define sz(i) int(i.size())
#define len(s) int(s.length())
#define UNIQUE(a) ((a).erase(unique((a).begin(), (a).end()), (a).end()))
#define INF LONG_MAX
#define random() ((ll)rand() << 32 | rand())
#define C(c) c-'a'

using namespace std; 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}
template<class T> void smax(T& a, T val) {if (a < val) a = val;}
template<typename T>inline std::ostream &operator << (std::ostream & os,const std::vector<T>& v){bool first = true;os << "[";for(auto i: v){if(!first)os << ", ";os << i;first = false;}return os << "]";}

//Check MAX size twiceeeeeeeeeeeeeeeeee, and verify it
const int MAX = 2*100010;

int sum(int N){
	int sum = 0;
	while(N){
		sum+= N%10;
		N/= 10;
	}
	return sum;
}

int main(){
	boost;

	int N;

	cin >> N;

	if(N <= 10){
		cout<<N<<endl;
	}

	else{
		int ma = INT_MAX;
		for (int i = 1; i < N; ++i)
		{	
			smin(ma, sum(i) + sum(N-i));
		}
		cout<<ma;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>

static const int MOD = 1000000007;
using ll = int64_t;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> v(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d %d", &v[i].first, &v[i].second);
    }
    sort(v.begin(), v.end());
    ll ans = 0;
    int x = 0;
    int cnt = 0;
    while(x < m){
        ans += (ll)v[cnt].first*min(v[cnt].second, m-x);
        x += min(v[cnt].second, m-x);
        cnt++;
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 1024
#include<algorithm>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<cstring>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;

using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;

#define REP(i, x, n) for(int i = (x), i##_len = int(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = int(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = int(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 SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << endl

constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-8;

constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
constexpr int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

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

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

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

    lint a, b;
    cin >> a >> b;

    lint m = max(a, b);

    int ans = 1;
    for(lint i = 2 ; i * i <= m ; ++i){
        if(a % i == 0LL && b % i == 0LL){
            ++ans;
        }
        while(a % i == 0LL){
            a /= i;
        }
        while(b % i == 0LL){
            b /= i;
        }
    }

    if(a > 1LL && b > 1LL && a == b){
        ++ans;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
N = int(input())
S = input()
ans = S.count("R") * S.count("G") * S.count("B")
for i in range(N):
    for j in range(i + 1, N):
        d = j - i
        k = j + d
        if k > N-1:
            break
        if {S[i], S[j], S[k]} == {'R', 'G', 'B'}:
            ans -=1
print(ans)


Measured memory_bytes: 68284
n, m, x = map(int, input().split())
a = list(map(int, input().split()))

goal1 = 0
goal2 = 0

for i in range(x + 1, n):
    if i in a:
        goal1 += 1

for i in range(1, x):
    if i in a:
        goal2 += 1

print(min(goal1, goal2))


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

ll Euclid(ll A, ll B){
    if(A<B) swap(A, B);
    ll C = B;
    while(C != 0){
        C = A%B;
        A = B;
        B = C;
    }
    return A;
}

int main(){
	ll N, M;
	string S, T;
	cin >> N >> M;
	cin >> S;
	cin >> T;
	bool flag = true;
	ll a = Euclid(N, M);
	REP(i, a){
		int x = (N/a)*i;
		int y = (M/a)*i;
		if (S[x]!=T[y]) flag = false;
	}
	cout << (flag ? a*(N/a)*(M/a) : -1)<< endl;
    return 0;
}

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

#define int long long

signed main() {
    int a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;

    if(a < b && a + t * v >= b + t * w) {
        cout << "YES" << endl;
        return 0;
    } else if(a > b && a - t * v <= b - t * w) {
        cout << "YES" << endl;
        return 0;
    }

    cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
#include <stdio.h>
#include <algorithm>

#define all(x) x.begin(),x.end()
#define sc(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define pr(x) printf("%d",x)
#define prl(x) printf("%lld",x)
#define LL long long
#define pb push_back
#define PB pop_back
#define PF pop_front
#define F first
#define S second
#define inrow(vec)    for(int i=0;i<vec.size();i++)cout<<vec[i]<<" ";
#define incoloum(vec) for(int i=0;i<vec.size();i++)cout<<vec[i]<<endl;

const double PI=3.1415926;
const int KL=1e6;
const LL mod=1e9+7;

using namespace std;

LL q,x,y,z,n,m,a[KL],mn=1e9,mx=-1e9,ans;
string t;
vector < pair<LL,LL> > vec;
set <LL> s;
map <LL,LL> mp;

LL pow(LL u,LL v)
{
    if(!v)return 1;
    ans=pow(u,v/2)%mod;
    ans=(ans*ans)%mod;
    if(v%2)ans=(ans*u)%mod;
    return ans;
}
LL division(LL u,LL v)
{
    y=pow(v,mod-2);
    y=(y*u)%mod;
    return y;
}


int main()
{
    scl(n);
    for(int i=0;i<n;i++)scl(a[i]);
    for(int i=0;i<n;i++){
        x=a[i];
        for(LL j=2;j*j<=x;j++){
            if(x%j==0){
                LL cnt=0;
                while(x%j==0){x/=j;cnt++;}
                s.insert(j);
                mp[j]=max(mp[j],cnt);
            }
        }
        if(x!=1){
            s.insert(x);
            if(mp[x]==0)mp[x]++;
        }
    }
    auto it=s.begin();
    while(it!=s.end()){
        x=*it;
        ///cout<<x<<" ";
        vec.pb({x,mp[x]});
        it++;
    }
    ///cout<<endl;
    x=1;
    for(int i=0;i<vec.size();i++)x=(x*pow(vec[i].F,vec[i].S))%mod;
    LL sum=0;
    for(int i=0;i<n;i++)
    {
        sum+= division(x,a[i]);
        sum%=mod;
    }
    cout<<sum;


   return 0;
}


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

using namespace std;

const int N = 200010;

int where[N];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    a--;
    where[a] = i;
  }
  int ans = 1;
  int cur = 1;
  for (int i = 0; i + 1 < n; i++) {
    if (where[i] < where[i + 1]) {
      cur++;
    } else {
      cur = 1;
    }
    ans = max(ans, cur);
  }
  printf("%d\n", n - ans);
  return 0;
}

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

// cant imp

int main() {
    cin.tie(0);
    cin.sync_with_stdio(0);
    
    int n, v;
    cin >> n;
    vector<int> ecnt(100001, 0), ocnt(100001, 0);
    for (int i = 0; i < n; i++) {
        scanf("%d", &v);
        if (i % 2 == 0) ecnt[v]++;
        else ocnt[v]++;
    }

    int max_ecnt = 0, max_ocnt = 0;
    int max_e = 0, max_o = 0;
    for (int i = 0; i < 100001; i++) {
        if (max_ecnt < ecnt[i]) {
            max_ecnt = ecnt[i];
            max_e = i;
        }
        if (max_ocnt < ocnt[i]) {
            max_ocnt = ocnt[i];
            max_o = i;
        }
    }

    int ans;
    if (max_o == max_e) {
        sort(ecnt.begin(), ecnt.end(), greater<int>());
        sort(ocnt.begin(), ocnt.end(), greater<int>());
        int t1 = n - max_ecnt - ocnt[1];
        int t2 = n - ecnt[1] - max_ocnt;
        ans = min(t1, t2);
    } else {
        ans = n - max_ocnt - max_ecnt;
    }

    cout << ans << endl;
}

Measured memory_bytes: 3580
// #define STOPIT
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;

void debug_impl() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
    #define debug(...)\
    do {\
        cerr << boolalpha << "[" << #__VA_ARGS__ << "]:";\
        debug_impl(__VA_ARGS__);\
        cerr << std::noboolalpha;\
    } while (false)
#else
    #define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, enable_if_t<!is_same< Container, string >::value, nullptr_t> = nullptr>
istream& operator>> (istream& is, Container& v)
  { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, enable_if_t<!is_same< Container, string >::value, nullptr_t> = nullptr >
ostream& operator<< (ostream& os, Container const& v) {
  os << "{";
  for (auto it = v.begin(); it != v.end(); it++)
    {os << (it != v.begin() ? "," : "") << *it;}
  return os << "}";
}
int main()
{
    ll n, k;
    cin >> n >> k;

    ll res = min(n%k, abs(k-n%k));
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
/*
___ is a raging sadist.
*/
//Destroy all WA at test 2
// Stay cool
// Pass the 4th wall..

#include <bits/stdc++.h>
#define fastio()                  \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)
#define pb push_back
#define show(x) cout << (#x) << " : " << x << endl;
#define ll long long
#define ld long double
#define pow power
#define mp make_pair
#define ff first
#define ss second
#define pii pair<ll, ll>
#define sq(x) ((x) * (x))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define siz(a) int((a).size())
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define endl "\n"
#define pi 3.14159265
const ll mod = 1000 * 1000 * 1000 + 7;
const ll mod1 = 998244353;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7; 
using namespace std;

ll power(ll x, ll y) 
{ 
   ll res = 1;      
  
   
    while (y > 0) 
    { 
       
        if (y & 1) 
            res = (long long)(res*x); 
  

        y = y>>1; 

        if (x<=100000000)
        x = (long long)(x*x);

        //cout<<x<<'\n'; 
    } 
    return res; 
} 






int main()
{

#ifndef ONLINE_JUDGE    
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif

fastio();

    ll n;
    cin>>n;

    if (n>=30)
        cout<<"Yes";
    else
        cout<<"No";

return 0;
}

Measured memory_bytes: 3648