akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mp make_pair
#define pb push_back
#define fp first
#define sp second
typedef long long int ll;
typedef pair<ll,ll> pp;
#define check(x, i) ((x>>i)&1LL)
#define set(x,i) (x|(1LL<<i))
#define unset(x,i) (x&~(1LL<<i))
#define INF LONG_MAX
#define MAX_N 20
#define MAX 4000005
#define mod 1000000007
#define REP(i,n) for(i=0;i<n;i++)
#define FOR(i,a,b) for(i=a;i<=b;i++)
#define RFOR(i,a,b) for(i=a;i>=b;i--)
#define len(i,s) for(i=0;s[i];i++)
#define T() while(t--)
ll gcd (ll a, ll b){return (a?gcd(b%a,a):b);}
ll pow1(ll a,ll b,ll MOD){ll ans=1;while(b!=0){if(b&1)ans=(ans*a)%MOD;a=(a*a)%MOD;b=b/2;}return ans;}
ll modInverse(ll a,ll p){return pow1(a,p-2,p);}


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

ll n;
cin>>n;
n=n%10;
if(n==2||n==4||n==5||n==7||n==9)
	cout<<"hon";
else if(n==3)
	cout<<"bon";
else
	cout<<"pon";

}

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


def solve(R: int, G: int, B: int, N: int):
    count = 0
    for x in range(N+1):
        for y in range(N+1):
            rest = N - R * x - G * y
            z, q = divmod(rest, B)
            if z < 0:
                break
            if q == 0:
                count += 1
    print(count)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(R, G, B, N)

if __name__ == '__main__':
    main()


Measured memory_bytes: 39792
#include <bits/stdc++.h>
#include<stdio.h>
#include <stdlib.h>
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

using namespace std;

int main(){
    int N, M;
    int sum = 0;
    int c = 0;
    double D;
    cin >> N >> M;
    int A[N];

    for (int a = 0; a < N; a++){
        cin >> A[a];
        sum+=A[a];
    }
  
qsort(A, N, sizeof(int), compare_int);
  
  D=sum/(4.0*M);

for (int b = N; b >= 0;b--){

    if(D <= A[b-1]){
        c++;
    }else{
        break;
    }
}
if(c>=M){
    cout << "Yes" << endl;
}else{
    cout << "No" << endl;
}
}

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

using namespace std;

int main() {
    int N, L;
    cin >> N >> L;
    // from L to L+N-1
    int sum = (2 * L + N - 1) * N / 2;
    int eat = 0;
    if (L >= 0) eat = L;
    if (L + N - 1 <= 0) eat = L + N - 1;

    cout << sum - eat << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1 LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

LL f(LL x,LL y,LL z){
    LL tmp = x*x + y*y + z*z + x*y + y*z + z*x;
    return tmp;
}
int main() {
    LL N;cin >> N;
    map<LL,int> m;
    for(LL x = 1;x <= 100;x++){
        for(LL y = 1;y <= 100;y++){
            for(LL z = 1;z <= 100;z++){
                m[f(x,y,z)]++;
            }
        }
    }

    for(LL i = 1;i <= N;i++)cout << m[i] << endl;
}

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

using namespace std;

int n,a[3][3];
bool v[100],l[3]={1,1,1},r[3]={1,1,1},ans=0;

int main() {
	for(int i=0,j,x; i<3; ++i)
		for(j=0; j<3; ++j) 
			scanf("%d",&a[i][j]);
	scanf("%d",&n);
	for(int i=1,x; i<=n; ++i) {
		scanf("%d",&x);
		v[x]=1;
	}
	for(int i=0,j; i<3; ++i) {
		for(j=0; j<3; ++j)
			l[i]&=v[a[i][j]],r[j]&=v[a[i][j]];
	}
	for(int i=0; i<3; ++i) ans|=l[i]|r[i];
	if(v[a[0][0]] && v[a[1][1]] && v[a[2][2]]) ans=1;
	if(v[a[0][2]] && v[a[1][1]] && v[a[2][0]]) ans=1;
	puts(ans ? "Yes":"No");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
struct edge{
	int x,y,co;
}e[125];
int n,l,m,cnt;
void ins(int a,int b,int c)
{
	e[++cnt].x=a;e[cnt].y=b;e[cnt].co=c;
}
int main()
{
	scanf("%d",&l);
	n=floor(log2(l))+1;
	for(int i=1;i<n;i++)
	{
		ins(i,i+1,1<<(i-1));
		ins(i,i+1,0);
	}
	int now=0;int fu=1<<(n-1);
	while(l>1)
	{
		if(l&1)
		{
			ins(now+1,n,fu);
			fu|=1<<now;
		}
		l>>=1;
		now++;
	}
	printf("%d %d\n",n,cnt);
	for(int i=1;i<=cnt;i++) printf("%d %d %d\n",e[i].x,e[i].y,e[i].co);
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
//    cout<<fixed;
//    cout<<setprecision(10);
    ll n;
    cin>>n;
    string st;
    vector<string>v;
    map<string,int>mp;
    int mx=0;
    for (int i=0;i<n;i++)
    {
        cin>>st;
        v.push_back(st);
        mp[st]++;
        mx=max(mp[st],mx);
    }
    sort(v.begin(),v.end());
    for (int i=0;i<n;i++)
    {
        if (mp[v[i]]==mx)
        {
            mp[v[i]]=0;
            cout<<v[i]<<endl;
        }
    }


    return 0;
}


Measured memory_bytes: 26864
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll>P;

int main(){

    ll N;
    cin >> N;
    map<ll, ll>A, B;
    for(ll i = 0; i < N; i++){
        ll v;
        cin >> v;
        if(i & 1)A[v]++;
        else B[v]++;
    }
    vector<P>av, bv;
    av.push_back(P(N / 2, -1));
    bv.push_back(P(N / 2, -2));
    for(map<ll, ll>::iterator it = A.begin(); it != A.end(); it++){
        av.push_back(P(N/2-(*it).second, (*it).first));
    }
    sort(av.begin(), av.end());
    for(map<ll, ll>::iterator it = B.begin(); it != B.end(); it++){
        bv.push_back(P(N/2-(*it).second, (*it).first));
    }
    sort(bv.begin(), bv.end());
    P a0 = av[0];
    P a1 = av[1];
    P b0 = bv[0];
    P b1 = bv[1];
    ll ans = N;
    if(a0.second != b0.second)ans = min(ans, a0.first + b0.first);
    if(a1.second != b0.second)ans = min(ans, a1.first + b0.first);
    if(a0.second != b1.second)ans = min(ans, a0.first + b1.first);
    if(a1.second != b1.second)ans = min(ans, a1.first + b1.first);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 8824
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <algorithm>
#include <unordered_map>

#define rep(i, a, b) for (ll i = a; i < b; i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef unordered_map<string, ll> u_map;

// input
void input() {}
template <class Head, class... Tail>
void input(Head &&a, Tail &&... b)
{
    cin >> a;
    input(forward<Tail>(b)...);
}

template <class V>
void input(vector<V> &v)
{
    for_each(v.begin(), v.end(), [](auto &i) { input(i); });
}

// output
template <class V>
void output(vector<V> &v)
{
    for_each(v.begin(), v.end(), [](auto &x) { cout << x << " "; });
    cout << endl;
}

// math functions
ll mpow(ll a, ll n, ll p)
{
    ll x = 1;
    while (n > 0)
    {
        if (n & 1)
        {
            x = a * x % p;
        }
        a = a * a % p;
        n >>= 1;
    }

    return x;
}

ll mfact(ll n, ll p)
{
    ll res = 1;
    for (ll i = 2; i <= n; i++)
    {
        res = res * i % p;
    }
    return res;
}

ll mcomb(ll n, ll r, ll p)
{
    if (n == 0 && r == 0)
    {
        return 1;
    }
    if (n < r || n < 0 || r < 0)
    {
        return 0;
    }

    ll a = mfact(n, p);
    ll b = mfact(n - r, p);
    ll c = mfact(r, p);
    return (((a * mpow(b, p - 2, p)) % p) * mpow(c, p - 2, p)) % p;
}

ll gcd(ll a, ll b)
{
    if (a < b)
    {
        a ^= b;
        b ^= a;
        a ^= b;
    }
    return b ? gcd(b, a % b) : a;
}

ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}

int main()
{
    ll N, M;
    input(N, M);

    cout << (N == M ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<math.h>
int main() {
	int a,b;
	char c;
	scanf("%d %c %d",&a,&c,&b);
	if(c=='+'){
		printf("%d",a+b);
	}else if(c=='-'){
		printf("%d",a-b);
	}
	return 0;
}

Measured memory_bytes: 128
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif


using namespace std;
using ll = long long;

const ll MOD = 1000000007;
const ll INF = 1e18;
const double pi = acos(-1);
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};


#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()


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; }





void solve(){
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    
    
    int n; cin >> n;
    priority_queue<pair<int,int>> A;
    rep(i,n){
        int a; cin >> a;
        A.push(make_pair(-1*a, i+1));
    }
    
    
    while(!A.empty()){
        cout << A.top().second << endl;
        A.pop();
    }
    
    
    
    
}



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



Measured memory_bytes: 1780
/***
**   AUTHOR::ASHUTOSH MOUDGIL
***/


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

#define pb push_back
#define mp make_pair
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F first
#define S second
#define int long long
//#define ll long long
#define all(x) x.begin(),x.end()
#define rsort(x) sort(all(x)); reverse(all(x));
#define endl '\n'
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define vi vector<int>
#define vlli vector<long long>
#define pii pair<int,int>
#define mod 1000000007
#define LMAX 1e18
#define deb(x) cout<<#x<<" : "<<x<<endl;

void mymain(){
    int n,k,q;
    cin >> n >> k >>q;
    vi arr(n,k-q);
    for(int i=0;i<q;i++){
        int a;
        cin >> a;
        arr[a-1]++;
    }
    for(int i=0;i<n;i++){
        if(arr[i]>0)
            cout << "Yes" <<endl;
        else
            cout << "No" <<endl;
    }

}

signed main(){
IOS;
///freopen("input.txt", "r", stdin);
///freopen("output.txt", "w", stdout);
int t=1;
///cin>>t;
for(int tt=0;tt<t;tt++){
   ///cout << "Case #" << tt+1 <<": ";
   mymain();
   }
return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
  int n, tmp=0, ans, i;
  cin >> n;
  char a[n];
  cin >> a;
  for(i=1; i<n; i++)
    if(a[i]=='E') tmp++;
  ans=tmp;
  for(i=1; i<n; i++){
    if(a[i-1]=='W') tmp++;
    if(a[i]=='E') tmp--;
    if(tmp<ans) ans=tmp;
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<vector>

using namespace std;

int main()
{
    vector<int> n, r;
    int a, b;
    int count = 0;
    
    while(1)
    {
        cin >> a >> b;
        if(a == 0 && b == 0)
            break;

        n.push_back(a);
        r.push_back(b);
        count++;
    }

    for(int i = 0; i < count; i++)
    {
        int counter = 0;

        for(int j = 1; j <= n[i]; j++)
        {
            for(int k = 1; k <= n[i]; k++)
            {
                for(int l = 1; l <= n[i]; l++)
                {
                    if(r[i] == j + k + l
                    && j != k
                    && k != l
                    && l != j)
                        counter++;
                }
            }
        }

        cout << counter / 6 << endl;
    }

    return 0;
} 

Measured memory_bytes: 1216
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;


public class Main {
    long N;

    private Map<Long, Integer> primeFactors(long n) {
        Map<Long, Integer> primeFactors = new HashMap<>();
        long tmp = n;
        for(long i = 2;i * i <= n && i <= tmp;i++) {
            int cnt = 0;
            while(tmp % i == 0) {
                tmp /= i;
                cnt++;
            }
            if (cnt > 0) {
                primeFactors.put(i, cnt);
            }
        }
        if (tmp > 1) {
            primeFactors.put(tmp, 1);
        }
        return primeFactors;
    }

    private void solve() {
        N = nextLong();
        Map<Long, Integer> map = primeFactors(N);
        int ans = 0;
        for(int i : map.values()) {
            int j = 1;
            while(j <= i) {
                ans++;
                i -= j;
                j++;
            }
        }
        out.println(ans);
    }

    public static void main(String[] args) {
        out.flush();
        new Main().solve();
        out.close();
    }

    /* Input */
    private static final InputStream in = System.in;
    private static final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[4096];
    private int p = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (p < buflen)
            return true;
        p = 0;
        try {
            buflen = in.read(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (buflen <= 0)
            return false;
        return true;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrint(buffer[p])) {
            p++;
        }
        return hasNextByte();
    }

    private boolean isPrint(int ch) {
        if (ch >= '!' && ch <= '~')
            return true;
        return false;
    }

    private int nextByte() {
        if (!hasNextByte())
            return -1;
        return buffer[p++];
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = -1;
        while (isPrint((b = nextByte()))) {
            sb.appendCodePoint(b);
        }
        return sb.toString();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] x = new int[n];
        for(int i = 0;i < n;i++) {
            x[i] = nextInt();
        }
        return x;
    }

    public long[] nextLongArray(int n) {
        long[] x = new long[n];
        for(int i = 0;i < n;i++) {
            x[i] = nextLong();
        }
        return x;
    }

    public double[] nextDoubleArray(int n) {
        double[] x = new double[n];
        for(int i = 0;i < n;i++) {
            x[i] = nextDouble();
        }
        return x;
    }
}

Measured memory_bytes: 25748
#include <iostream>
#include <algorithm>

using namespace std;
const long long inf = 1e15;
struct Edge {
	long long x, y, z;
	bool operator < (const Edge &e2) const {
		return x < e2.x;
	};
} e[100005];
int n, m;
long long ans[400005], tag[400005];
#define ls (p<<1)
#define rs (p<<1|1)
#define mid ((l + r) >> 1)
void pushdown(int p) {
    if(tag[p] == inf) return;
	tag[ls] = min(tag[ls], tag[p]);
	tag[rs] = min(tag[rs], tag[p]);
	ans[ls] = min(ans[ls], tag[p]);
	ans[rs] = min(ans[rs], tag[p]);
	tag[p] = inf;
	return;
}
void update(int p, int l, int r, int ql, int qr, long long c) {
	if(ql <= l && r <= qr) {
		tag[p]= min(tag[p], c);
		ans[p]= min(ans[p], c);
		return;
	}
	pushdown(p);
	if(mid >= ql) update(ls, l, mid, ql, qr, c);
	if(mid < qr) update(rs, mid + 1, r, ql, qr, c);
	return;
}
long long query(int p, int l, int r, int x) {
	if(l == r) return ans[p];
	pushdown(p);
	if(mid >= x) return query(ls, l, mid, x);
	return query(rs, mid + 1, r, x);
}
#undef ls
#undef rs
#undef mid
int main() {
	for(int i = 1; i <= 400000; i++) ans[i] = tag[i] = inf;
	cin >> n >> m;
	for(int i = 1; i <= m; i++) {
		cin >> e[i].x >> e[i].y >> e[i].z;
	}
	update(1, 1, n, 1, 1, 0);
	sort(e + 1, e + m + 1);
	for(int i = 1; i <= m; i++) {
		update(1, 1, n, e[i].x, e[i].y, query(1, 1, n, e[i].x) + e[i].z);
	}
	long long res = query(1, 1, n, n);
	if(res == inf) res = -1;
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 8832
use std::io::*;

fn main() {
    let stdin = stdin();
    let mut stdinlock = stdin.lock();
    let mut str1 = String::new();
    let mut str2 = String::new();
    stdinlock.read_line(&mut str1).unwrap();
    stdinlock.read_line(&mut str2).unwrap();
    let mut bytes1 = str1.trim().as_bytes().to_owned();
    let mut bytes2 = str2.trim().as_bytes().to_owned();
    bytes1.sort();
    bytes2.sort();
    bytes2.reverse();
    //println!("{:?}, {:?}", bytes1, bytes2);
    for (i, val2) in bytes2.iter().enumerate() {
        if i >= bytes1.len() {
            println!("Yes");
            return;
        }
        if *val2 > bytes1[i] {
            println!("Yes");
            return;
        }
        if *val2 < bytes1[i] {
            println!("No");
            return;
        }
    }
    println!("No");
}


Measured memory_bytes: 4352
//Generated at 2020-03-22 20:12:13 UTC+8
//Created by Alphagocc
#include <bits/stdc++.h>
using namespace std;
main()
{
    double n;
    cin >> n;
    cout << fixed << setprecision(9) << (n / 3) * (n / 3) * (n / 3) << endl;
}

Measured memory_bytes: 256
import numpy as np
 
N, W = map(int, input().split())
WV = np.array([input().split() for _ in range(N)], np.int64)
V = sum(WV[:,1])
dp = np.zeros(V + 1, np.int64)
dp += 10 ** 10
dp[0] = 0
for w, v in WV:
    dp[v:] = np.minimum(dp[v:], dp[:-v] + w)
for v in range(V + 1):
    if dp[v] <= W:
        ans = v
print(ans)

Measured memory_bytes: 21160
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int test_cases = 1;
        Solver s = new Solver();
        for (int i = 1; i <= test_cases; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }
}

class Solver {
    void solve(int test_number, InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            if (map.get(x) == null) {
                map.put(x, 1);
            } else {
                map.put(x, map.get(x) + 1);
            }
        }
        int m = in.nextInt();
        boolean ok = true;
        for (int i = 0; i < m; i++) {
            int x = in.nextInt();
            if (map.get(x) != null && map.get(x) != 0) {
                map.put(x, map.get(x) - 1);
            } else {
                ok = false;
            }
        }
        out.println(ok ? "YES" : "NO");
    }
}


class InputReader {
    BufferedReader br;
    StringTokenizer st;

    public InputReader()
    {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}

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

#pragma warning(disable:4996)
using namespace std;


#define Seg_Max_N (1<<20) 

using Value =long long int;
const Value ini =1e18;
struct segtree {
	int N;
	vector<Value>dat;

	segtree() {}
	segtree(int n) :dat(2 * Seg_Max_N) {
		N = 1;
		while (N < n) N *= 2;
		for (int i = 0; i < 2 * N - 1; i++) {
			dat[i] = ini;
		}
	}
	Value connect(const Value&l, const Value&r) {
		return min(l,r);
	}
	// update k th element
	void update(int k, Value a) {
		k += N - 1;
		dat[k] = a;

		while (k > 0) {
			k = (k - 1) / 2;
			const Value al(dat[k * 2 + 1]);
			const Value ar(dat[k * 2 + 2]);
			dat[k] = connect(al, ar);
		}
	}
	// min [a, b)
	Value  query(int a, int b) { return query(a, b, 0, 0, N); }
	Value  query(int a, int b, int k, int l, int r) {
		if (r <= a or b <= l) return ini;
		if (a <= l and r <= b) return dat[k];
		const int m = (l + r) / 2;
		const Value al(query(a, b, k * 2 + 1, l, m));
		const Value ar(query(a, b, k * 2 + 2, m, r));
		return connect(al, ar);
	}
};
int main() {
	int N;cin>>N;
	vector<long long int>v(N);
	for(int i=0;i<N;++i)cin>>v[i];

	vector<long long int>l_memo(N+1),r_memo(N+1);
	l_memo[0]=0;
	{
		long long int sum = 0;
		for (int i = 0; i < N; ++i) {
			sum += v[i];
			l_memo[i + 1] = min(sum, l_memo[i] + (v[i] % 2)+(v[i]==0?2:0));
		}
	}
	r_memo[N]=0;
	{
		long long int sum=0;
		for (int i = N - 1; i >= 0; --i) {
			sum+=v[i];
			r_memo[i]=min(sum,r_memo[i+1]+(v[i]%2) + (v[i] == 0 ? 2 : 0));
		}
	}
	long long int answer=1e18;

	segtree seg(N+1);

	long long int odd_num=0;
	vector<long long int>even_nums(N+1);
	for (int i = 0; i < N; ++i) {
		even_nums[i+1]=even_nums[i]+((1+v[i])%2);
	}
	for (int i = 0; i <= N; ++i) {
		seg.update(i,even_nums[i]+r_memo[i]);
	}

	long long int odd_cnt=0;
	for (int l = 0; l <= N; ++l) {
		long long int nanswer=l_memo[l];
		nanswer+=seg.query(l,N+1);
		nanswer-=odd_cnt;

		answer=min(answer,nanswer);

		if(l!=N&&v[l]%2==0)odd_cnt++;
	}

	cout<<answer<<endl;
	return 0;
}

Measured memory_bytes: 22912
#include <stdio.h>
     
    int main(void){
      int a,b,c,d;
      scanf("%d",&d);
      a=d/1000;
      b=(d/100)%10;
      c=(d/10)%10;
      d=d%10;
      if(a+b+c+d==7)printf("%d+%d+%d+%d=7",a,b,c,d);
      else if(a+b+c-d==7)printf("%d+%d+%d-%d=7",a,b,c,d);
      else if(a+b-c+d==7)printf("%d+%d-%d+%d=7",a,b,c,d);
      else if(a+b-c-d==7)printf("%d+%d-%d-%d=7",a,b,c,d);
      else if(a-b+c+d==7)printf("%d-%d+%d+%d=7",a,b,c,d);
      else if(a-b+c-d==7)printf("%d-%d+%d-%d=7",a,b,c,d);
      else if(a-b-c+d==7)printf("%d-%d-%d+%d=7",a,b,c,d);
      else if(a-b-c-d==7)printf("%d-%d-%d-%d=7",a,b,c,d);
      return 0;
    }

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n; cin >> n;
    vector<string> s(n);
    int TA = 0,TB = 0, TAB = 0;
    long long ans = 0;
    for(int i = 0; i < n; i++){
        cin >> s[i];
        if(s[i][0] == 'B' && s[i][s[i].size()-1] == 'A'){
            TAB++;
        }else if(s[i][0] == 'B'){
            TB++;
        }else if(s[i][s[i].size()-1] == 'A'){
            TA++;
        }
        for(int j = 0; j < s[i].size() - 1; j++){
            if(s[i][j] == 'A' && s[i][j+1] == 'B') ans++;
        }
    }
    if(TA == 0 && TB == 0 && TAB != 0){
        ans += TAB - 1;
    }else{
        ans += min(TA,TB) + TAB;
    }
    cout << ans << endl;
}

Measured memory_bytes: 768
#include <cstdio>
using namespace std;
int main () {
	#ifdef chitongz
//	freopen ("x.in", "w", stdin);
	#endif
	int m, d, ans = 0;
	scanf ("%d%d", &m, &d);
	for (int i = 2; i <= 9; ++i) {
		for (int j = 2; j <= 9; ++j) {
			if (i * 10 + j > d) break;
			if (i >= 2 && j >= 2 && i * j >= 1 && i * j <= m) {
//				printf("%d %d\n", i, j);
				ans++;
			}
		}
	}
	printf ("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
A,B,C,D=map(int,input().split())
mod=998244353
dp=[[0]*(C-A+1) for _ in range(D-B+1)]
dp[0][0]=1
for i in range(1,D-B+1):
	dp[i][0]=dp[i-1][0]*A%mod
for j in range(1,C-A+1):
	dp[0][j]=dp[0][j-1]*B%mod
for i in range(1,D-B+1):
	for j in range(1,C-A+1):
		dp[i][j]+=(dp[i-1][j]*(A+j)+dp[i][j-1]*(B+i)-((B+i-1)*(A+j-1))*dp[i-1][j-1]+mod)%mod
print(dp[-1][-1])

Measured memory_bytes: 133760
n,m,q = map(int,input().split())
a = [[int(i) for i in input().split()] for _ in range(q)]
b = []
for i in range(m):
    b.append(i+1)
import itertools
l = list(itertools.combinations_with_replacement(b,n))
max=0
#print(l)                                                                      
for ll in l:
    m=0
    for aa in a:
        if ll[aa[1]-1]-ll[aa[0]-1]==aa[2]:
            m+=aa[3]
    if max < m:
        max=m
print(max)

Measured memory_bytes: 84472
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
using namespace std;

int main() {
    int n, q; cin >> n >> q;
    string s; cin >> s;
    int len = s.size();

    vector<int> l(q), r(q);
    for(int i = 0; i < q; i++) cin >> l[i] >> r[i];

    vector<int> sum(len + 1, 0);

    for(int i = 1; i < len; i++) {
        if(s[i - 1] == 'A' && s[i] == 'C') sum[i + 1] = sum[i] + 1;
        else sum[i + 1] = sum[i];
    }

    for(int i = 0; i < q; i++) {
        int ans = sum[r[i]] - sum[l[i]];
        cout << ans << endl;
    }
}


Measured memory_bytes: 2304
#include<stdio.h>

int head,tail,MAX;
typedef struct{
	char name[10];
	int times;
} queue;
queue Q[100002],stack;

int Empty()
{
	if(head==tail){return 1;}
	else{return 0;}
}
int Full()
{
	if(head==(tail+1)%MAX){return 1;}
	else{return 0;}
}
int append(queue *Q,queue x)
{
	if(Full()){printf("error. overflow.");return -1;}
	Q[tail]=x;
	if(tail+1==MAX){tail=0;}
	else{tail++;}
	return 0;
}
queue recall(queue *Q,queue x)
{
	if(Empty()){printf("error. underflow.");return x;}
	x=Q[head];
	if(head+1==MAX){head=0;}
	else{head++;}
	return x;
}
int main(void)
{
	int i,n,q,T=0;
	scanf("%d %d",&n,&q);
	head=tail=0;MAX=n+1;
	for(i=0;i<n;i++)
	{
		scanf("%s %d",stack.name,&stack.times);
		append(Q,stack);
	}
	while(!Empty())
	{
		stack=recall(Q,stack);
		if(stack.times>q){
			stack.times-=q;
			T+=q;
			append(Q,stack);
		}else{
			T+=stack.times;
			printf("%s %d\n",stack.name,T);
		}
	}

	return 0;
}

Measured memory_bytes: 1384
fun main(args: Array<String>) {
    val (n, p) = readLine()!!.split(" ").map { it.toLong() }

    var ans = 1L
    var d = Math.ceil(Math.pow(p.toDouble(), 1.0/n.toDouble())).toLong()
    for (i in d downTo 1) {
        if (p % i != 0L) {
            continue
        }

        var x = Math.ceil(Math.pow(i.toDouble(), n.toDouble())).toLong()
        if (p % x == 0L) {
            ans = i
            break
        }
    }
    println(ans)
}

Measured memory_bytes: 37904
N, K, Q = input().split()
N = int(N)
K = int(K)
Q = int(Q)
A = [0] * Q
for i in range(0, Q):
  A[i] = int(input()) - 1
B = [K] * N
for i in range(0, Q):
  B[A[i]] += 1
C = [" "] * N
for i in range(0, N):
  B[i] -= Q
  if B[i] <= 0:
    C[i] = "No"
  else:
    C[i] = "Yes"
for i in range(0, N):
  print(C[i])

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

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

    bool flg = false;
    for(int i = 1; i < 10; i++) {
        if(n % i == 0 && (n / i) < 10) {
            flg = true;
        } 
    }

    cout << (flg ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;


int main() {
int N;
string S;
cin >> N >> S;
int cnt = -1;
for (int i = 1;i < N;i++) {
    int a = 0;
    set<char> X;
    set<char> Y;
    for (int j = 0;j < i;j++) {
        X.insert(S.at(j));
    }
    for (int j = i;j < N;j++) {
        if (Y.count(S.at(j))) continue;
        else if (X.count(S.at(j))) {
            a++;
            Y.insert(S.at(j));
        }
    }
    if (a > cnt) cnt = a;
}
cout << cnt << endl;

return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ALL(a)  (a).begin(),(a).end()
using namespace std;

int main(){
    int k, x;
    cin >> k >> x;

    int min = x-(k-1);
    int max = x+(k-1);

    for(int i = min; i <= max; ++i){
        cout << i << " ";
    }
    cout << endl;

}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using static System.Math;

class program
{
    static public int mod = 1000000007;
    static void Main()
    {
        var s = rstr();
        int isr = 0;
        if (s[0] == 'R') isr += 1;
        if (s[1] == 'R') isr += 2;
        if (s[2] == 'R') isr += 4;
        if (isr == 7) Write(3);
        else if (isr == 6 || isr == 3) Write(2);
        else if (isr != 0) Write(1);
        else Write(0);
    }

    static int pow(int a, int b) { string binary = Convert.ToString(b, 2); int bileng = binary.Length; long a_power = a; long value = 1; for (int i = bileng - 1; i >= 0; i--) { if (binary[i] == '1') { value = value * a_power % mod; } a_power = a_power * a_power % mod; } return (int)value; }
    static string rstr() { return ReadLine(); }
    static int rint() { return int.Parse(ReadLine()); }
    static long rlong() { return long.Parse(ReadLine()); }
    static string[] stra() { return ReadLine().Split(' '); }
    static char[] chara() { string[] a = stra(); string b = ""; for (int i = 0; i < a.Length; i++) { b += a[i]; } return b.ToCharArray(); }
    static int[] inta() { string[] read_str_array = ReadLine().Split(' '); int[] return_int_array = new int[read_str_array.Length]; for (int countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_int_array[countup_i] = int.Parse(read_str_array[countup_i]); } return return_int_array; }
    static long[] longa() { string[] read_str_array = ReadLine().Split(' '); long[] return_long_array = new long[read_str_array.Length]; for (long countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_long_array[countup_i] = long.Parse(read_str_array[countup_i]); } return return_long_array; }
    static double[] doublea() { string[] read_str_array = ReadLine().Split(' '); double[] return_double_array = new double[read_str_array.Length]; for (long countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_double_array[countup_i] = double.Parse(read_str_array[countup_i]); } return return_double_array; }
    static long GCD(long a, long b) { if (a < b) { long temp = a; a = b; b = temp; } if (a % b == 0) { return b; } else { long temp = b; b = a % b; a = temp; return GCD(a, b); } }
    static long LCM(long a, long b) { return a * b / GCD(a, b); }
    static void WriteArray2(int[,] a, int b, int c) { for (int i = 0; i < b; i++) { for (int j = 0; j < c; j++) { if (j != 0) Write(" "); Write(a[i, j]); } WriteLine(); } }
    static void WriteArray(int[] a, int b) { for (int i = 0; i < b; i++) { Write(" "); Write(a[i]); } WriteLine(); }
}


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

int main() {
	char c;

	cin >> c ;
	
	if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c=='o') {
		cout << "vowel" << endl;
	} else {
		cout << "consonant" << endl;
	}
}

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

class Monster{
    public:
        int hp;
        int atk;

        Monster(){
            cin >> hp >> atk;
        }

        void Attack(Monster &enemy){
            if(hp>=1) enemy.hp -= atk;
        }

        bool die(){
            if(hp<=0) return true;
            else return false;
        }

};



int main() {
    Monster takahashi,aoki;

    while(!takahashi.die()&&!aoki.die()){
        takahashi.Attack(aoki);
        aoki.Attack(takahashi);
    }

    if(takahashi.die()) cout << "No" << endl;
    else cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 3604
/*#include<cstdio>      最后一个测试点过不了，不知道为什么
const int maxn = 100010;
int luck[maxn] = {0};
int main(){
    int n;
    int countluck = 0;
    int countunluck = 0;
    int counttwo = 0;
    scanf("%d",&n);
    for(int i = 0;i < n;i++){
        scanf("%d",&luck[i]);
        if(luck[i] % 4 == 0){
            countluck++;
        }else if(luck[i] % 2 == 0){
            counttwo++;
        }else{
            countunluck++;
        }
    }
    if(counttwo == 0){
        if(countunluck - 1 > countluck){
            printf("No\n");
        }else{
            printf("Yes\n");

        }
    }
    else if (counttwo > 0){
        if(counttwo == 1){
            countunluck++;
        }else{
            countluck +=(counttwo/2);
        }

        if(countunluck-1  > countluck){
            printf("No\n");

        }else{
            printf("Yes\n");

        }
    }


    return 0;
}
*/

#include<cstdio>      
const int maxn = 100010;
int luck[maxn] = {0};
int main(){
    int n;
    int countluck = 0;
    int countunluck = 0;
    int counttwo = 0;
    scanf("%d",&n);
    for(int i = 0;i < n;i++){
        scanf("%d",&luck[i]);
        if(luck[i] % 4 == 0){
            countluck++;
        }else if(luck[i] % 2 == 0){
            counttwo++;
        }else{
            countunluck++;
        }
    }
    if(counttwo == 0){
        if(countunluck - 1 > countluck){
            printf("No\n");
        }else{
            printf("Yes\n");

        }
    }
    else if (counttwo > 0){           //将2放在末尾，所以说需要unlucky的数量小于luck的数量
            
        /*if(counttwo == 1){
            countunluck++;
        }else{
            countluck +=(counttwo/2);
        }*/

        if(countunluck > countluck){
            printf("No\n");

        }else{
            printf("Yes\n");

        }
    }


    return 0;
}



























Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int k, n;
    ll p[300005] = {1};
    cin >> k >> n;
    for (int i = 1; i <= n; i++) p[i] = min(mod * 328ll, 1ll * p[i - 1] * k);
    for (int i = 1; i <= n; i++) p[i] = min(mod * 328ll, p[i - 1] + p[i]);
    if (k % 2 == 0) {
        cout << k / 2 << ' ';
        for (int i = 1; i < n; i++) cout << k << ' ';
    } else if (k == 1) {
        for (int i = 1; i <= (n + 1) / 2; i++) cout << 1 << ' ';
    } else {
        int m = 0;
        while (p[m] <= n) m++;
        for (int i = 1; i <= n - m; i++) cout << k / 2 + 1 << ' ';
        ll x = p[m] + 1;
        x -= n - m;
        if (n % 2) x++;
        x /= 2;
        //cout << m << ' ' << p[m] << ' ' << x << '\n';
        for (int i = m; i; i--) {
            if (x == 1) break;
            int y = (int)((x - 2) / p[i - 1]);
            cout << y + 1 << ' ';
            x -= y * p[i - 1] + 1;
        }
    }
    /*
     1 1093 1093->547 1093 (1641) +0.5
     1 364 364->182 364 (547) -0
     1 121 121->60 121 (182) -0.5
     1 40 40->19 40 (60) -1
     1 13 13->5 13 (19) -1.5
     1 4->4 4 4 (5) [-2]
     1 1 1 1->1
     2 2 2 2 2 1 3
     
     big-0 = 3
     big-0.5 = 3
     big-1 = 3
     big-1.5 = 3
     big-2 = 3
     big-2.5 = 3
     big-3 = 3
     big-3.5 = 3
     big-4 = 3
     big-4.5 = 3
     1 156 156 156 156 156 - 5 = 3
     1 31 31 31 31 31 - 5.5 = 3
     1 6 6 6 6 6 [- 6] = 2 31->16
     1 1 1 1 1 1 - 6.5x
     x 1 11 12 13 14 15 2 21 [22/10] 23/11 24/12 25/13 3/14 31/15 32/16 33/17 34/18 35/19
     */
}


Measured memory_bytes: 4608
use proconio::input;
use proconio::marker::Usize1;
use std::cmp::{Reverse, min};
use std::collections::BinaryHeap;

struct Path {
    node: usize,
    cost: usize,
    time: u64,
}

impl Clone for Path {
    fn clone(&self) -> Path {
        Path{node: (&self).node, cost: (&self).cost, time: (&self).time}
    }
}

fn main() {
    input!{
        n: usize,
        m: usize,
        s: usize,
        edges: [(Usize1, Usize1, usize, u64); m],
        ex_infos: [(usize, u64);n],
    }
    
    let mut graph: Vec<Vec<Path>> = vec![vec![]; n];
    let mut all_cost = 0;
    for (u, v, cost, time) in edges {
        graph[u].push(Path{node: v, cost, time});
        graph[v].push(Path{node: u, cost, time});
        all_cost += cost;
    }

    solve(graph, ex_infos, s, all_cost);
}

fn solve(graph: Vec<Vec<Path>>, exchange: Vec<(usize, u64)>, s: usize, max_cost: usize) -> () {
    let max_time = std::u64::MAX;
    let s = min(max_cost, s);
    let n = graph.len();
    let mut dp = vec![vec![max_time; max_cost + 1]; n];
    let mut is_fixed = vec![vec![false; max_cost + 1]; n];

    // heap(所要時間, 所持銀貨, 都市)
    let mut r_heap: BinaryHeap<(Reverse<u64>, usize, usize)> = BinaryHeap::new();
    
    r_heap.push((Reverse(0), s, 0));
    while !r_heap.is_empty() {
        let (Reverse(time), poss, node) = r_heap.pop().unwrap();
        if is_fixed[node][poss] {continue};
        
        // 確定
        for i in 0..poss + 1 {
            if dp[node][i] > time {
                dp[node][i] = time; 
                is_fixed[node][i] = true;
            }
        }

        // 両替
        let (rate, ex_time) = exchange[node];
        let (exd_poss, exd_time) = (min(poss + rate, max_cost), time + ex_time);
        //if dp[node][exd_poss] > exd_time {
        if !is_fixed[node][exd_poss] {
            r_heap.push((Reverse(exd_time), exd_poss, node));
        }
        
        // 移動
        for next in &graph[node] {
            let next_time = next.time + dp[node][poss];
            if next.cost > poss 
                || is_fixed[next.node][poss - next.cost] {continue;} 
            //|| dp[next.node][poss - next.cost] < next_time {continue;};
            r_heap.push((Reverse(next_time), poss - next.cost, next.node));

        }
    }

    let ans: Vec<_> = dp.iter().map(|v| v.iter().min().unwrap()).collect();
    for a in &ans[1..] {
        println!("{}", a);
    }
}

Measured memory_bytes: 3304
N = int(input())
restaurants = [input().split() for i in range(N)]
for i, restaurant in enumerate(restaurants):
    restaurant.append(i+1)
    restaurant[1] = int(restaurant[1])


tmp = sorted(restaurants, key=lambda x: x[1], reverse=True)
sorted_rest = sorted(tmp, key=lambda x: x[0])

for elem in sorted_rest:
    print(elem[2])


Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>
#include <map>

#define MAX_SIZE 100000000
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

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

  int N; cin>>N;
  vector<int> T(N+1), X(N+1), Y(N+1);
  T[0] = X[0] = Y[0] = 0;
  for(int i = 1; i < N+1; i++) {
    cin >> T[i] >> X[i] >> Y[i];
  }

  bool can = true;
  for(int i = 0; i < N; i++) {
    int dt = T[i + 1] - T[i];
    int dist = abs(X[i + 1] - X[i]) + abs(Y[i + 1] - Y[i]);
    if(dt < dist) {
      can = false;
      break;
    }
    if(dt % 2 != dist % 2) {
      can = false;
      break;
    }
  }

  if(can) cout << "Yes" << endl;
  else cout << "No" << endl;
}


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

#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define OUT(a) cout << (a) << "\n"
#define ll long long
#define uint unsigned int
#define ushort unsigned short
#define ulong unsigned long

ll MOD = 10e9 + 7;

int main() {
    double a,b,x;
    cin >> a >> b >> x;
    x /= a;
    double c = (x*2)/b;
    double ans = 0;
    // c > aの時は四角がある
    if (c > a) {
        c = (2*x)/a - b;
        ans = (atan2(b-c, a)/M_PI)*180.0;
    } else {
        ans = (atan2(b, c)/M_PI)*180.0;
    }
    printf("%.16lf\n", ans);
    return 0;
}



Measured memory_bytes: 256
using System;

namespace ABC067
{
    class Program
    {
        static void Main(string[] args)
        {
            var AB = Console.ReadLine().Split(' ');
            var A = int.Parse(AB[0]);
            var B = int.Parse(AB[1]);

            var isPossible = A % 3 == 0
                || B % 3 == 0
                || (A + B) % 3 == 0;

            var output = isPossible ? "Possible" : "Impossible";
            Console.Write(output);
        }
    }
}


Measured memory_bytes: 11092
#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(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

//"AC"をまとめて扱うのではなく、「Cが隣にあるようなAの個数」を数えると読み替える

int main(){
   int n, q;
   cin >> n >> q;
   string s;
   cin >> s;

    //累積和
   bool leftc=false;
   vector<int> sum(n+1,0);
   rep(i,n){
       if(i+1 < n && s.at(i)=='A' && s.at(i+1)=='C'){
           sum.at(i+1) ++;
       }
       sum.at(i+1) += sum.at(i);
   }

    //クエリ処理
    //今回はACのAの所でsumを+1しているので、
    //A|Cのような分け方があるとうまくいかない
    //そのためrとlを１つ左にずらす。
   rep(i,q){
       int l, r;
       cin >> l >> r;
       r--;l--;
       cout << sum[r] - sum[l] << endl;


   }



}

Measured memory_bytes: 3852
s=-1e9
(1..gets.to_i).map{a=[];gets.split.map(&:to_i).map{|i|(a.map!{|j|j+i}<<i).dup}}.transpose.each{|l|l.transpose.each{|i|a=[];i.each{|j|m=(a.map!{|k|k+j}<<j).max;s<m&&s=m}}}
p s

Measured memory_bytes: 16400
#include<stdio.h>

int main(){
    char a[10];

    scanf("%s",&a);
    if(a[0] == 'S'){
        printf("Cloudy");
    }else if(a[0] == 'C'){
        printf("Rainy");
    }else if(a[0] == 'R'){
        printf("Sunny");
    }
    
    return 0;
    
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 28);
const ll LINF = 1e18;
const double PI = acos(-1);

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vll T(N), A(N);
	REP(i, N)cin >> T[i];
	REP(i, N)cin >> A[i];
	vll ans(N);
	int pre = -1;
	REP(i, N) {
		if (pre != T[i]) {
			if (T[i] > A[i]) {
				ans[i] = 0;
				pre = T[i];
				continue;
			}
			else {
				ans[i] = 1;
				pre = T[i];
				continue;
			}
		}
		ans[i] = T[i];
		pre = T[i];
	}
	pre = -1;
	REPR(i, N) {
		if (pre != A[i]) {
			if (A[i] > T[i]) {
				ans[i] = 0;
				pre = A[i];
				continue;
			}
			else {
				ans[i] = min(ans[i], 1ll);
				pre = A[i];
				continue;
			}
		}
		ans[i] = min(ans[i], A[i]);
		pre = A[i];
	}
	ll n = 1;
	REP(i, N) {
		n *= ans[i];
		n %= MOD;
	}
	cout << n << endl;
	return 0;
}


Measured memory_bytes: 2560
#include<stdio.h>

int x,y,v,s;

int main(void){

  scanf("%d %d",&x,&y);
  if(x>=y){
  while(x>=y && x%y!=0){
    v = x;
    x = y;
    y = v%y;
  }
}
  else{
    s = x;
    x = y;
    y = s;
    while(x>=y && x%y!=0){
      v = x;
      x = y;
      y = v%y;
    }
  }

  printf("%d\n",y);

  return 0;
}



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

string s[100];
bool y[100], x[100];

int main(){
    int h, w;
    cin >> h >> w;
    for(int i = 0; i < h; i++) cin >> s[i];
    for(int i = 0; i < h; i++){
        bool f = true;
        for(int j = 0; j < w; j++){
            if(s[i][j] == '#'){
                f = false; break;
            }
        }
        if(f) y[i] = true;
    }
    for(int i = 0; i < w; i++){
        bool f = true;
        for(int j = 0; j < h; j++){
            if(s[j][i] == '#'){
                f = false; break;
            }
        }
        if(f) x[i] = true;
    }
    for(int i = 0; i < h; i++){
        if(y[i]) continue;
        for(int j = 0; j < w; j++){
            if(x[j]) continue;
            cout << s[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;

int main () {
	int N;
	cin >> N;
	vector<ll> A;
	for(int i = 0; i < N; i++)
	{
		int a;
		cin >> a;
		A.push_back(a);
	}
	sort(A.begin(), A.end());
	vector<pll> vp;
	ll prev = 0, c = 1;
	for(int i = 0; i < A.size(); i++)
	{
		if(A[i] == prev) {
			c++;
		}else{
			vp.push_back(
				make_pair(prev, c)
			);
			c = 1;
		}
		if(i == A.size() - 1) {
			vp.push_back(
				make_pair(A[i], c)
			);
		}
		prev = A[i];
	}
	sort(vp.rbegin(), vp.rend());
	ll ctr = 0, ans = 1;
	for(auto p: vp) {
		if(p.second >= 4 && ctr == 0){
			cout << p.first * p.first << endl;
			return 0;
		}
		if(p.second >= 2) {
			ctr++;
			ans *= p.first;
		}
		if(ctr == 2) {
			cout << ans << endl;
			return 0;
		}
	}
	cout << 0 << endl;
}

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

using namespace std;

#define FOR(x,n) for(int i = x; i < n; i++)
#define FORJ(x,n) for(int j=x; j < n; j++)
#define FORE(x,n) for(int i=x; i<=n; i++)
#define FORJE(x,n) for(int j=x; j <= n; j++)
#define ll long long
#define MOD 1000000007
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"

int main() {
	FAST_IO

	string S,T;
	cin>>S>>T;

	int ans = T.size();

	int i=0;
	int cnt=0;

	for(int start = 0; start<=S.size()-T.size(); start++) {
		int diff = 0;
		for(int i=0;i<T.size();i++) {
			if(T[i]!=S[start+i]) {
				diff++;
			}
		}

		ans = min(ans,diff);
	}

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


Measured memory_bytes: 3568
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

#include <set>
#include <map>
#include <iomanip>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define all(x) (x).begin(),(x).end()
#define ll long long

int main()
{
	int r, d;
	const int n = 10;
	vector<int> x(n + 1);

	cin >> r >> d >> x[0];

	rep(i, n)
	{
		x[i + 1] = r * x[i] - d;

		cout << x[i + 1] << endl;
	}

	return 0;
}

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

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
	int n;
	cin >> n;
	ll pre = 0, ans = 0;
	for(int i = 0; i < n; i++){
		ll a;
		cin >> a;
		if(a < pre){
			ans += pre-a;
			a = pre;
		}
		pre = a;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 3624