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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    int n; cin >> n;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    ll x = 0;
    for (int i = 0; i < n; i++) x ^= a[i];
    for (int i = 0; i < n; i++) {
        cout << (a[i] ^ x) << " \n"[i == n - 1];
    }
    return 0;
}


Measured memory_bytes: 4748
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define INF 1e16
typedef pair<int,int> P;
typedef long long ll;

int main(void){
    int a,b,t,ans=0;;
    cin>>a>>b>>t;
    ll num=0;
    ll i=1;
    while(true){
        num=a*i;
        if(num>t)break;
        ans+=b;
        i++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){
    for (auto &e : t) fill(e, v);
}
// auto v = make_vec<int>(h, w);
// fill(v, 0);
const int INF = 1LL << 60;

signed main(){

  int H, W; cin >> H >> W;
  auto S = make_vec<char>(H+1, W+1);
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cin >> S[i][j];
    }
  }

  auto dp = make_vec<int>(H+1, W+1);
  fill(dp, INF);
  dp[0][0] = 0;
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      dp[i+1][j] = min(dp[i+1][j], dp[i][j] + (S[i+1][j] != S[i][j]));
      dp[i][j+1] = min(dp[i][j+1], dp[i][j] + (S[i][j+1] != S[i][j]));
    }
  }
  int ans = dp[H-1][W-1];
  if(S[0][0] == '#') ans++;
  cout << (ans + 1) / 2 << endl;

  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f(i,a,b) for(ll i=(a);i<(b);i++)
#define frr(i,a,b) for(ll i=(a-1);i>=(b);i--)
#define vi vector<int>
#define de deque<int>
#define del deque<ll>
#define vl vector<ll>
#define pb push_back
#define ppb pop_back()
#define pf push_front
#define ppf pop_front()
#define mpp map<ll,ll>
#define rev(a) reverse(a.begin(),a.end())
#define srt(a) sort(a.begin(),a.end())
#define ln(a) a.length()
#define sz(a) a.size()
#define endl "\n"
int M=1000000007;
int n;int h[100005];int dp[100005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

cin>>n;
f(i,0,n)cin>>h[i];
dp[0]=0;dp[1]=abs(h[1]-h[0]);
f(i,2,n)
    {dp[i]=min(abs(h[i]-h[i-1])+dp[i-1],abs(h[i]-h[i-2])+dp[i-2]);}
cout<<dp[n-1]<<endl;

}


Measured memory_bytes: 1024
users, data, userlist = Array.new(101){[]}, [], {}
arr = []
gets.to_i.times{
    u, ope, d = gets.chomp.split
    u = u.to_i
    d = d.to_i
    userlist[u] = true
    case ope
    when "lock" then data[d] = u
    when "wait" then arr << [u, d]
    end
}
arr.each{|u, d| users[u] << data[d]}

deadlock = false
userlist.keys.each{|u|
    list = users[u].dup
    list2 = users[u].dup
    while true
        list3 = []
        list2.each{|u2|
            users[u2].each{|u3|
                if u3 == u
                    deadlock = true
                    break
                end
                unless list.include? u3
                    list << u3
                    list3 << u3
                end
            }
            break if deadlock
        }
        break if deadlock
        break if list3.empty?
        list2 = list3
    end
    break if deadlock
}
puts deadlock ? 1 : 0


Measured memory_bytes: 8876
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
 
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define speed() cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
// #define exit(a, b) return cout << a, b;
 
// debugger
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#define debug(stuff) cout << #stuff << ": " << stuff <<endl
#define debugc(stuff) cout << #stuff << ": "; for(auto x: stuff) cout << x << " "; cout << endl;
// 
 
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define all(v) v.begin(), v.end() 
 
#define print(stuff) cout << stuff << endl
#define printc(stuff) for(auto x: stuff) cout << x << " "; cout << endl;
#define printPrec(stuff) cout << fixed << setprecision(15) << stuff << endl;
#define len length
#define ret0 return 0
#define ret return 
 
 
#define ll long long
#define ld long double
#define fi first
#define endl '\n'
#define se second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define fill(ar, x) memset(ar, x, sizeof ar)
 
#define vl vector<ll> 
#define sl set<ll>
#define pll pair<ll, ll>
#define mll map<ll, ll> 
#define pq priority_queue<ll>
 
// typedef tree<ll,null_type,less<ll>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
 
#define inf (long long int) 1e18
#define eps 0.000001
#define mod 1000000007
#define mod1 998244353
#define MAXN (ll)2e5+5
#define N (1ll<<10)

void solve(){
    ll x, y, z;
    cin>>x>>y>>z;
    cout<<z<<" "<<x<<" "<<y<<endl;
}
 
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
 
 
    ll t = 1;
    // cin>>t;
    while(t--){
        solve();
    }
 
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;


int main(){

	int H,W;
	while(true)
	{
		cin >> H >> W;

		if(H+W == 0) break;

		for(int i=0;i<H;i++)
		{
			for(int k=0;k<W;k++)
			{
				cout << "#";
			}
			cout << "\n";
		}
		cout << "\n";

	}
	return 0;
}




Measured memory_bytes: 3032
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   ff   first
#define   ss   second
#define   pii  pair<int,int>
using namespace std;


int n=100000000;
bool  p[100000001];
void  seive(){
    for (int i=4;i<=n;i+=2) p[i]=true;
    for (int i=3;i*i <= n;i += 2){
        if (p[i] == false)
        for (int j=i*i;j<=n;j+= i*2)
                p[j] = true;
    }
}

inline void solve(){
    seive();
    int n; cin>>n; 
    for (int i=n;i;i++){
      if (p[i]==false){
        cout << i << endl;
        return;
      }
    }
}

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


Measured memory_bytes: 101292
#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

string s[3];

void dfs(int cur){
    if(s[cur].size()==0){
        cout1((char)('A'+cur))
        exit(0);
    }
    int nxt=s[cur].back()-'a';
    s[cur].pop_back();
    dfs(nxt);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    
    rep(i,3) cin>>s[i];
    rep(i,3) reverse(all(s[i]));
    dfs(0);
}

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

using namespace std;

typedef unsigned long long ull;
#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define all(a) (a).begin(), (a).end()

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

int main(){
	int a, b;
	vector<pair<int, int> > v;
	while(true){
		scanf("%d,%d", &a, &b);
		if(a == 0 && b == 0) break;
		v.push_back(make_pair(b, a));
	}
	sort(all(v), greater<pair<int, int> >() );
	vector<int> rank(v.size());

	int r = 1;
	rank[0] = r;
	for(int i=1; i< v.size(); i++){
		if(v[i].first != v[i-1].first) r++;
		rank[i] = r;
	}

	int n;
	while(cin >> n){
		for(int i=0; i < v.size(); i++) if(n == v[i].second){cout << rank[i] << endl; break;}
	}
}

Measured memory_bytes: 1252
if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
        
    n = -1
    flash = 0
    for i in range(N):
        flash = a[flash] - 1
        if(flash == 1):
            n = i + 1
            break
    
    print(n)

Measured memory_bytes: 7084
n,m=gets.split.map(&:to_i)
stores=n.times.map{gets.split.map(&:to_i)}
stores.sort_by!(&:first)
ans=0
stores.each{|a,b|
  if m>b
    ans+=a*b
    m-=b
  elsif m==b
    ans+=a*b
    break
  else
    ans+=a*m
    break
  end
}

puts ans

Measured memory_bytes: 12664
#pragma GCC optimize("Ofast,fast-math,unroll-loops")
 
#include <bits/stdc++.h>
 
#define int ll
//#define double long double
#define endl '\n'
#define all(C) (C).begin(), (C).end()
#define rall(C) (C).rbegin(), (C).rend()
#define mp make_pair 
#define pb emplace_back
#define dbg(x) cerr << #x << " : " << x << endl
#define PI 3.1415926535
 
using namespace std;
        
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair <int, int>;
using pld = pair <ld, ld>;

/*
const ll MAX_MEM = 3e6;
char MEM[MAX_MEM];
ll MEM_POS = 0;
void* operator new(size_t x)
{
    auto ret = MEM + MEM_POS;
    MEM_POS += x;
    assert(MEM_POS < MAX_MEM);
    return ret;
}
void operator delete(void*)
{}
*/
        
template <class T>
istream& operator>> (istream &in, vector <T> &a)
{
    for (auto &i : a)
        in >> i;
    return in;
}
        
template <class T> 
ostream& operator<< (ostream &out, vector <T> a)
{
    for (auto &i : a)
        out << i << ' ';
    return out;
}
        
template <class T, class U>
istream& operator>> (istream &in, pair <T, U> &p)
{
    in >> p.first >> p.second;
    return in;
}
        
template <class T, class U>
ostream& operator<< (ostream &out, pair <T, U> p)
{
    out << p.first << " " << p.second << " ";
    return out;
}
        
inline void Start()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    //freopen("lol.in", "r", stdin);
    //freopen("lol.out", "w", stdout);
}

signed main()
{
    Start();
    int n, m;
    cin >> n >> m;
    vector <int> a(n);
    cin >> a;
    int sum = 0;
    for (auto i : a)
        sum += i;
    int ans = 0;
    for (auto i : a)
    {
        if (i * 4 * m >= sum)
            ++ans;
    }
    if (ans < m)
        cout << "No";
    else
        cout << "Yes";
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
using namespace __gnu_pbds;  
using namespace std;

typedef tree<long long, null_type, less<long long>, rb_tree_tag, 
             tree_order_statistics_node_update> 
    new_data_set; 
    
//defines
typedef long long ll;
typedef long double ld;

ll a,b,c,n,m,k;

ll t=1;

void solve()
{
    cin>>n>>m>>k;
    a=(n/k)+((n%k)==0?0:1LL);
    cout<<((a<=m)?"Yes":"No");
 if(t>0)cout<<"\n";
}

int32_t main()
{
#ifdef ONPC
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  //cin>>t;
    while(t--)
    {
        solve();
    }
  //cout<<sum;
        
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
using namespace std;

/*int par[100000];

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

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

int min(int a, int b){
    if(a > b) return b;
    else return a;
}

void unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x == y) return;

    par[x] = y;
}*/

int main(){
	int W,H,C;
	cin>>W>>H>>C;
	int gcd=0;
	for(int i=1;i<min(W,H)+1;i++){
		if(W%i==0 && H%i==0){
		gcd=max(gcd,i);
	}
	}
	cout<<(W/gcd)*(H/gcd)*C<<endl;
	/*int E,Y;
	cin>>E>>Y;
	if(E==0){
		int y=Y-1867;
		if(y<=44){
			cout<<'M'<<y<<endl;
		}
		if(y-44>0 && y-44<=14){
			cout<<'T'<<y-44<<endl;
		}
		if(y-58>0 && y-58<=63){
			cout<<'S'<<y-58<<endl;
		}
		if(y-121>0){
			cout<<'H'<<y-121<<endl;
		}
	}
		if(E==1){
			cout<<Y+1867<<endl;
		}
		if(E==2){
			cout<<Y+1911<<endl;
		}
		if(E==3){
			cout<<Y+1925<<endl;
		}
		if(E==4){
			cout<<Y+1988<<endl;
		}*/
	/*int H,R;
	cin>>H>>R;
	if(H>-R){
		cout<<1<<endl;
	}
	if(H==-R){
		cout<<0<<endl;
	}
	if(H<-R){
		cout<<-1<<endl;
	}*/

	/*
int W;
cin>>W;
cout<<W*32<<endl;*/

    return 0;
}


Measured memory_bytes: 3112
def solve():
    N = int(input())
    p = [int(i) for i in input().split()]
    p_sort = sorted(p)
    count = 0
    for i in range(N):
        if p[i] != p_sort[i]:
            count += 1
        if count >= 3:
            break
    if count in [0, 2]:
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    solve()


Measured memory_bytes: 3060
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] lreads(T = long)(long n){return generate(()=>readln.chomp.to!T()).take(n).array();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long N, K;
    scan(N, K);
    long R, S, P;
    scan(R, S, P);
    auto T = sread();

    auto dp = new long[][](3, N);

    long pts(long x, long y)
    {
        if (x == 0)
            return T[y] == 's' ? R : 0;
        if (x == 1)
            return T[y] == 'p' ? S : 0;
        if (x == 2)
            return T[y] == 'r' ? P : 0;
        return long.min;
    }

    foreach (i; 0 .. N)
    {
        if (i < K)
        {
            dp[0][i] = pts(0, i);
            dp[1][i] = pts(1, i);
            dp[2][i] = pts(2, i);
        }
        else
        {
            dp[0][i] = max(dp[1][i - K], dp[2][i - K]) + pts(0, i);
            dp[1][i] = max(dp[0][i - K], dp[2][i - K]) + pts(1, i);
            dp[2][i] = max(dp[0][i - K], dp[1][i - K]) + pts(2, i);
        }
    }
    long ans;
    foreach (i; N - K .. N)
    {
        ans += max(dp[0][i], dp[1][i], dp[2][i]);
    }
    writeln(ans);
}


Measured memory_bytes: 4476
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
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; }



int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  int ans = 0;
  if (s[0] == 'S' && s[1] == 'S' && s[2] == 'S') ans = 0;
  if (s[0] == 'S' && s[1] == 'S' && s[2] == 'R') ans = 1;
  if (s[0] == 'S' && s[1] == 'R' && s[2] == 'S') ans = 1;
  if (s[0] == 'S' && s[1] == 'R' && s[2] == 'R') ans = 2;
  if (s[0] == 'R' && s[1] == 'S' && s[2] == 'S') ans = 1;
  if (s[0] == 'R' && s[1] == 'S' && s[2] == 'R') ans = 1;
  if (s[0] == 'R' && s[1] == 'R' && s[2] == 'S') ans = 2;
  if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') ans = 3;
  cout << ans << endl;
  return 0;
}

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

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

const int N=100;

int n;
int p[N];
int DP[N+3][N+3][N*5+3];//[店][500円玉枚数][使った1000円札枚数] = 小銭 の最大化

void init_dp(){
    REP(i,N+3){
        REP(j,N+3){
            REP(k,N*5+3){
                DP[i][j][k] = -1;
            }
        }
    }
}

void print_dp(int n){
    REP(i,n){
        REP(j,n){
            REP(k,n*5+3){
                if(DP[i][j][k]!=-1){
                    cout<<"i:"<<i<<" j:"<<j<<" k:"<<k<<" dp:"<<DP[i][j][k]<<endl;
                }
            }
        }
    }
}

int main(){
    while(true){
        cin>>n;
        if(n==0){
            break;
        }
        REP(i,n){
            cin>>p[i];
        }

        init_dp();

        int pr=p[0];

        int maxgo=0;//500円玉の最大枚数

        DP[0][0][0] = 0;

        //店1以降
        for(int i=0;i<n;++i){
            pr=p[i];
            REP(j,N+1){//500円玉の数
                REP(k,N*5+3){//1000円札の枚数
                    int now = DP[i][j][k];
                    if( now != -1){
                        //買う場合
                        //1〜500円
                        if((pr-1)%1000 <500){
                            DP[i+1][j+1][k + (pr-1)/1000 +1] = max(now + ((pr-1)/1000 +1)*1000 - pr - 500, DP[i+1][j+1][k + (pr-1)/1000 +1]);
                            maxgo=max(maxgo,j+1);
                        }
                        //0円, 501〜999円
                        //残金込で500円が作れる場合
                        else if( 1000*((pr-1)/1000 + 1) - pr + now >= 500 ){
                            if(pr%1000==0){
                               DP[i+1][j+1][k + pr/1000] = max(now - 500, DP[i+1][j+1][k + pr/1000]);
                            } else {
                               DP[i+1][j+1][k + pr/1000 +1] = max(now -( (pr%1000) - 500 ), DP[i+1][j+1][k + pr/1000 +1]);
                            }
                            maxgo=max(maxgo,j+1);
                        }
                        //500円が作れない場合
                        else {
                            DP[i+1][j][k + (pr-1)/1000 + 1] = max(now + ((pr-1)/1000 +1)*1000 - pr, DP[i+1][j][k + (pr-1)/1000 + 1]);
                        }

                        //買わない場合
                        DP[i+1][j][k] = max(now, DP[i+1][j][k]); 
                    }
                }
            }
        }
        //print_dp(n+1);
        int used = 5*N*1000;
        REP(k, N*5+3){
            if(DP[n][maxgo][k] != -1){
                used = min(used, k*1000 - DP[n][maxgo][k] - 500*maxgo);
            }
        }
        cout<<maxgo<<" "<<used<<endl;
    }
    return 0;
}


Measured memory_bytes: 23936
#include<bits/stdc++.h>
using namespace std;
#define inf          0x3f3f3f3f
#define go(a,b,c)    for(int a=b;a<=c;a++)
#define gov(a,b)     for(int a=0;a<b.size();a++)
#define rgo(a,b,c)   for(int a=b;a>=c;a--)
#define sf(a)        scanf("%d",&a)
#define sff(a,b)     scanf("%d%d",&a,&b)
#define sfff(a,b,c)  scanf("%d%d%d",&a,&b,&c)
#define eps          1e-9
#define ft           first
#define sd           second
#define prt(a)       printf("%d\n",a)
#define prn(i,n,a)   printf("%d%c",a,i==n?'\n':' ')
#define pb           push_back
typedef long long LL;
typedef pair<int,int> pii;
typedef set<int> si;
typedef vector<int> vi;
typedef map<int,int> mii;
typedef double db;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
const int maxn=1e5+10;
const LL mod=1e9+7;
int read()
{
	int f=0,x=0;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch<='9'&&ch>='0'){x=x*10+ch-'0';ch=getchar();}
	return f*x;
}
//=======================================================
int n,l,t;
LL x[maxn],cl[maxn],ans[maxn];
vector<LL> pos,c,rc;
void ini()
{
	memset(ans,0,sizeof(ans));
	pos.clear();
	c.clear();
	rc.clear();
}
void work()
{
	ini();
	go(i,1,n)
	{
		sff(x[i],cl[i]);
		if(cl[i]==1)pos.pb((x[i]+t)%l),c.pb(i);
		else pos.pb((x[i]-t%l+l)%l),rc.pb(i);
	}
	sort(pos.begin(),pos.end());
	LL tp,ps;
	if(cl[1]==1)
	{
		tp=2*(int)rc.size()*(t/l)+1;
		//tp=(tp-1)%n+1;
		LL tm=t%l;
		gov(i,rc)
		{
			if((x[rc[i]]-x[1])<2*tm)tp++;
			if((x[rc[i]]-x[1]+l)<2*tm)tp++;
		}
		
		tp=(tp-1)%n+1;
		//prt(tp);
		ps=(x[1]+t)%l;
	}
	else
	{
		tp=2*(int)c.size()*(t/l);
		//tp=(tp-1)%n+1;
		LL tm=t%l;
		gov(i,c)
		{
			if((l-x[c[i]]+x[1])<=2*tm)tp++;
			if((l-x[c[i]]+x[1]+l)<=2*tm)tp++;
		}
		tp=(n-tp%n)%n+1;
		//prt(tp);
		ps=(x[1]-t%l+l)%l;
		//prt(ps);
	}
	int tt=lower_bound(pos.begin(),pos.end(),ps)-pos.begin();
	go(i,tt,n-1)
	{
		ans[tp]=pos[i];
		tp++;
		if(tp>n)tp=1;
	}
	go(i,0,tt)
	{
		ans[tp]=pos[i];
		tp++;
		if(tp>n)tp=1;
	}
	go(i,1,n)printf("%I64d\n",ans[i]);
}
int main()
{
	while(~sfff(n,l,t))
	{
		work();
	}
	return 0;
}

Measured memory_bytes: 10988
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1111111111;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "" : " ");
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif


int main() {

    string N;
    cin >> N;
    
    bool flag = false;
    for(const auto &c: N) if(c == '7') flag = true;
    
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 3620
#include <stdio.h>

int main(void)
{
	int a ,b ,c ,X ,Y ,Z ,P;
	scanf("%d%d%d" ,&a ,&b ,&c);
	if(a >= b);
	else {
	X = a;
	a = b;
	b = X;}
	if(b >= c);
	else {
		Y = b;
		b = c;
		c = Y;}
		if(a >= c);
		else {
			Z = a;
			a = c;
			c = Z;}
			if(a >= b);
			else {
				P = a;
				a = b;
				b = P;}
			printf("%d %d %d\n" ,c ,b ,a);
	return 0;
}


Measured memory_bytes: 2756
import queue
n,m = map(int,input().split())

data =[0]
access = [False]*(n+1)
dis = [0]+[" "]*(n)
q = queue.Queue()
for i in range(n):
    data.append([])

for i in range(m):
    l,r,d = map(int,input().split())

    data[l].append((r,d))
    data[r].append((l,-d))

for i in range(1,n+1):
    data[i].sort(reverse=True)

for i in range(1,n+1):
    if data[i]!=[] and not access[i]: 
        q.put(i)
        access[i] = True
        dis[i] = 0
        while not q.empty():
            l = q.get()

            while data[l]:
                r,d = data[l].pop()
                data[r].remove((l,-d))
                if access[r]:
                    if dis[r] ==dis[l]+d:
                        continue
                    else:
                        print("No")
                        exit(0)
                else:
                    access[r] = True
                    dis[r] = dis[l]+d
                    q.put(r)
print("Yes")


Measured memory_bytes: 64608
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define each(i, c) for (auto& (i) : (c))

using namespace std;
typedef long long int ll;
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }

int main() {
    ll x;
    cin >> x;
    ll sum = 0;
    ll i = 0;
    while (sum < x) {
        sum += ++i;
    }
    cout << i << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <cstdio>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define db(x) cerr << #x << " = " << x << endl;

typedef long long   ll;
typedef long double ld;

const ll   MOD       = 1000000007;
const ll   INF       = 1000000007;
const ll   N         = 1000002;
const ll   logN      = 20;
const ld   PI        = acos(-1);
const ll   HashPrime = 31;

inline void No() {
    cout << "NO\n";
}
inline void Yes() {
    cout << "YES\n";
}

#define fi first
#define se second

int n, y;


void solve() {
  cin >> n >> y;
  if (y%1000 != 0) {
    cout << "-1 -1 -1\n";
    return;
  }
  y /= 1000;
  if (y < n) {
    cout << "-1 -1 -1\n";
    return;
  }
  for (int a = 0; a <= n; ++a) {
    for (int b = 0; b <= n-a; ++b) {
      int c = n-a-b;
      if (a*10+5*b+c == y) {
        cout << a << " " << b << " " << c << endl;
        return;
      }
    }
  }
  cout << "-1 -1 -1\n";
}

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


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().strip().split()))
count = 0
for i in range(n):
    for j in range(n - 1, i, -1):
        if a[j] < a[j - 1]:
            count += 1
            a[j], a[j - 1] = a[j - 1], a[j]
print(' '.join(map(str, a)))
print(count)

Measured memory_bytes: 6724
using System;
using System.IO;
using System.Text;
using static Scanner;

class Program
{
    static void Main(string[] args) {
        var writer = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(writer);
        Solve();
        Console.Out.Flush();
    }
    static void Solve() {
        int N = ScanInt(), M = ScanInt(), X = ScanInt();
        Span<int> C = stackalloc int[N];
        var A = new int[N, M];
        for (int i = 0; i < N; i++) {
            C[i] = ScanInt();
            for (int j = 0; j < M; j++) {
                A[i, j] = ScanInt();
            }
        }
        var answer = int.MaxValue;
        Span<int> levels = stackalloc int[M];
        for (int bit = 0; bit < 1 << N; bit++) {
            levels.Clear();
            var cost = 0;
            for (int i = 0; i < N; i++) {
                if (((bit >> i) & 1) == 0) continue;
                cost += C[i];
                if (cost > answer) break;
                for (int j = 0; j < M; j++) {
                    levels[j] += A[i, j];
                }
            }
            if (cost > answer) continue;
            var isAchieved = true;
            for (int j = 0; j < M; j++)
            {
                if (levels[j] >= X) continue;
                isAchieved = false;
                break;
            }
            if (isAchieved) answer = cost;
        }
        Console.WriteLine(answer == int.MaxValue ? -1 : answer);
    }
}

public static class Scanner
{
    static readonly Stream stdin = Console.OpenStandardInput();
    static readonly byte[] buffer = new byte[1024];
    static int length, p;
    static bool isEof;
    private static byte StdIn() {
        if (isEof) return 0;
        if (p < length) return buffer[p++];
        p = 0;
        if ((length = stdin.Read(buffer, 0, 1024)) > 0) return buffer[p++];
        isEof = true;
        return 0;
    }
    public static char GetChar() {
        var by = StdIn();
        while ((by < '!' || '~' < by) && !isEof) by = StdIn();
        return (char) by;
    }
    public static int ScanInt() {
        var temp = 0;
        for (var ch = GetChar(); '0' <= ch && ch <= '9'; ch = (char) StdIn()) {
            temp = temp * 10 + ch - '0';
        }
        return temp;
    }
}

Measured memory_bytes: 25844
class RadixHeap:
    __slots__ = ["data", "last", "siz", "used"]

    # (max_key - min_key) <= C
    def __init__(self, N, C):
        self.data = [[] for i in range(C.bit_length() + 1)]
        self.last = self.siz = 0
        self.used = [0]*N

    def push(self, x, key):
        #assert self.last <= x
        self.siz += 1
        self.data[(x ^ self.last).bit_length()].append((x, key))

    def pop(self):
        data = self.data
        used = self.used
        #assert self.siz > 0
        if not data[0]:
            i = 1
            while not data[i]:
                i += 1
            d = data[i]
            new_last, new_key = min(d)
            used[new_key] = 1
            for val in d:
                x, key = val
                if used[key]:
                    self.siz -= 1
                    continue
                data[(x ^ new_last).bit_length()].append(val)
            self.last = new_last
            data[i] = []
        else:
            new_last, new_key = data[0].pop()
            used[new_key] = 1
            self.siz -= 1
        return new_last, new_key

    def __len__(self):
        return self.siz

import sys
readline = sys.stdin.readline
write = sys.stdout.write


N = int(readline())
G = [None] * N
for i in range(N):
    u, k, *V = map(int, readline().split())
    G[i] = [(v, c) for v, c in zip(V[::2], V[1::2])]

def dijkstra(N, G, s):
    que = RadixHeap(N, 10**9 + 1)

    dist = [10**18]*N
    dist[s] = 0
    que.push(0, s)
    while que:
        cost, v = que.pop()
        if dist[v] < cost:
            continue
        for w, c in G[v]:
            if cost + c < dist[w]:
                dist[w] = r = cost + c
                que.push(r, w)
    return dist
dist = dijkstra(N, G, 0)
write("\n".join("%d %d" % (i, d) for i, d in enumerate(dist)))
write("\n")


Measured memory_bytes: 68508
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pii std::pair<int,int>
#define pli std::pair<ll,int>
#define pil std::pair<int,ll>
#define psi std::pair<string,int>
#define pll std::pair<ll,ll>
#define pci std::pair<char,int>
#define sll(x) scanf("%lld",&x)
#define prll(x) printf("%lld ",x)
#define pri(x) printf("%d ",x)
#define si(x) scanf("%d",&x)
#define pb push_back
#define vll std::vector<ll>
#define vpi std::vector<std::pair<int,int>>
#define vi std::vector<int>
#define vvi std::vector<std::vector<int>>
#define vvpil std::vector<std::vector<std::pair<int,ll>>>
#define vlpii std::vector<std::list<pii>>
#define vlpil std::vector<std::list<pil>>
#define li std::list<int>
#define lpil std::list<pil>
#define Endl printf("\n")
#define vli vector<list<int>>
#define vvll vector<vector<ll>>
#define mp make_pair
#define x first
#define y second
#define ull uint64_t
#define ma 100000000
#define imie(...) "[" << #__VA_ARGS__": " << (__VA_ARGS__) << "] "
const ll  INF=10000000000000;
const ll mod =  1e9 + 7;
using namespace std;
void computeLPSArray(string pat, int M, int* lps); 
void add(ll& a , ll b){
	a += b;
	if(a >= mod) a -= mod;
}
ll mul(ll a , ll b){
	return (a * b) % mod;
}
ll Pow(ll a , ll b){
	if(b == 0) return 1 ;
	ll c = Pow(a , b / 2) ;
	if(b % 2) return (a * ((c * c)% mod )) % mod ;
	return (c * c) % mod ;
}
vector<int> KMPSearch(string pat, string txt) 
{ 
	int M = pat.length(); 
	int N = txt.length(); 
	vector<int> ans ;
	// create lps[] that will hold the longest prefix suffix 
	// values for pattern 
	int lps[M]; 

	// Preprocess the pattern (calculate lps[] array) 
	computeLPSArray(pat, M, lps); 

	int i = 0; // index for txt[] 
	int j = 0; // index for pat[] 
	while (i < N) { 
		if (pat[j] == txt[i]) { 
			j++; 
			i++; 
		} 

		if (j == M) { 
			ans.push_back(i - j) ;
			j = lps[j - 1]; 
		} 

		// mismatch after j matches 
		else if (i < N && pat[j] != txt[i]) { 
			// Do not match lps[0..lps[j-1]] characters, 
			// they will match anyway 
			if (j != 0) 
				j = lps[j - 1]; 
			else
				i = i + 1; 
		} 
	} 
	return ans ;
} 

// Fills lps[] for given patttern pat[0..M-1] 
void computeLPSArray(string pat, int M, int* lps) 
{ 
	// length of the previous longest prefix suffix 
	int len = 0; 

	lps[0] = 0; // lps[0] is always 0 

	// the loop calculates lps[i] for i = 1 to M-1 
	int i = 1; 
	while (i < M) { 
		if (pat[i] == pat[len]) { 
			len++; 
			lps[i] = len; 
			i++; 
		} 
		else // (pat[i] != pat[len]) 
		{ 
			// This is tricky. Consider the example. 
			// AAACAAAA and i = 7. The idea is similar 
			// to search step. 
			if (len != 0) { 
				len = lps[len - 1]; 

				// Also, note that we do not increment 
				// i here 
			} 
			else // if (len == 0) 
			{ 
				lps[i] = 0; 
				i++; 
			} 
		} 
	} 
} 
//check modulo
int main(){
	IOS;
	cout.precision(30) ;
	int a , b; cin >> a >> b ;
	if(b == 1) return cout << 0 << endl , 0 ;
	ll x = a ;
	ll nb = 1 ;
	while( x < b){
		x-- ;
		x += a ;
		nb++ ;
	}
	cout << nb << endl ;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ll long long
#define endl "\n"
#define vi vector<int>
#define vl vector<ll>
#define all(v) (v).begin(),(v).end()
#define mst(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define mt make_tuple
#define eb emplace_back
using namespace std;
void solve(){
    int n,k;
    cin>>n>>k;
    int a[n]={0};
    for(int i=0;i<k;i++){
        int d;
        cin>>d;
        for(int j=0;j<d;j++){
            int e;
            cin>>e;
            a[e-1]++;
        }
    }
    int ans=0;
    for(int i=0;i<n;i++)
        if(a[i]==0) ans++;
    cout<<ans<<endl;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll t,p;
    t=1;
    //cin>>t;
    for(p=1;p<=t;p++){
        solve();
    }
    return 0;
}


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

namespace jugyo1024
{
    class Program
    {
           static void Main(string[] args)
        {
            var _ = Console.ReadLine();
            var arr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).OrderBy(x => x).ToArray();

            int cnt = 0;
            for (int i = 0; i < arr.Length; i++)
                for (int j = i + 1; j < arr.Length; j++)
                {
                    int c = arr[i] + arr[j];
                    int n = LowerBound(arr, j + 1, arr.Length, c) - j - 1;
                    if (n > 0)
                        cnt += n;
                }
            Console.WriteLine(cnt);
        }

        static int LowerBound(int[] arr, int start, int end, int value)
        {
            int low = start;
            int high = end;
            int mid;
            while (low < high)
            {
                mid = ((high - low) >> 1) + low;
                if (arr[mid] < value)
                    low = mid + 1;
                else
                    high = mid;
            }
            return low;
        }
    }
}


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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

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

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main(){
	int h,w;cin>>h>>w;
	vector<string>c(2*h);
	rep(i,2*h){
		if(i%2==0){
			cin>>c[i];
			cout<<c[i]<<endl;
		}
		else{
			c[i]=c[i-1];
			cout<<c[i]<<endl;
		}
	}
}

Measured memory_bytes: 384
// agrawal117
//chahatagrawal117
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long int ll;
const  ll mod=1000000007;
const int MAX=1000000+9;
vector<pair<ll,ll>> v;
ll dp[100006];
ll rec(ll i)
{
    if(i>=v.size()){
        return 0;
    }
    if(dp[i]!=-1) return dp[i];
    pair<ll,ll> p;
    p.first=v[i].second;
    p.second=INT_MIN;
    ll j=lower_bound(v.begin(),v.end(),p)-v.begin();
    ll a=1+rec(j);
    ll b=rec(i+1);
    dp[i]=max(a,b);
    return max(a,b);
}
int main()
{
   ll n;
   cin>>n;
   
   for(int i=1;i<=n;i++){
       ll a,b;
       cin>>a>>b;
       v.push_back({a-b,a+b});
   }
   sort(v.begin(),v.end());
   for(int i=0;i<100006;i++) dp[i]=-1;
  ll ans=rec(0LL);
  cout<<ans<<endl;
}

Measured memory_bytes: 5872
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# 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;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void setIO(string s = "") {
	// cin.exceptions(cin.failbit); 
	// throws exception when do smth illegal
	// ex. try to read letter into int
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9; 
const int N = 6e5+5;                                         
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
 
int rnd (int l, int r) {
	return uniform_int_distribution<int> (l, r)(gen);
}

int main () {
	SpeedForce;
	
	int n;
	cin >> n;
	while(n--) cout << "ACL";
	
	return Accepted;
}

// B...a


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

int main()
{
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> s(h);
    for (int i = 0; i < h; i++)
        cin >> s[i];
    int ans = 0;
    for (int is = 0; is < (1 << h); is++)
    {
        for (int js = 0; js < (1 << w); js++)
        {
            int cnt = 0;
            for (int i = 0; i < h; i++)
            {
                for (int j = 0; j < w; j++)
                {
                    if (is >> i & 1)
                        continue;
                    if (js >> j & 1)
                        continue;
                    if (s[i][j] == '#')
                        cnt++;
                }
            }
            if (cnt == k)
                ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
    long long a,b;
    string ans;
    cin>>a>>b;
    if(a*b<=0)ans="Zero";
    else if(0<a)ans="Positive";
    else if(b<0&&(b-a)%2==0)ans="Negative";
    else ans="Positive";
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
int main() {
    int N;
    std::cin >> N;
    std::vector<int> Sum1(N,0),Sum2(N,0);
    std::vector<int> A2(N,0);
    std::cin >> Sum1[0];
    for(int i=1;i<N;i++){
        int A;
        std::cin >> A;
        Sum1[i] = Sum1[i-1] + A;
    }

    for(int i=0;i<N;i++){
        int A;
        std::cin >> A2[i];
    }
    Sum2[N-1] = A2[N-1];
    for(int i=N-2;i>=0;i--){
        Sum2[i] = Sum2[i+1] + A2[i];
    }

    int Max = 0;
    for(int i=0;i<N;i++){
        if(Sum1[i] + Sum2[i] > Max){
            Max = Sum1[i] + Sum2[i];
        }
    }

    std::cout << Max;
}

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

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
const int INF = 1 << 27;
const ll LLINF = (ll)1 << 60;
const ll MOD = 1e9+7;

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};

int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  vector<vector<int>> dp(m, vector<int>(n));
  dp[0][0] = 1;
  char ch;
  for (int i = 0; i < m; i++) {
    scanf("\n");
    for (int j = 0; j < n; j++) {
      scanf("%c", &ch);
      if (i || j) {
        if (ch == '#') {
          dp[i][j] = 0;
        } else {
          dp[i][j] = ((i >= 1 ? dp[i-1][j] : 0) + (j >= 1 ? dp[i][j-1] : 0)) % MOD;
        }
      }
    }
  }

  printf("%d\n", dp[m-1][n-1]);
}


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

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v)
{
    int sz = v.size();
    for (int i = 0; i < sz; i++)
    {
        cout << v[i] << " \n"[i == sz - 1];
    }
}

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

    string s;
    while (cin >> s, s != "0")
    {
        int res = 0, n = s.length();
        for (int i = 0; i < n; i++)
            res += s[i] - '0';
        cout << res << endl;
    }
}



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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main() {
  int w , a , b ;
  cin >> w >> a >> b ;
  if(b<a) 
    swap(a,b) ;
  
  if(b<=a+w)
    cout << 0;
  else 
    cout << b-(a+w);


}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int x,n,temp;
	cin>>x>>n;
	unordered_set<int> s;
	for(int i=0;i<n;i++){
		cin>>temp;
		s.emplace(temp);
	}
	int l=x,r=x,ans;
	while(true){
		if(s.find(l)==s.end()){
			ans=l;
			break;
		}
		if(s.find(r)==s.end()){
			ans=r;
			break;
		}		
		l--;r++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3640
class DisjointSet:
    def __init__(self):
        self.rank = {}
        self.p = {}

    def makeSet(self, x):
        self.p[x] = x
        self.rank[x] = 0

    def same(self, x, y):
        return self.findSet(x) == self.findSet(y)

    def unite(self, x, y):
        self.link(self.findSet(x), self.findSet(y))

    def link(self, x, y):
        if(self.rank[x] > self.rank[y]):
            self.p[y] = x
        else:
            self.p[x] = y
            if(self.rank[x] == self.rank[y]):
                self.rank[y] += 1

    def findSet(self, x):
        if(x != self.p[x]):
            self.p[x] = self.findSet(self.p[x])
        return self.p[x]

from collections import Counter
N, K, L = map(int, input().split())

ds = DisjointSet()
ds2 = DisjointSet()
for i in range(N):
    ds.makeSet(i+1)
    ds2.makeSet(i+1)

for i in range(K):
    p, q = map(int, input().split())
    ds.unite(p, q)

for i in range(L):
    r, s = map(int, input().split())
    ds2.unite(r, s)

a = [(ds.findSet(i), ds2.findSet(i)) for i in range(1, N+1)]
c = Counter(a)

print(' '.join([str(c[i]) for i in a]))

Measured memory_bytes: 103840
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		//素因数分
		long ans = Long.MAX_VALUE/2;
		for(int i = 1;(long)i*i<=n;i++) {
			if(n%i==0) {
				long a = i;
				long b = n/i;
				long tmp = Math.max(a,b);
				ans = Math.min(ans, tmp);
			}
		}
		int res = 0;
		while(ans > 0) {
			ans /= 10;
			res ++;
		}
		System.out.println(res);
	}
}



Measured memory_bytes: 21844
N=int(input())
*A,=map(int, input().split())
M=10**3

P=[]
isp=[True]*M
for n in range(2,M):
    if isp[n]==False: continue
    P.append(n)
    for m in range(n*n, M, n):
        isp[m]=False

from collections import defaultdict
D=[defaultdict(int) for _ in range(N)]
for i in range(N):
    a=A[i]
    for p in P:
        while a>1:
            if a%p==0:
                D[i][p]+=1
                a//=p
            else:
                break
        else:
            break
    if a>1:
        D[i][a]+=1

d=defaultdict(int)
for i in range(N):
    for k,v in D[i].items():
        d[k] = max(d[k], v)

MOD = 10**9+7
class Mint:
    def __init__(self, value=0):
        self.value = value % MOD
        if self.value < 0: self.value += MOD

    @staticmethod
    def get_value(x): return x.value if isinstance(x, Mint) else x

    def inverse(self):
        a, b = self.value, MOD
        u, v = 1, 0
        while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
        if u < 0: u += MOD
        return u

    def __repr__(self): return str(self.value)
    def __eq__(self, other): return self.value == other.value
    def __neg__(self): return Mint(-self.value)
    def __hash__(self): return hash(self.value)
    def __bool__(self): return self.value != 0

    def __iadd__(self, other):
        self.value += Mint.get_value(other)
        if self.value >= MOD: self.value -= MOD
        return self
    def __add__(self, other):
        new_obj = Mint(self.value)
        new_obj += other
        return new_obj
    __radd__ = __add__

    def __isub__(self, other):
        self.value -= Mint.get_value(other)
        if self.value < 0: self.value += MOD
        return self
    def __sub__(self, other):
        new_obj = Mint(self.value)
        new_obj -= other
        return new_obj
    def __rsub__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj -= self
        return new_obj

    def __imul__(self, other):
        self.value = self.value * Mint.get_value(other) % MOD
        return self
    def __mul__(self, other):
        new_obj = Mint(self.value)
        new_obj *= other
        return new_obj
    __rmul__ = __mul__

    def __ifloordiv__(self, other):
        other = other if isinstance(other, Mint) else Mint(other)
        self *= other.inverse()
        return self
    def __floordiv__(self, other):
        new_obj = Mint(self.value)
        new_obj //= other
        return new_obj
    def __rfloordiv__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj //= self
        return new_obj

gcd=Mint(1)
for k,v in d.items():
    gcd *= pow(k,v,MOD)

print(sum([gcd//a for a in A]))


Measured memory_bytes: 57052