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

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const int MAXN = 200000;

int N, M;

struct Edge {
    int to;
    int weight;
    int next;
};

vector<Edge> edges(MAXN);
vector<int> head(MAXN, -1);
vector<int> matchingx(MAXN, -1);
vector<int> matchingy(MAXN, -1);
vector<bool> check(MAXN);
vector<int> dis(MAXN);
vector<bool> vis(MAXN, false);

int cnt = 1;

void addEdge(int from, int to, int weight) {
    edges[cnt].to = to;
    edges[cnt].weight = weight;
    edges[cnt].next = head[from];
    head[from] = cnt++;
}

bool dfs(int u) {
    for (int i = head[u]; i != -1; i = edges[i].next) {
        int v = edges[i].to;
        if (!check[v]) {
            check[v] = true;
            if (matchingy[v] == -1 || dfs(matchingy[v])) {
                matchingy[v] = u;
                matchingx[u] = v;
                return true;
            }
        }
    }
    return false;
}

int hungarian() {
    int ans = 0;
    fill(matchingx.begin(), matchingx.end(), -1);
    fill(matchingy.begin(), matchingy.end(), -1);
    for (int u = 1; u <= N; ++u) {
//        if (matchingx[u] == -1) {
        {
            fill(check.begin(), check.end(), false);
            if (dfs(u)) {
                ++ans;
            }
        }
    }
    return ans;
}

void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<>> que;
    fill(dis.begin(), dis.end(), INF);
    dis[s] = 0;
    que.push(P(0, s));
    while (!que.empty()) {
        P p = que.top();
        que.pop();
        int u = p.second;
        if (vis[u]) continue;
        vis[u] = true;
        for (int i = head[u]; i != -1; i = edges[i].next) {
            int v = edges[i].to;
            if (dis[v] > dis[u] + edges[i].weight && !vis[v]) {
                dis[v] = dis[u] + edges[i].weight;
                que.push(P(dis[v], v));
            }
        }
    }
}

int main() {
    cin >> N;
    double ans = 0.0;
    long double x;
    string u;
    for (int i = 0; i < N; ++i) {
        cin >> x >> u;
        if (u == "JPY") {
            ans += x;
        } else if (u == "BTC") {
            ans += x * 380000.0;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5760
#include<iostream>
#include<cmath>
using namespace std;
int main(){
    double x1,y1,x2,y2,x3,y3,x4,y4,d;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
        d=(x2-x1)*(x4-x3)+(y2-y1)*(y4-y3);
        if(abs(d)<1e-12)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}

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

int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int year,month,day,ans=0;
		cin>>year>>month>>day;
		while(1){
			if((year%3!=0 && month%2==0) && day>19) break;
			else if(day>20) break;
			else{
				ans++;
				day++;
			}
		}

		month++;
		while(1){
			if(month>10) break;
			else if(year%3==0 || month%2==1){
				ans+=20;
				month++;
			}else{
				ans+=19;
				month++;
			}
		}

		year++;
		while(1){
			if(year<=999 && year%3!=0){
				ans+=195;
				year++;
			}else if(year<=999 && year%3==0){
				ans+=200;
				year++;
			}else break;
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1160
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>

int main()
{
    int x,m;
    scanf("%d %d",&x,&m);
    if(x<10)
    {
        m=m+(100*(10-x));
    }
    printf("%d\n",m);



    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
  
using namespace std;
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
 
//Appropriately Changed
using edge=struct{int to,cost;};
using G=vector<vector<edge>>;
 
//Appropriately Changed
void add_edge(G &graph,int from,int to,int cost){ 
    graph[from].push_back({to,cost});
}
 
auto chuliu(const G &graph,int root){
    using W=int; const W inf=1<<28;
     
    const int n=graph.size();
    vector<int> cost(n,inf),pv(n,-1);
    rep(v,n) for(auto &e:graph[v]) if(chmin(cost[e.to],e.cost)) pv[e.to]=v;
 	
    int led=-1,unuse=-1;
    vector<int> comp(n),used(n,-1);
    iota(begin(comp),end(comp),0);

    rep(v,n){
        if(used[v]!= -1 or pv[v]==-1 or v==root) continue;
 
        int cur=used[v]=v;
        for(cur=pv[cur]; cur!=root && used[cur] == -1; cur=pv[cur]) used[cur]=v;
 
        if(used[cur]!=v) continue;
    	led=cur,comp[cur]=cur,v=n; 
    	for(int w=pv[cur]; w != cur; w=pv[w]) comp[w]=cur;
    }
 
    G ngraph(n),ret(n);
    using E=tuple<int,int,int>; map<E,E> dict;

    if(led==-1){
        rep(v,n) if(v!=root and pv[v]!=-1)add_edge(ret,pv[v],v,cost[v]);
        return ret;
    }

	rep(v,n) for(auto &e:graph[v]){
		int a=comp[v],b=comp[e.to],c=e.cost;
		if(comp[e.to]==led) c-=cost[e.to];
		if(a==b) continue;
		dict[E(a,b,c)]=E(v,e.to,e.cost);
		add_edge(ngraph,a,b,c);
	}
	
	auto ntree=chuliu(ngraph,comp[root]);

	rep(v,n) for(auto &e:ntree[v]){
		int a,b,c;
		tie(a,b,c)=dict[E(v,e.to,e.cost)];
		if(comp[b]==led) unuse=b;
		add_edge(ret,a,b,c);
	}

	rep(v,n) if(comp[v]==led and v!=unuse) add_edge(ret,pv[v],v,cost[v]);
    return ret;
}
 
int main(void){
    int v,e,r;
    cin >> v >> e >> r;
    G graph(v);
    rep(i,e){
        int a,b,w;
        cin >> a >> b >> w;
        add_edge(graph,a,b,w);
    }
 
    auto tree=chuliu(graph,r);
    int ans=0;
    rep(i,v) for(auto &e:tree[i]) ans+=e.cost;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5008
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int a, b, c; cin >> a >> b >> c;
  cout << (a == b and b == c ? "Yes" : "No") << '\n';
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = sc.nextInt();
 
    if(y%2!=0){
        System.out.println("No");
    }else if(y-x*2<=x*2 && y>=x*2){
//  }else if(y<=x*4 && y>=x*2){
    	System.out.println("Yes");
    }else{
        System.out.println("No");
    }
}
}


Measured memory_bytes: 35872
#include <bits/stdc++.h>
using namespace std;
#define fixed thgrerde
#define f(i,f, t)  for(int i = f; i <  t; i++)
#define fr(i,f, t) for(int i = f; i >= t; i--)

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

const int infint = INT_MAX;
const ll infll   = LLONG_MAX;
const int MAX = 1e5 + 10;
vector<PII> adj[MAX];
vector<int> zeroDeg;
int n,m;
bool vis[MAX];
int in[MAX];
int sz[MAX];
bool dfs(int v){
    vis[v] = true;
    // find position if available
    if(sz[v] == 1e9)
        for(auto i : adj[v]){
            if(sz[i.first] != 1e9){
                sz[v] = sz[i.first] - i.second;
                break;
            }
        }
    if(sz[v] == 1e9){
        sz[v] = 0;
    }
    for(auto i : adj[v]){
        if(vis[i.first]){
            if(sz[v] + i.second != sz[i.first]) return false;
        }else{
            sz[i.first] = sz[v] + i.second;
            if(!dfs(i.first)) return false;
        }
    }
    return true;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    memset(vis,false,sizeof(vis));
    memset(in,0,sizeof(in));
    fill((int*)sz, (int*) sz + MAX, 1e9);
    cin >> n >> m;
    for(int i = 0; i < m; i++){
        int l, r, d; cin >> l >> r >> d;
        adj[l].push_back({r,d});
        in[r]++;
    }
    for(int i = 1; i <= n; i++){
        if(in[i] == 0){
            if(!dfs(i)){
                cout << "No";
                return 0;
            }
        }
    }
    // check if OK
    for(int i = 1; i <= n; i++){
        for(int j = 0; j < adj[i].size(); j++){
            if(sz[i] + adj[i][j].second != sz[adj[i][j].first]){
                cout << "No";
                return 0;
            }
        }
    }

    cout << "Yes";
    return 0;
}



Measured memory_bytes: 9728
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
#include<random>
#include <bitset>
#include <deque>
using namespace std;
#define N (1000000000+7)
//#define N 998244353
#define INF 1e16
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> Q;
typedef vector<ll> vec;
typedef vector<vec> mat;
const int inf = (int)1e9; 
 
ll gcd(ll a, ll b) {
	if (b > a) {
		ll tmp = b;
		b = a;
		a = tmp;
	}
	if (a%b == 0)return b;
	else return gcd(b, a%b);
}

int main(void){
	ll a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<max(b*d,max(a*c,max(a*d,b*c)))<<endl;
	return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define int long long
#define all(a) a.begin(), a.end()
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    if(s == "zyxwvutsrqponmlkjihgfedcba"){
        cout << -1 << endl;
        return 0;
    }
    int c[26] = {};
    if(s.size() != 26){
        rep(i, 0, s.size()) c[s[i] - 'a']++;
        rep(i, 0, 26){
            if(c[i] == 0){
                s += (char)('a' + i);
                cout << s << endl;
                return 0;
            }
        }
    }else{
        int len = -1;
        char ch;
        rep(i, 0, s.size()){
            c[s[i] - 'a']++;
            rep(j, 0, 26){
                if(c[j] == 0 && (s[i] - 'a') < j){
                    len = i; ch = 'a' + j;
                    break;
                }
            }
        }
        cout << s.substr(0, len) << ch << endl;
    }
}

Measured memory_bytes: 256
//C
#include <cassert>
#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>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#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>
#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>

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

//LOVE NyantakoGG

using namespace std;


int main() {
	int N;
	cin >> N;
	vector<int>data(N);
	for (int i = 0; i < N; i++) {
		cin >> data[i];
	}
	vector<int>dp(N);
	for (int i = 0; i < N; i++) {
		dp[i] = INFINITY;
	}
	dp[0] = 0;
	dp[1] = abs(data[1] - data[0]);
	for (int i = 2; i < N; i++) {
		chmin(dp[i], dp[i - 2] + abs(data[i - 2] - data[i]));
		chmin(dp[i], dp[i - 1] + abs(data[i - 1] - data[i]));
	}
	cout << dp[N - 1] << endl;
}


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

using namespace std;

using ll = long long;
using p  = pair<ll, ll>;
constexpr ll INF = 1LL << 62;
constexpr ll MAX_A = 100000;

int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N;
    cin >> N;
    
    vector<ll> A(N);
    vector<ll> bucket(MAX_A + 1, 0);
    for (auto&& a : A) {
        cin >> a;
        bucket[a]++;
    }
    
    for (ll i = 1; i <= MAX_A; i++) {
        if (bucket[i] >= 3) {
            if (bucket[i] % 2) {
                bucket[i] = 1;
            } else {
                bucket[i] = 2;
            }
        }
    }
    
    ll count_two = 0;
    for (ll i = 1; i <= MAX_A; i++) {
        if (bucket[i] == 2) {
            count_two++;
        }
    }
    
    ll ans = 0;
    for (ll i = 1; i <= MAX_A; i++) {
        if (bucket[i]) {
            ans++;
        }
    }
    
    if (count_two % 2) {
        cout << ans - 1 << endl;
    } else {
        cout << ans << endl;
    }
    
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>

using namespace std;

int main() {

    int n;
    cin>>n;

    int k;
    cin>>k;

    int no=0, temp;

    for(int i=0; i<n; i++){
        cin>>temp;
        if(temp>=k){no++;}
    }

    cout<<no;

    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

typedef long long ll;

int main() {
  ll n, t;
  cin >> n >> t;
  vector<ll> a(n);

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

  ll max_prof = 0;
  ll cur_min = 1e10;
  map<ll, ll> mp;

  for (int i = 0; i < n; i++) {
    cur_min = min(cur_min, a[i]);
    max_prof = max(max_prof, a[i]-cur_min);
    if (a[i]-cur_min == max_prof) {
      mp[max_prof]++;
    }
  }

  cout << mp[max_prof] << endl;

  return 0;
}

Measured memory_bytes: 7296
#include <bits/stdc++.h>
 
using namespace std;
 
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
 
typedef vector<int> Edge;
typedef vector<Edge> Graph;
 
Graph g;
set<int> ans;
 
vector<bool> vis;
 
void dfs(int x) {
   
  vis[x] = 1;
  if(g[x].empty()) {
    ans.insert(x);
    return;
  }
   
  rep(i, g[x].size()) {
    if(vis[g[x][i]]) continue;
    dfs(g[x][i]);
  }
}
 
 
int main() {
   
  int N;
  while(cin >> N && N) {
    vis.clear();
    ans.clear();
    g.clear();
 
    int id_size = 0;
    map<string, int> id;
     
    cin.ignore();
    rep(ii, N) {
      string str;
      getline(cin, str);
       
      rep(i, str.size()) {
    if(!isalpha(str[i])) str[i] = ' ';
      }
      stringstream ss(str);
       
      string parent;
      ss >> parent;
      if(id.find(parent) == id.end()) {
    id[parent] = id_size ++;
      }
 
       
      while(ss >> str) {
    if(id.find(str) == id.end()) {
      id[str] = id_size ++;
    }
    g.resize(id_size);
    vis.resize(id_size);
    g[id[parent]].push_back(id[str]);
 
      }
    }
 
    dfs(0);
    cout << ans.size() << endl;
     
  }
   
  return 0;
}

Measured memory_bytes: 1456
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
const int INF = 1<<30;
const ll MOD = 1000000007;

int main(void) {
    int l, r, d; cin >> l >> r >> d;
    int sum = 0;
    for (int i = l; i <= r; i++){
        if (i % d == 0) sum++;
    }
    cout << sum << endl;


    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define int long long
#define N 111

using namespace std;

int p[N];

signed main() {
	int n, x, ans = 1;
	cin >> n >> x;
	for(int i=1; i<=n; i++) {
		int l;
		cin >> l;
		p[i] = p[i-1] + l;
		ans += p[i] <= x;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll n;
  cin >> n;
  vvll dist(n, vll(n, INF));
  vP es;
  rep(i, n) dist[i][i] = 0;
  rep(i, n) {
    string s;
    cin >> s;
    rep(j, n) {
      if (s[j] == '1') {
        dist[i][j] = 1;
        es.emplace_back(i, j);
      }
    }
  }

  rep(k, n) rep(i, n) rep(j, n) chmin(dist[i][j], dist[i][k] + dist[k][j]);

  ll hiro = -1;
  rep(i, n) {
    bool ok = true;
    ll tmpm = 0;
    for (P e : es) {
      ll u, v;
      tie(u, v) = e;
      if(abs(dist[i][u] - dist[i][v]) != 1){
        ok = false;
        break;
      }
      chmax(tmpm, dist[i][u]);
      chmax(tmpm, dist[i][v]);
    }
    if (ok) chmax(hiro, tmpm);
  }

  if (hiro != -1) hiro++;
  cout << hiro << endl;

  return 0;
}


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

using namespace std;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    int res = int(1e9);
    for (char c = 'a'; c <= 'z'; ++c) {
        string t = s;
        int it = 0;
        while (true) {
            if (t.empty()) break;
            if (t == string(t.length(), c)) {
                res = min(res, it);
                break;
            }
            string nw = "";
            for (int i = 0; i < (int) t.length() - 1; ++i) {
                if (t[i] == c || t[i + 1] == c) {
                    nw += c;
                } else {
                    nw += t[i];
                }
            }
            t = nw;
            ++it;
        }
    }
    cout << res << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <cmath>
#include <string>
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
#include <iomanip>
#include <tuple>
#include <queue>
#include <numeric>
using namespace std;
typedef long long ll;
#define rep(i, a, n) for (int i=a;i<n;++i)
#define repeq(i, a, n) for(int i=a;i<=n;++i)
#define repi(m, itr) for (auto itr = m.begin();itr != m.end();++itr)
#define per(i, a, n) for (int i=n-1; i>=a;--i)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// F - LCS
string S, T;
string ans = "";
int dp[3100][3100];

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

    rep(i, 0, S.length()){
        rep(j, 0, T.length()){
                if(S[i] == T[j]){
                    chmax(dp[i + 1][j + 1], dp[i][j] + 1);
                }
                chmax(dp[i + 1][j + 1], dp[i][j + 1]);
                chmax(dp[i + 1][j + 1], dp[i + 1][j]);
        }
    }

    int restore_i = S.length();
    int restore_j = T.length();
    while(restore_i > 0 && restore_j > 0){
        if(dp[restore_i][restore_j] == dp[restore_i-1][restore_j]){
            --restore_i;
        }else if(dp[restore_i][restore_j] == dp[restore_i][restore_j-1]){
            --restore_j;
        }else{
            ans = T[restore_j-1] + ans;
            --restore_i;
            --restore_j;
        }
    }

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




Measured memory_bytes: 37120
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag,
		tree_order_statistics_node_update> ordered_set;

#define el				'\n'
#define sz(v)			((int)((v).size()))
#define all(v)          ((v).begin()),((v).end())
#define clr(v, d)		memset(v, d, sizeof(v))

double const EPS = 1e-8, PI = acos(-1);
const int N = 100 + 9, M = 1e4 + 9, OO = (int) 2e9 + 1;
const long long MOD = 998244353, INF = 1e18 + 9;

typedef long long ll;

void OUTPUT() {
	cout << fixed << setprecision(0);
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}

void INPUT() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
}

int H, W, grid[N][N];
int n, colors[M];

int main() {
//	INPUT();
	OUTPUT();
	cin >> H >> W >> n;
	for (int i = 1; i <= n; i++) {
		cin >> colors[i];
	}
	int cur = 1;
	for (int i = 0; i < H; i++) {
		if (i % 2) {
			for (int j = W - 1; j >= 0; j--) {
				while (!colors[cur]) {
					cur++;
				}
				grid[i][j] = cur;
				colors[cur]--;
			}

		} else {
			for (int j = 0; j < W; j++) {
				while (!colors[cur]) {
					cur++;
				}
				grid[i][j] = cur;
				colors[cur]--;
			}
		}
	}
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cout << grid[i][j] << " \n"[j == W - 1];
		}
	}

	return 0;

}


Measured memory_bytes: 892
function Main (input) {
  var i = input.split("\n")[0].split("");
  if (i[2] == i[3] && i[4] == i[5]) {
    console.log("Yes");
  }
  else {
    console.log("No");
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 22076
/*
Read the question and constraints carefully .Take pen and paper and start solving.
write it down
*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define pi acos(-1.0)/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second*/
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

int main()
{

    int n,i,j,o,c,tot=0,k,o1,c1,f;

    cin>>n;

    string s;
    pair<pair<int,int>,string> p[n];

    rep(i,0,n)
    {
        cin>>s;
        p[i].second = s;

        tot += s.size();

        o1 = c1 = 0;

        for(j=o=0;j<s.size();++j)
        {
            if(s[j]==')')
            {
                if(o==0)
                    ++c1;
                else
                    --o;
            }
            else
                ++o;

        }

        for(j=s.size()-1,c=0;j>=0;--j)
        {
              if(s[j]=='(')
              {
                  if(c==0)
                    ++o1;
                  else
                    --c;
              }
              else
                  ++c;  
        }

        
        if(o1==0)
        {
            p[i].first.first = INT_MIN;
            p[i].first.second = INT_MIN;
        }
        else if(c1==0)
        {
            p[i].first.first = INT_MAX;
            p[i].first.second = INT_MAX;
        }
        else if(o1>c1)
        {
            p[i].first.first = INT_MAX-c1;
            p[i].first.second = INT_MIN+o1;
        }
        else if(o1<c1)
        {
            p[i].first.first = INT_MIN+o1;
            p[i].first.second = INT_MAX-c1;
        } 
        else
        {
            p[i].first.first = 0;
            p[i].first.second = 0;
        }


    }

    sort(p,p+n,greater<pair<pair<int,int>,string>>());

     string ans(tot,'a');



    k=0;
    for(i=0;i<n;++i)
    {
        s = p[i].second;

        for(j=0;j<s.size();++j,++k)
        {
            ans[k] = s[j];
        }
    }


    //cout<<ans<<"\n";

    for(i=o=c=0;i<tot;++i)
    {
        if(ans[i]=='(')
            ++o;
        else
            --o;

        if(o<0)
        {
            cout<<"No";
            return 0;
        }
    }


    if(o==0)
        cout<<"Yes";
    else
        cout<<"No";


    return 0;
}

Measured memory_bytes: 43308
#include <bits/stdc++.h>
using namespace std;
int n, p[100010], fo[100010], back[100010];
int main()
{
	scanf("%d", &n);
	int a = 0;
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &p[i]);
		fo[i] = abs(p[i]-a);
		a = p[i];
		fo[i] += fo[i-1];
	}
	a = 0;
	for (int i = n; i > 0; i--)
	{
		back[i] = back[i+1];
		back[i] += abs(p[i]-a);
		a = p[i];
	}
	for (int i = 1; i <= n; i++)
	{
		int ans = fo[i-1] + back[i+1] + abs(p[i-1]-p[i+1]);
		printf("%d\n", ans);
	}
}

Measured memory_bytes: 2432
# -*- coding: utf-8 -*-

 
a, b, c = [int(e) for e in input().split()]
# a, b, c = [4, 2, 1]
# a, b, c = [4, 12, 20]
# a, b, c = [454, 414, 444]
# a, b, c = [pow(10, 9), pow(10, 9), pow(10, 9)]
# a, b, c = [1, 1, 1]

if a == b == c == 1:
    print(0)
elif a == b == c: 
    print(-1)
else:
    count = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        aa, bb, cc = a, b, c
        a = bb // 2 + cc // 2
        b = aa // 2 + cc // 2
        c = aa // 2 + bb // 2
        count += 1
    print(count)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 998244353;
const long long INF = 1e18;
typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> PLL;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned long long ULL;
//typedef boost::multiprecision::cpp_int bigint;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	LL N;
	cin >> N;
	for (LL n = 0; n < N; n++) {
		LL a;
		cin >> a;
		if (a % 2 == 0) {
			if (a % 3 != 0 && a % 5 != 0) {
				cout << "DENIED\n";
				return 0;
			}
		}
	}
	cout << "APPROVED\n";
	return 0;
}


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

using namespace std;

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

  int ret = 0;
  for(int i = 1; i < S.size(); i++) {
    if(S[i - 1] != S[i]) ++ret;
  }
  cout << ret << endl;
}


Measured memory_bytes: 512
H, W = map(int, input().split())
grid = [list(str(input())) for _ in range(H)]

for h in range(H):
    cnt = sum([0 if i=='.' else 1 for i in grid[h]])
    if cnt==0:
        grid[h] = [0]*W

for w in range(W):
    cnt = sum([0 if grid[h][w] in ('.', 0) else 1 for h in range(H)])
    if cnt == 0:
        for h in range(H):
            grid[h][w] = 0

for g in grid:
    string = [s for s in g if not s==0]
    if len(string)==0:
        continue
    print(''.join(string))

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pii pair <int,int>
#define pll pair <ll,ll>
#define testcase() int t; cin>>t; while(t--)

ll M = 998244353;
ll powerm(ll x,ll y){ ll res=1; while(y){ if(y&1) res=(res*x)%M; y=y>>1; x=(x*x)%M;} return res%M; }
ll power(ll x,ll y){ ll res=1; while(y){ if(y&1) res=(res*x); y=y>>1; x=(x*x);} return res; }
ll max3(ll a,ll b,ll c){ return max( max(a,b),c ); }
ll gcd(ll a,ll b){if(b>a)return gcd(b,a); if(b==0)return a; return gcd(b,a%b);}
const int N = 2e5 + 5;
ll fact[N], inv[N];
void pre()
{
    fact[0] = inv[0] = 1;
    for(ll i=1;i<N;i++)
    {
        fact[i] = (fact[i-1]*i)%M;
        inv[i] = powerm(fact[i],M-2);
    }
}

ll C(ll n, ll r)
{
    ll h = ((fact[n]*inv[r])%M + M)%M;
    h = ((h*inv[n-r])%M + M)%M;
    return h;
}

int main() {
	
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
	pre();
	ll n,m,k; cin>>n>>m>>k;
	ll ans = 0;
	for(ll i=0;i<=k;i++)
	{
	    ll tt = ( C(n-1,i)*m )%M;
	    tt = (tt*powerm(m-1,n-i-1))%M;
	    ans = (ans+tt)%M;
	}
	cout<<ans;
	
	return 0;
}


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

int main()
{
	int sx, sy, tx, ty;
	cin >> sx >> sy >> tx >> ty;
	int x = tx - sx, y = ty - sy;
	cout << string(y, 'U');
	cout << string(x, 'R');
	cout << string(y, 'D');
	cout << string(x + 1, 'L');
	cout << string(y + 1, 'U');
	cout << string(x + 1, 'R');
	cout << 'D';
	cout << 'R';
	cout << string(y + 1, 'D');
	cout << string(x + 1, 'L');
	cout << 'U' << endl;
	return 0;
}


Measured memory_bytes: 256
void main(){
  import std.stdio, std.conv, std.string, std.algorithm;

  int n; rd(n);

  int f(int x){
    int ret=0;
    while(x>0){
      ret+=x%10;
      x/=10;
    }
    return ret;
  }

  int mn=1_000_000_000;
  for(int a=1; a<n; a++){
    int b=n-a;
    mn=min(mn, f(a)+f(b));
  }

  writeln(mn);

}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x) e=l[i].to!(typeof(e));
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using ld=long double;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint a,b;std::cin>>a>>b;
    std::cout<<(a*b%2?"Odd":"Even")<<'\n';
}


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

#define INF 1145148101919
#define INF2 1145141919810364364
#define ll long long
using namespace std;

const int MAX_N = 1<<19;

int n;
ll dat[2][2*MAX_N-1],lazy[2][2*MAX_N-1];

void init(int k, int m){
	n = 1;
	while(n<m){
		n *= 2;
	}
	
	for(int i=0;i<2*n-1;i++){
		dat[k][i] = 0;
		lazy[k][i] = 0;
	}
}

//演算
ll cal(ll a, ll b){
	return min(a,b);
}

//k番目のノードの遅延評価
void eval(int x,int k, int l, int r){
	if(lazy[x][k] != 0){
		dat[x][k] += lazy[x][k];
		if(r - l>1){
			lazy[x][2*k+1] += lazy[x][k];
			lazy[x][2*k+2] += lazy[x][k];
		}
		lazy[x][k] = 0;
	}
}

//1点加算
void update(int s, int k, ll a){
	k += n-1;
	dat[s][k] += a;
	while(k>0){
		k = (k-1)/2;
		dat[s][k] = cal(dat[s][k*2+1],dat[s][k*2+2]);
	}
}

//区間加算
void add(int s,int a, int b, ll x, int k = 0, int l = 0, int r = n){
	if(r < 0){
		r = n;
	}
	eval(s,k,l,r);
	if(b<=l || r<=a) return;
	
	if(a<=l && r<= b){
		lazy[s][k] += x;
		eval(s,k,l,r);
	}else{
		add(s,a,b,x,2*k+1,l,(l+r)/2);
		add(s,a,b,x,2*k+2,(l+r)/2,r);
		dat[s][k] = cal(dat[s][k*2+1],dat[s][k*2+2]);
	}
}

//[a,b)の中の値
//(a,b,0,0,n)で呼び出す
ll query(int s,int a, int b, int k, int l, int r){
	if(r<0) r = n;
	eval(s,k,l,r);
	if(r<=a || b<=l){
		return INF2;
	}
	if(a<=l && r<=b){
		return dat[s][k];
	}else{
		ll vl = query(s,a,b,k*2+1,l,(l+r)/2);
		ll vr = query(s,a,b,k*2+2,(l+r)/2,r);
		return cal(vl,vr);
	}
}

ll x[200010];
int main(){
	int l,q,a,b,i;
	cin >> l >> q >> a >> b;
	a--; b--;
	for(i=0;i<2;i++){
		init(i,l);
	}
	for(i=0;i<l;i++){
		if(i!=a){
			update(0,i,INF-i);
			update(1,i,INF+i);
		}else{
			update(0,i,-i);
			update(1,i,i);
		}
	}
	
	x[0] = b;
	for(i=1;i<=q;i++){
		cin >> x[i];
		x[i]--;
		ll m = min(query(0,0,x[i]+1,0,0,n) + x[i],query(1,x[i],l,0,0,n)-x[i]);
		add(0,0,l,abs(x[i]-x[i-1]),0,0,n);
		add(1,0,l,abs(x[i]-x[i-1]),0,0,n);
		
		ll r = query(1,x[i-1],x[i-1]+1,0,0,n)-x[i-1];
		r = query(0,x[i-1],x[i-1]+1,0,0,n)+x[i-1];
		if(r>m){
			update(0,x[i-1],m-r);
			update(1,x[i-1],m-r);
		}
	}
	
	ll ans = INF2;
	for(i=0;i<l;i++){
		ans = min(ans,query(0,i,i+1,0,0,n)+i);
	}
	cout << ans << endl;
}


Measured memory_bytes: 24832
n = input()
a = list(map(int,input().split()))

a_dict = {}

for i in a:
    if i in a_dict:
        a_dict[i] += 1
    else:
        a_dict[i] = 1

total_com = 0
for i in a_dict.values():
    total_com += i*(i-1)//2

tmp = 0
for i in a:
    tmp = a_dict[i] - 1
    print(total_com - tmp)

Measured memory_bytes: 26012
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
#pragma warning(disable:4996) 

typedef long long ll;
typedef unsigned long long ull;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define LINF3 1000000000000
#define INF 2140000000
//const long long MOD = 1000000007;
const long long MOD = 998244353;

using namespace std;

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

ll dp[3005][3005];
void solve()
{
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    int i, j;
    dp[a][b] = 1;
    for (i = a; i <= c; i++) {
        for (j = b; j <= d; j++) {
            if (dp[i][j]) {
                int k;
                for (k = 0; k < 3; k++) {
                    int i2 = i + dx[k], j2 = j + dy[k];
                    if (i2 > c || j2 > d) continue;

                    if (k == 0) {
                        dp[i2][j2] = (dp[i2][j2] + dp[i][j] * j) % MOD;
                    }
                    else if(k==1) {
                        dp[i2][j2] = (dp[i2][j2] + dp[i][j] * i) % MOD;
                    }
                    else {
                        dp[i2][j2] = (dp[i2][j2] - (dp[i][j] * i %MOD * j%MOD)+MOD) % MOD;
                    }
                }
            }
        }
    }
    printf("%lld\n", dp[c][d]);

    return;
}


int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}


Measured memory_bytes: 72076
#B問題
N = int(input())
W_list = input().split()
W_list = [int(i) for i in W_list]
ans_list = []
for i in range(len(W_list)):
    ans = abs(sum(W_list[:i+1]) - sum(W_list[i+1:]))
    ans_list.append(ans)
print(min(ans_list))

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

int main(void){

    int N; cin>>N;
    vector<int> H(N);

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

    int maximum=0, ans=0;
    for (int i = 0; i < N; ++i) {
        if(maximum<=H[i]){
            maximum = H[i];
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
A = list(map(lambda x: int(x)//2, input().split()))

import math

def lcm(x, y):
  return (x // math.gcd(x, y)) * y

def pow2(x):
  ret = 0
  while x%2 == 0:
    ret += 1
    x //= 2
  return ret

P = []
for a in A:
  P.append(pow2(a))

if len(set(P)) != 1:
  print(0)
else:
  m = 1
  for a in A:
    m = lcm(m, a)
  print(-(-(M//m)//2))

Measured memory_bytes: 19932
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using Graph = vector<vector<pii>>;
const int MOD = 1e9 + 7;

int N, Q, K;
Graph G;

vector<ll> dijkstra(int s) {
    vector<ll> dist(N, 1e18);
    priority_queue<pli, vector<pli>, greater<pli>> que;
    dist[s] = 0;
    que.push({0, s});
    while (!que.empty()) {
        pli v = que.top();
        que.pop();
        if (v.first > dist[v.second])
            continue;
        for (auto nv : G[v.second]) {
            if (dist[nv.second] > nv.first + dist[v.second]) {
                dist[nv.second] = nv.first + dist[v.second];
                que.push({dist[nv.second], nv.second});
            }
        }
    }
    return dist;
}

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

    cin >> N;
    G.resize(N);
    for (int i = 0; i < N - 1; ++i) {
        int a, b, c;
        cin >> a >> b >> c;
        a--, b--;
        G[a].push_back({c, b});
        G[b].push_back({c, a});
    }
    cin >> Q >> K;
    K--;

    vector<ll> dist = dijkstra(K);
    for (int i = 0; i < Q; ++i) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        cout << dist[x] + dist[y] << '\n';
    }

    return 0;
}


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

using namespace std;

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)
#define INF 1000000000

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

vector<vector<int> > v(2222);
bool non[2222];
int dist[2222];
int n,k,ans = 2222;

void bfs(int kyo,int a ,int b = -1)
{
	REP(i,2222)dist[i] = INF;
	int ret = 0;
	queue<P> q;
	int endNode;
	q.push(P(a,b));
	dist[a] = 0;
	if(b != -1)
	{
		q.push(P(b,a));
		dist[b] = 0;
	}
	while(!q.empty())
	{
		P p = q.front();q.pop();
		int node = p.FI;
		REP(i,v[node].size())
		{
			if(v[node][i] == p.SE)continue;
			endNode = v[node][i];
			dist[endNode] = dist[node] + 1;
			if(dist[endNode] > kyo)ret++;
			q.push(P(endNode,node));
		}
	}
	ans = min(ans,ret);
}


int main()
{
	cin >> n >> k;
	vector<P> G;
	
	REP(i,n-1)
	{
		int a,b;cin >> a >> b;
		a--;b--;
		v[a].PB(b);
		v[b].PB(a);
		G.PB(P(a,b));
	}
	
	if(k % 2 == 0)
	{
		REP(i,n)bfs(k/2,i);
	}
	else
	{
		REP(i,G.size())bfs(k/2,G[i].FI,G[i].SE);
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb push_back
#define emb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define de(x) cout << #x << " is " << x << '\n'
typedef long long ll;
using namespace std;
int main()
{
    hi;
    string s;
    cin >> s;
    bitset<26> b = 0;
    for (auto c : s)
    {
        b[c - 'a'] = 1;
    }
    int res = -1;
    rep(i, 0, 26)
    {
        if (b[i] == 0)
        {
            res = i;
            break;
        }
    }
    if (res == -1)
        cout << "None";
    else
        cout << char('a' + res);
    return 0;
}

Measured memory_bytes: 512
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner(System.in);
        
        String str1 = scan.next();
        String str2 = scan.next();
        
        int x = Integer.parseInt(str1);
        int y = Integer.parseInt(str2);
        
        if (x * y % 2 == 0)
        
            System.out.println("Even");
        
        else
        
            System.out.println("Odd");
    }
}


Measured memory_bytes: 35664
#![allow(unused_imports)]
#![allow(unused_macros)]
use std::cmp::{max, min};
use std::collections::*;
use std::io::{stdin, Read};

#[allow(unused_macros)]
macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, $var:ident $($r:tt)*) => {
        let $var = parse_val!($it, usize);
        parse!($it $($r)*);
    };
}

#[allow(unused_macros)]
macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, ($($t: tt),*)) => {
        ($(parse_val!($it, $t)),*)
    };
    ($it: ident, u1) => {
        $it.next().unwrap().parse::<usize>().unwrap() -1
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

#[cfg(debug_assertions)]
macro_rules! debug {
    ($( $args:expr ),*) => { eprintln!( $( $args ),* ); }
}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($( $args:expr ),*) => {
        ()
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, mut a: usize, mut b: usize, mut c: usize, mut k: usize);
    while k > 0 {
        if a >= b {
            k -= 1;
            b *= 2;
        } else if b >= c {
            k -= 1;
            c *= 2;
        } else {
            break;
        }
    }
    if a < b && b < c {
        println!("{}", "Yes");
    } else {
        println!("{}", "No");
    }
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


Measured memory_bytes: 2172
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <sstream>
#include <set>
#include <queue>
#include <stack>
#include <cctype>
#include <map>
#include <climits>
#include <bitset>
using namespace std;
#define MATH_PI 3.14159265358979323846
int main(){
	ios::sync_with_stdio(false);
	string sInput;
	cin >> sInput;
	cout << count(sInput.begin(), sInput.end(), '1') << endl;
endapp:
	//system("pause > nul");
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int n,i;
  double sum=0;
  scanf("%d",&n);
  double x[n];
  char u[n][4];
  for(i=0;i<n;i++){
    scanf("%lf%s",&x[i],u[i]);
    if(u[i][0]=='J'){
      sum+=x[i];
    }else{
      sum+=x[i]*380000;
    }
  }
  printf("%f",sum);
  return 0;
}
  

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()

typedef long long lint;
typedef pair<int,int> P;

const long long int mod=1e9+7;



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

	int N[100010]={0};

	int l[100010]={0};
	int r[100010]={0};

	int lc=1;
	REP(i,S.size()){
		if(S[i]!='L')lc=1;
		if(S[i]=='L'){
			l[i]=lc;
			lc++;
		}

	}

	int rc=1;
	for(int i=S.size()-1;i>=0;--i){
		if(S[i]!='R')rc=1;
		if(S[i]=='R'){
			r[i]=rc;
			rc++;
		}

	}



	REP(i,S.size()){
		if(S[i]='R'){
			if(r[i]%2){
				N[i+r[i]-1]++;
			}else{
				N[i+r[i]]++;
			}
		}
		if(S[i]='L'){
			if(l[i]%2){
				N[i-l[i]+1]++;
			}else{
				N[i-l[i]]++;
			}
		}
	}


	REP(i,S.size()-1) cout << N[i]-1 << " ";

	cout << N[S.size()-1]-1 << endl;
	return 0;

}


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

void call(int n);

int main(){
  int n;
  cin >> n;
  call(n);
  return 0;
}

void call(int n){
  int i=1;
  int x;
  do{
    x=i;
    if(x%3 == 0){
      cout << " " <<i;
    }else if(x % 10 == 3){
      cout << " " <<i;
    }else{
        x/=10;
        while(x){
           if(x % 10 == 3){
             cout << " " <<i;
             break;
           }
           x /=10;
        }     
    }
  }while(++i <= n);
  cout << endl;
}


Measured memory_bytes: 3076
#pragma GCC optimize("O3")

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define sz size
#define f first
#define s second

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    string S;
    cin >> S;
    F0R(i,S.size()-1)
    {
        if(S[i]==S[i+1])
        {
            cout << "Bad";
            return 0;
        }
    }
    cout << "Good";

    return 0;
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

struct UnionFindTree{
	vector<int>par,sz,g,h;
	UnionFindTree(int n){
		par.resize(n);
		sz.resize(n);
		g.resize(n);
		h.resize(n);
		for(int i=0;i<n;i++){
			par[i]=i;
			sz[i]=1;
			if(i<n/2)g[i]++;
			else h[i]++;
		}
	}
	int find(int x){
		return x==par[x]?x:par[x]=find(par[x]);
	}
	void unite(int x,int y){
		x=find(x);y=find(y);
		if(x==y)return;
		if(sz[x]<sz[y])swap(x,y);
		sz[x]+=sz[y];
		g[x]+=g[y];
		h[x]+=h[y];
		par[y]=x;
	}
	bool areSame(int x,int y){
		return find(x)==find(y);
	}
	int size(int x){
		return sz[find(x)];
	}
};

const int L=100000;
signed main(){
	int N;
	cin>>N;
	UnionFindTree uf(L*2);
	rep(i,N){
		int x,y;
		cin>>x>>y;
		x--;y--;
		uf.unite(x,L+y);
	}

	int ans=0;
	rep(i,2*L){
		if(uf.find(i)!=i)continue;
		ans+=uf.g[i]*uf.h[i];
	}
	ans-=N;
	cout<<ans<<endl;
	return 0;
}

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

int main() {
	int n;
	vector<int> a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int wk;
		cin >> wk;
		a.push_back(wk);
	}
	sort(a.begin(), a.end(), greater<int>());

	int alice = 0;
	int bob = 0;
	for (int i = 0; i < n; i++) {
		if (i % 2 == 0) {
			alice += a[i];
		}
		else {
			bob += a[i];
		}
	}
	cout << alice - bob << endl;
}

Measured memory_bytes: 256
import java.util.*;
class Main {
	public static void main(String...args) {
	   
		Scanner scan = new Scanner(System.in);
		while(true) {
			int total = 0;
			int count = 0;
			int	n = scan.nextInt();
			int x = scan.nextInt();
			if(n == 0 && x == 0)
				break;
			for(int i0 = 1; i0 <= n; i0++){
				for(int i1 = 1; i1 <= n; i1++){
					for(int i2 = 1; i2 <= n; i2++){
					    if(i0 != i1 && i1 != i2 && i0 != i2) {
					        if(x == i0 + i1 + i2) {
					            count++;
					        }
					    }
					}
				}	
			}
			System.out.println(count / (3 * 2));
		}
	}
}


Measured memory_bytes: 26500
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>
typedef long long ll;
#define rep(i,n) for(ll i=0; i<(ll)(n); i++)
#define max(l,r) ((l)>(r)?l:r)
#define min(l,r) ((l)<(r)?l:r)
#define swap(l,r) {ll tp=l;l=r;r=tp;}
const ll MOD = 1000000007;

int main(){
    //input
    ll n, d;
    scanf("%lld%lld", &n, &d);

    ll ans = 0;
    rep(i,n){
        ll x, y;
        scanf("%lld%lld", &x, &y);
        if(x*x + y*y <= d*d) ans++;
    }

    //output
    printf("%lld", ans);
}

Measured memory_bytes: 1728