akhauriyash/Code-Regression huggingface dataset:
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');

var n = +lines.shift();

var A = []
for (var i = 0; i < n; i++) {
	A.push([]);
	for (var j = 0; j < n; j++) {
		A[i][j] = 0;
	}
}

for (var i = 0; i < n; i++) {
	var u = lines.shift().split(' ');
	var idx = u[0] - 1;
	var k = +u[1];

	for (var j = 0; j < k; j++) {
		A[idx][+u[2 + j] - 1] = 1;
	}
}

A.forEach(function(row) {
	console.log(row.join(' '));
});

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

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
// using namespace __gnu_pbds;

#define int long long int
#define endl "\n"
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()

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

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
		
	int n, w, val = 0;
	cin>>n>>w;
	pair<int, int> item[n+1];

	for(int i=1;i<=n;i++) {
		cin>>item[i].ff;
		cin>>item[i].ss;
		val += item[i].ss;
	}

	int dp[n+1][val+1];
	memset(dp, 0, sizeof(dp));
	// for(int j=0; j<=val; j++) {
	// 	dp[0][j] = INT_MAX;
	// }

	for(int i=1; i<=n; i++) {
		for(int j=1; j<=val; j++) {
			if(item[i].ss == j) {
				dp[i][j] = dp[i-1][j]? min(item[i].ff, dp[i-1][j]) : item[i].ff;
			} else if(item[i].ss < j) {
				if(dp[i-1][j] && dp[i-1][j-item[i].ss])
					dp[i][j] = min(item[i].ff + dp[i-1][j-item[i].ss], dp[i-1][j]);
				else if(dp[i-1][j])
					dp[i][j] = dp[i-1][j];
				else if(dp[i-1][j-item[i].ss])
					dp[i][j] = item[i].ff + dp[i-1][j-item[i].ss];
			} else {
				dp[i][j] = dp[i-1][j];
			}
			// cout<<dp[i][j]<<" ";
		}
		// cout<<endl;
	}

	int i = 0;
	for(int z=1;z<=val;z++) {
		if(dp[n][z]!=0 && dp[n][z]<=w)
			i = z;
	}

	cout<<i;

	return 0;
}

Measured memory_bytes: 79104
using System;
using System.Linq;
using System.Collections.Generic;

public class BinarySearch{
	public static void Main()
	{
		Console.ReadLine();
		var sList = ReadLineAndToIntList();
		Console.ReadLine();
		var tList = ReadLineAndToIntList();
	
		int count = 0;
	
		foreach (var t in tList)
		{
			if(sList.BinarySearch(t) > -1) count++;
		}
		
		Console.WriteLine(count);
	}
	
	//??????????????????????????????
	public static List<int> ReadLineAndToIntList()
	{
		return Console.ReadLine().Split().Select (c => int.Parse(c)).ToList();
	}
}

Measured memory_bytes: 15804
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
#include <stdlib.h>
#include <cctype>

using namespace std;

#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(),z.end())
#define rsort(z) sort(z.rbegin(),z.rend())
#define eerase(z) z.erase(unique(z.begin(),z.end()),z.end())
#define ccnt(z,w) count(z.begin(),z.end(),w)


void printVec(std::vector<int> & vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
void printVec1(std::vector<string>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
void printVec2(std::vector<Int>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}

Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
	return a / gcd(a, b) *b;
	//a*bは64bit integer overflow
}

bool comp(const string a, const string b) {
	return a.length() < b.length();
}

bool integer(double num) {
	return floor(num) == num;
}

string gen(int num) {
	string str = "";
	for (int i = 0; i < num; i++) str += ".";
	return str;
}
Int fact(int num) {
	if (num == 0) return 1;
	else return num * fact(num - 1);
}


std::vector<std::string> split(std::string str, char del) {
	int first = 0;
	int last = str.find_first_of(del);

	std::vector<std::string> result;

	while (first < str.size()) {
		std::string subStr(str, first, last - first);

		result.push_back(subStr);

		first = last + 1;
		last = str.find_first_of(del, first);

		if (last == std::string::npos) {
			last = str.size();
		}
	}

	return result;
}
int main() {
	//int a, b, c,d; cin >> a>>b>>c>>d ;
	string s,t; cin >> s;
	vector<string>ss(3);
	
	char del = ',';
	int i = 0;
	for (const auto subStr : split(s, del)) {
		ss[i] = subStr;
		i++;
	}
	for (int i = 0; i < 3; i++) {
		cout << ss[i];
		if (i != 2)cout << " ";
	}

	cout << endl;
	return 0;
}

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

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {
            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }


        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var input = Reads();
            var a = input[0];
            var b = input[1];
            var count = 0;
            for (long i = a; i <=b ; i++)
            {
                var s = i.ToString();
                bool f = true;
                for (int j = 0; j <= 4; j++)
                {
                    if (s[j] != s[4 - j])
                        f=false;
                }
                if (f)
                    count++;
            }
            Console.WriteLine(count);





            Console.Out.Flush();
        }
    }
}

Measured memory_bytes: 15444
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, Y;
  cin >> N >> Y;
  int x, y;
  for(x = 0; x <= 2000; x++){
    for(y = 0; y <= 2000; y++){
      if((-9000*x - 5000*y == Y - 10000*N) && x >= 0 && y >= 0 && (N - x - y) >= 0){
        cout << N - x - y<< ' ' << y << ' '<< x << endl;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<tuple>
#define rep(i,n) for(int i =0;i<(int)(n);i++)
typedef long long ll;
using namespace std;
int main() {
	int n;
	cin >> n;
	int d[50];
	rep(i, n) {
		cin >> d[i];
	}
	int sum = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			sum += d[i] * d[j];
		}
	}
	cout << sum << endl;
	return 0;
}


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

const int N=500100;
typedef long long ll;
typedef long double ld;

ll sumx,x[N],L;
ld sumy,y[N],k[N];
int n,q[N];

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>L;cout<<fixed<<setprecision(10);
	int t=1,w=0;
	for(int i=1;i<=n;++i){
		ll a,b;cin>>a>>b;
		for(;t<=w&&sumx+b>=L+x[q[t]];++t){sumx-=x[q[t]];sumy-=y[q[t]];}
		if(t<=w&&sumx+b>L){
			x[q[t]]-=sumx+b-L;sumy-=y[q[t]];
			y[q[t]]=k[q[t]]*x[q[t]];sumy+=y[q[t]];
			sumx=L-b;
		}
		x[i]=b;k[i]=a;y[i]=x[i]*k[i];
		sumx=L;sumy+=y[i];q[++w]=i;
		for(;t<w&&k[q[w]]<k[q[w-1]];--w){
			x[q[w-1]]+=x[q[w]];y[q[w-1]]+=y[q[w]];
			k[q[w-1]]=y[q[w-1]]/x[q[w-1]];
		}
		cout<<sumy/sumx<<'\n';
	}
	return 0;
}


Measured memory_bytes: 32000
#include<cstdio>
#include<iostream>
#include<cstring>
#define ll long long
using namespace std;
ll dp[100000+10]; // (int) 1e5 
ll w[100001],v[100001];
//优化 ： w，v互换再用ans 记录最大值 
int main()
{
	memset(dp,0x3f,sizeof(dp)); //这也行？ 
	ll n,m; cin>>n>>m;
	ll i,j;
	
/*	for(i=1;i<=n;i++) cout<<dp[i]<<" ";
	cout<<endl;*/ 
	
	
	for(i=1;i<=n;i++) cin>>w[i]>>v[i];
	ll ans=0;
	dp[0] =0; //  
	
	for(i=1;i<=n;i++)
	{
		for(j=100000;j>=v[i];j--)
		{
			dp[j] = min(dp[j], dp[j-v[i]] + w[i]);
			if(dp[j] <=m)
				ans = max(ans,j); //
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

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

long long MOD = 10000000000 + 7;

int main(){
  cout << setprecision(10);
  int a,b; cin >> a >> b;

  if(a <= 9 && b <= 9){
    cout << a * b << endl;
  } else  {
    cout << -1 << endl;
  }

}


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

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define all(box) box.begin(), box.end()

using namespace std;

using P = pair<int,int>;
using ll = long long;

const long long INF = LLONG_MAX/3;

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; }
inline void Yes (bool condition) { if(condition) { cout << "Yes" << endl; } else { cout << "No" << endl;} }

struct UnionFind{
	std::vector<int> par,siz;
	void init(int n){
		par.resize(n);
		for(int i=0;i<n;i++)par[i]=i;
		siz.resize(n,1);
	}
	UnionFind(int n){
		init(n);
	}
	int root(int n){
		if(par[n]==n)return n;
		else return par[n]=root(par[n]);
	}
	bool issame(int x,int y){
		return (root(x)==root(y));
	}
	bool marge(int a,int b){
		if(issame(a,b))return false;
		else{
			a=root(a),b=root(b);
			if(siz[a]<siz[b])swap(a,b);
			siz[b]+=siz[a];
			par[a]=par[b];
			return true;
		}
	}
	int size(int n){
		return siz[root(n)];
	}
};

long long gcd(long long a,long long b){
    if(b==0)return a;
    return gcd(b,a%b);
}
long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}

const int MOD=998244353;
long long fac[510000], finv[510000], inv[510000];
long long MAX=510000;
bool COMinited=false;
long long COM(int n, int k){
	if(COMinited==false){
		fac[0] = fac[1] = 1;
    	finv[0] = finv[1] = 1;
    	inv[1] = 1;
    	for (int i = 2; i < MAX; i++){
        	fac[i] = fac[i - 1] * i % MOD;
        	inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        	finv[i] = finv[i - 1] * inv[i] % MOD;
    	}
		COMinited=true;
	}
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}
template< typename T >
struct BinaryIndexedTree {
  vector< T > data;

  BinaryIndexedTree(int sz) {
    data.assign(++sz, 0);
  }

  T sum(int k) {
    T ret = 0;
    for(++k; k > 0; k -= k & -k) ret += data[k];
    return (ret);
  }

  void add(int k, T x) {
    for(++k; k < data.size(); k += k & -k) data[k] += x;
  }
};
signed main(){
	int k;
	cin>>k;
	int n;
	cin>>n;
	int a[200010];
	rep(i,n)cin>>a[i];
	int b[200010];
	b[n-1]=a[0]+k-a[n-1];
	rep(i,n-1)b[i]=a[i+1]-a[i];
	sort(b,b+n);
	cout<<k-b[n-1]<<endl;
}

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

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

#define INF INT_MAX/3

int main(){
    cin.sync_with_stdio(false);
    int r, g;
    cin >> r >> g;
    cout << g + (g - r) << endl;
    return 0;
}

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

int main()
{
int n,r=0,w=0,d=0;
  string s;
  cin>>n>>s;

  //cout<<s;
  for(int i=0; i<n;i++)
  {
    if(s[i]=='W') w++;
     
    if(s[i]=='R') r++;
  }
  
  if(r==n || w==n)
  {
  cout<<0;
  return 0 ;
}

  int i=0,j=n-1;
  while(i<j)
  {
  while(s[i]!='W') i++;
    while(s[j]!='R') j--;
    if(i>=j)break;
    //cout<<1<<endl;
    swap(s[i],s[j]);
    d++;
  }
  cout<<d;
  return 0;
}

Measured memory_bytes: 3756
#include<iostream>
#include<stdio.h>
#include<string>
#include <algorithm>
#include<cstring>
#include <math.h>
#include <iomanip>
using namespace std;

int main()
{
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  int x;
  x=a+b+c+d-min(min(a,b),min(c,d));
  if(e>f)x+=e;
  else x+=f;
  cout<<x<<endl;
  return 0;
}



Measured memory_bytes: 3116
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)

int main() {
  int N, M;
  cin >> N >> M;
  int tmp;
  int ans = N;
  rep(i, M) {
    cin >> tmp;
    ans -= tmp;
  }
  if (ans < -1) ans = -1;
  
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n)    for(int i=a; i<=n; ++i)
#define rep1(i,a,n)   for(int i=a; i>=n; --i)
#define pb            push_back
#define int           long long
#define fr            first
#define sc            second
#define vc            vector
#define sz(v)         (int)v.size()
#define all(x)        (x).begin(),(x).end()
#define M             1000000007
#define MM            998244353
#define PI            3.14159265358979
#define INF           1000000000000000

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;

int n,m,ans; string str;

int solve(){
    cin>>str; n=sz(str);
    str=" "+str;
    rep(i,1,n){
        if(str[i]!=str[n+1-i]){
            cout<<"No";
            return 0;
        }
    }
    rep(i,1,(n-1)/2){
        if(str[i]!=str[(n-1)/2+1-i]){
            cout<<"No";
            return 0;
        }
    }
    rep(i,(n+3)/2,n){
        if(str[i]!=str[(n+3)/2+n-i]){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}

signed main() {
    ios::sync_with_stdio(0);
    //std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;
    // cin>>t;
    while(t--) solve();
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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 ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
  ll n, m;
  cin >> n >> m;
  vector <ll> v(m, 0);
  rep(i, n) {
    ll k;
    cin >> k;
    rep(j, k) {
      ll tmp;
      cin >> tmp;
      v.at(tmp-1)++;
    }
  }
  ll res = 0;
  rep(i, m) {
    if (v.at(i) == n) res++;
  }
  cout << res << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,x,y) for(ll i=x;i<=y;i++)
#define imin INT_MIN
#define pll pair<ll,ll>
#define imax INT_MAX
int mod =1e9+7;

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

	bool n;
	cin>>n;
	cout<<!n;
	
	return 0;
}


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

#define ll long long int
#define db double
#define fl float
#define endl '\n'

#define mod (ll)(1000000007)
#define mod1 (ll)998242353
#define mod2 (ll)998244353
#define PI 3.1415926535897932384626433832795

#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp(x,y) make_pair(x,y)
#define pb push_back
#define pob pop_back

#define Sort(v) sort(v.begin(),v.end())
#define Sortd(v) sort(v.begin(),v.end(),greater<>())

#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<n;i++)
#define rf(i,n) for(int i=n-1;i>=0;--i)
#define rf1(i,n) for(int i=n-1;i>=1;--i)
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repn(i,a,b) for(int i=a;i<=b;++i)

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<vi> vvi;
typedef priority_queue<int> pqi;
typedef priority_queue<ll> pql;

//nC2
ll C2(ll n){
    ll ans= max(((n*(n-1))/2),(ll)0);
    return ans;
}
//square
ll sq(ll n){
    return n*n;
}

//GCD
ll gcd(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    if(b==0){
        return a;
    }    
    else{
        return gcd(b,a%b);
    }
}

//LCM
ll lcm(ll a,ll b){
    if(a==0 || b==0){
        return 0;
    }
    else{
        return((ll)((a*b)/gcd(a,b)));
    }
}

//sort pair by second values
bool sortsec(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.second < b.second); 
}
//sort pair by first vals in descending
bool sortinrev(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.first > b.first); 
} 

//Binary Exponentiation
ll BinExp(ll a, ll b, ll m){
    a%=m;
    ll res =1;
    while(b>0){
        if(b&1){
            res = (res * a)%m;
        }
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}


int main(){
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll x,k,d;
    cin>>x>>k>>d;
    x=abs(x);
    if(x/d>=k){
        cout<<x-k*d<<endl;
    }
    else{
        ll a=x/d;
        ll b=a+1;
        // cout<<min(abs(x-a*d),abs(x-b*d))<<endl;
        if((k-a)%2==0){
            cout<<abs(x-a*d)<<endl;
        }
        else{
            cout<<abs(x-b*d)<<endl;
        }
    }
    


    return 0;
}



Measured memory_bytes: 3664
package main

import (
	"fmt"
	"math"
)

func solve(H int, ans int, count int) int {

	if H == 0 {
		return ans
	}
	H = int(math.Floor(float64(H) / 2))
	ans += count
	count *= 2
	return solve(H, ans, count)
}

func main() {
	// Code for D - Caracal vs Monster
	var H int
	fmt.Scanf("%d", &H)

	fmt.Println(solve(H, 0, 1))
}


Measured memory_bytes: 1840
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} //配列vにn個の要素を入力する

int main(){
    int n;string s;
    cin >> n >> s;
    int x = 0;
    vector<int> v(n);
    for(int i = 0;i < n;i++){
        if(s[i]=='I'){x++;v.at(i)=x;}else{x--;v.at(i)=x;}
    }
    int max = 0;
    for(auto e:v){
        if(e >= max){max = e;}
    }
    cout << max;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]A - Restricted
            var line = ReadLine();
            int a = line[0];
            int b = line[1];

            if (a + b >= 10)
            {
                Console.WriteLine("error");
            }
            else
            {
                Console.WriteLine(a + b);
            }
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var array = line.Split(' ');

            return array.Select(x => int.Parse(x)).ToList();
        }
    }
}

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

            #define rep(i,a,b) for(ll i =a; i<b;++i)
            #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
            #define endl "\n"
            #define pb push_back
            #define F first
            #define S second
            #define print(a)       for(auto x : a) cout << x << " "; cout << endl
            #define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
            #define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
            #define mk(x,y)  make_pair(x,y)
            typedef  long long  int ll;
            const ll N = ( 2e3 + 5 );
            const ll mod = 1e18+7;
            ll n,m,f[2019];
            vector < pair<ll, pair <ll,ll >> > g[N];
    ll pow_mod_m(ll a , ll n)
    {
        if(!n)
            return 1;
        ll pt =  pow_mod_m(a,n/2);
        pt *= pt ;
        if(n&1)
            pt *= a ;
        return pt;
    }

    int main()
    {
         IOS;
         int ts =1;
         //cin>>ts;
         while(ts--)
         {
             string s;
             cin >> s;
             f[0] = 1;
             ll ans  =0 , cur= 1;
             for(int i = s.size()-1; i>=0 ;i--)
             {
                 m = ( m + cur*(s[i] -'0'))%2019;
                 cur = cur *10 % 2019;
                 ans += f[m];
                 f[m]++;
                // cout << " for current i as  : " << i << " m : " <<m << " f[m] : " << f[m] << " cur : " << cur << endl;
             }
             cout << ans << endl;
         }
    }


Measured memory_bytes: 3808
from collections import Counter
n = int(input())
a = list(map(int,input().split()))

ja1 = []
ja2 = []
for i in range(1,n+1):
  ja1.append(i-a[i-1])
  ja2.append(i+a[i-1])

s = Counter(ja1)
t = Counter(ja2)

su = 0
for i in s.keys():
  su += s[i]*t[i]
print(su)

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

#define ull unsigned long long
#define ul unsigned long
#define ll long long
#define size_t long long
// std::sort(&a[0], &a[4], [](auto& x, auto& y){return x[0] < y[0];});
//accumulate(&arr2[n], &arr2[m-1], 0);
using namespace std;

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

  string S;
  std::cin >> S;
  if(S.size() == 4){
    sort(S.begin(),S.end());
    S.erase(std::unique(S.begin(), S.end()), S.end());
    if(S.size() == 2){
        std::cout << "Yes" << '\n';
        return 0;
    }
    std::cout << "No" << '\n';
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 2e5+5;
inline void fastio() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

int _;

int main()
{
    //fastio();
    double r;
    scanf("%lf",&r);
    printf("%.8f\n",r*2*acos(-1));
    return 0;
}


Measured memory_bytes: 3772
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (ll i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x%y) : x; }

int main(){
    string s, ans="";
    cin >> s;
    for(int i=0; i<s.size(); i+=2) ans+=s[i];
    cout << ans << endl;
    return 0;
}


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

using namespace std;
using ll = long long;

ll dp[100][3000];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int n, a;
    cin >> n >> a;
    dp[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        ll x;
        cin >> x;
        for (int j = i; j > 0; --j) {
            for (int k = a * n; k >= x; k--) {
                dp[j][k] += dp[j - 1][k - x];
            }
        }
    }
    ll nax = 0;
    for (int t = 1; t <= n; ++t) {
        nax += dp[t][a * t];
    }
    cout << nax << "\n";
    return 0;   
}


Measured memory_bytes: 1408
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	}

}


Measured memory_bytes: 27216
#include <stdio.h>
int main(void)
{
    
    int a,b,i;
    char op;
    
    for(i=1;i>0;i++){
        scanf("%d %c %d",&a,&op,&b);
        if(op=='+'){
            printf("%d\n",a+b);
        }
        else if(op=='-'){
            printf("%d\n",a-b);
        }
        else if(op=='*'){
            printf("%d\n",a*b);
        }
        else if(op=='/'){
            printf("%d\n",a/b);
        }
        else if(op=='?'){
            break;
            
        }
    }
    
    return 0;
}


Measured memory_bytes: 2044
n,m = gets.strip.split.map(&:to_i)
#奇数個接する奴を数える
if n==1
  if m==1
    puts 1
  else
    puts m-2
  end
elsif n==2
  puts 0
else
  if m==1
    puts n-2
  else
    puts (n-2)*(m-2)
  end
end

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


int main()
{
  int n;
  cin >> n;
  vector<vector<int>> a(n, vector<int>(n - 1));
  rep(i, n)
    rep(j, n - 1)
    {
      cin >> a[i][j];
      a[i][j]--;
    }
  vector<vector<int>> idx(n, vector<int>(n, -1));
  int id = 0;
  rep(i, n)
    rep(j, n)
    {
      if (i == j || idx[i][j] != -1)
        continue;
      idx[i][j] = idx[j][i] = id;
      id++;
    }
  vector<vector<int>> g(id);
  vector<int> indegree(id, 0);
  rep(i, n)
    rep(j, n - 2)
    {
      g[idx[i][a[i][j]]].push_back(idx[i][a[i][j+1]]);
      indegree[idx[i][a[i][j+1]]]++;
    }
  vector<int> day(id, 1);
  queue<int> q;
  rep(i, id)
    if (indegree[i] == 0)
      q.push(i);
  while (!q.empty())
  {
    int pre = q.front();
    q.pop();
    for(auto& nxt : g[pre])
    {
      if (--indegree[nxt] == 0)
        q.push(nxt);
      day[nxt] = max(day[nxt], day[pre] + 1);
    }
  }
  rep(i, id)
    if (indegree[i] != 0)
    {
      puts("-1");
      return 0;
    }
  int ans = 0;
  rep(i, id)
    ans = max(ans, day[i]);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 39424
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int cm = 1 << 11;
char cn[cm], * ci = cn, ct;
inline int getint() {
	int A = 0;
	while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	fread(cn, 1, cm, stdin);
	int N = getint(), W = getint();

	vector<ll> dp(100001);
	rep(i, N) {
		int w = getint();
		int v = getint();
		rep (j, W - w + 1) {
			chmax(dp[j], dp[j + w] + v);
		}
	}

	printf("%lld", dp[0]);

	Would you please return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

typedef long long ll;
typedef long double ld;

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int a, b;
    cin >> a >> b;
    rep (i, 20000) {
        if ((int)(i * 0.08) == a && (int)(i * 0.1) == b) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
#include <list>
#include <deque>
using namespace std;
typedef pair<int, int> P;

#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;
int w[100010];
int n, k;
bool check(int t){ //一つのトラックの積載量をtとする.
    int sum=0;
    int cnt=1;
    for(int i=0; i<n; ++i){
        sum += w[i];
        if(sum>t){
            cnt++;
            sum = w[i];
        }
        if(w[i]>t) return false;
    }
    return cnt<=k;
}
int main() {
     cin >> n >> k;
    REP(i, n) cin >> w[i];
    
    int dl=0, ul=1e9;
    for(int i=0; i<40; ++i){
        int mid = dl + (ul-dl)/2;
        
        if(check(mid)){
            ul = mid-1;
        }else{
            dl = mid+1;
        }
    }
    cout << dl << endl;
	return 0;
}


Measured memory_bytes: 3492
"use strict";
function main(input) {
    const line = input.split("\n");
    let arr = line[0].split(" ");
    const N = arr[0];
    const M = arr[1];
    const A = line[1].split(" ").map(Number);
    A.sort(function (a, b) {
        return a < b ? 1 : b < a ? -1 : 0;
    });
    const accum = A.reduce((Ai, x) => Ai + x);
    console.log((((accum + (4 * M) - 1) / (4 * M)) | 0) <= A[M - 1] ? "Yes" : "No");
    return;
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29592
using System;
using System.Linq;
using System.Collections.Generic;

namespace agc030_a
{
    class Program
    {
        static void Main(string[] args)
        {
            var text = Console.ReadLine();
            var n = int.Parse(text);
            text = Console.ReadLine();
            var list = text.Split(' ').Select(x => int.Parse(x)).ToList();

            var minabs = int.MaxValue;

            for(int i = 0; i < (n - 1); i++){
                var takecount = i + 1;
                var remain = n - takecount;

                var leftsum = 0;
                for(int j = 0; j < takecount; j++){
                    leftsum = leftsum + list[j];
                }

                var rightsum = 0;
                for(int j = takecount; j < n; j++){
                    rightsum = rightsum + list[j];
                }

                var absv = Math.Abs(leftsum - rightsum);

                if (absv < minabs){
                    minabs = absv;
                }
            }

            Console.WriteLine(minabs);
        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N, M;

	cin >> N >> M;

	if (N == M) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


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

#define null               ""
#define endl               '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fr, to)    for (int i = fr; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 2e3;
bool g[nsz + 5][nsz + 5];
int n, m, pre[4][nsz + 5][nsz + 5], ans;

int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    cont (i, n) {
        string tmp;
        cin >> tmp;
        tmp = ' ' + tmp;
        cont (j, m) {
            if (tmp[j] != '.') {
                g[i][j] = 1;
            }
        }
    }
    cont (i, n) {
        cont (j, m) {
            pre[0][i][j] = g[i][j] ? 0 : pre[0][i - 1][j] + 1;
            pre[2][i][j] = g[i][j] ? 0 : pre[2][i][j - 1] + 1;
        }
    }
    for (int i = n; i >= 1; --i) {
        for (int j = m; j >= 1; --j) {
            pre[1][i][j] = g[i][j] ? 0 : pre[1][i + 1][j] + 1;
            pre[3][i][j] = g[i][j] ? 0 : pre[3][i][j + 1] + 1;
        }
    }
    cont (i, n) {
        cont (j, m) {
            ans = max(ans, pre[0][i][j] + pre[1][i][j] + pre[2][i][j] + pre[3][i][j] - 3);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 66944
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;


int main(void){
  int n,i,l[27]={};
  const int mod=1e9+7;
  string s;
  ll ans=1;
  
  cin >> n >> s;
  
  for (i=0;i<n;i++) l[s[i]-'a']++;
  
  for (i=0;i<26;i++) ans=ans*(l[i]+1)%mod;
  
  cout << ans-1 << endl;
  
  return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <string.h>

char str[200];

int main(void)
{
	int i, j;
	
	while (scanf("%s", str) != EOF){
		
		for (i = 0; i < strlen(str); i++){
			if (str[i] == '@' && ('1' <= str[i + 1] && str[i + 1] <= '9') ){
				for (j = 0; j < str[i + 1] - '0'; j++){
					printf("%c", str[i + 2]);
				}
				i += 2;
			}
			else printf("%c", str[i]);
		}
		printf("\n");
	}
	
	return (0);
}

Measured memory_bytes: 524
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
 
using namespace std;



int MOD=1000000007;
int main(void){
	string S;
	cin >> S;
	for(int i=0; i<S.size(); i++){
		cout << "x";
	}
	cout << endl;

}


Measured memory_bytes: 256
var
	N,i,j:Longint;
	ans:int64;
begin
	read(N);
	j:=round(sqrt(N));
	if j*j>N then dec(j);
	for i:=1 to j do inc(ans,(N div i)*(N div i+1)*i-i*i*i);
	writeln(ans);
end.

Measured memory_bytes: 1324
#include <stdio.h>

int main(void)
{
	int x=0,y=0,i=0;
	for(i=0;i<10000;i++)
	{
		scanf("%d %d",&x,&y);
		if(x==0&&y==0)
		{
			break;
		}
		else if(x<y)
		{
			printf("%d %d\n", x,y);
		}
		else
		{
			printf("%d %d\n", y,x);
		}
	}
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const LL mod = 1e9 + 7;
const int N = 100005;

int a[N], b[N];
int main() {
    int n, m, g;
    cin >> n >> m >> g;
    int ans = 0, t1 = INF, t2 = INF;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        t1 = min(a[i], t1);
    }
    for (int i = 1; i <= m; i++) {
        cin >> b[i];
        t2 = min(b[i], t2);
    }
    ans = t1 + t2;
    while (g--) {
        int x, y, z;
        cin >> x >> y >> z;
        ans = min(ans, a[x] + b[y] - z);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
N = int(input())
S = list(input())

we = []
west = 0
east = 0
for i in range(N):
    if S[i] == "W":
        west += 1
    elif S[i] == "E":
        east += 1
    we.append([west,east])

ans = 1e9
for i in range(N):
    if i == 0:
        left = 0
    else:
        left = we[i][0]
    right = we[N-1][1] - we[i][1]
    ans = min(ans,left+right)

print(ans)

Measured memory_bytes: 45688
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int k = sc.nextInt();

		long count=0;

		/*if(n==m) {
			System.out.println(n*2);
		}else {
			System.out.println(Math.max(n, m)+Math.max(n, m)-1);
		}*/

		System.out.println(k/n*m);
	}
}




Measured memory_bytes: 23892
from sys import stdin
f_i = stdin

N, M = map(int, f_i.readline().split())
A = list(map(int, f_i.readline().split()))

A.sort()

from bisect import bisect_left

def shake_count(power):
    return N ** 2 - sum(bisect_left(A, power - left_hand) for left_hand in A)

lower = A[0] * 2 - 1
upper = A[-1] * 2 + 1
while lower + 1 < upper:
    mid = (lower + upper) // 2
    if shake_count(mid) >= M:
        lower = mid
    else:
        upper = mid

X = tuple(bisect_left(A, upper - left_hand) for left_hand in A)

from itertools import accumulate
acc = tuple(accumulate([0] + A))

s = acc[-1]
ans = sum(s - acc[x] for x in X) + sum(a * (N - x) for a, x in zip(A, X))

rest_shake_count = M - (N ** 2 - sum(X))
ans += lower * rest_shake_count

print(ans)

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

#define int long long

vector<int>child,a;
map<int,vector<int>>g;

int dfs(int i){
	if(g[i].size()==0)return 1;
	for(auto j:g[i])child[i]++,dfs(j);
	return child[i];
}

signed main(){
	int n;
	cin>>n;
	child.assign(n,0);
	a.assign(n,0);
	for(int i=1;i<n;i++){
		cin>>a[i];
		--a[i];
		g[a[i]].push_back(i);
	}
	dfs(0);
	for(int i=0;i<n;i++)cout<<child[i]<<endl;
}


Measured memory_bytes: 46928
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
bool prime(int n){
	int flag=0;
  if(n==2 || n==3){
    return true;
  }
  else{
  	for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        flag=1;
        break;
      }
    }
  }
  	if(flag==0){
		return true;
    }
  else {
    return false;
	}	
}
int main(){
  int N;
  cin>>N;
  while(!prime(N)){
    N++;
  }
  cout<<N<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define REP(i, n) for(int i = 0;i < (n);i++)
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const int mod=1000000007;
const llint inf=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-10;
template <class T,class U>bool chmin(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool chmax(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(const vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(const vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}

int main(void){
	int n;cin>>n;
	llint ans=1;
	int S[3]={};
	while(n--){
		int A;cin>>A;
		int x=0;
		if(S[0]==A){x++;}
		if(S[1]==A){x++;}
		if(S[2]==A){x++;}
		ans*=x;ans%=mod;
		if(S[0]==A){S[0]++;}
		else if(S[1]==A){S[1]++;}
		else if(S[2]==A){S[2]++;}
	}
	cout<<ans<<endl;
}


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

using namespace std;

main(){
 	int a[4];
  
  	cin >> a[0] >> a[1] >> a[2];
  	sort(a , a + 3);
  	if(a[0] + a[1] == a[2])cout << "Yes" << endl;
 	 else cout << "No" << endl;
}

Measured memory_bytes: 256
from itertools import combinations as comb
import sys


def main():
    antennas = [int(input()) for _ in range(5)]
    k = int(input())

    pair_antenna = list(comb(antennas, 2))
    for pair in pair_antenna:
        diff = pair[1] - pair[0]
        if diff > k:
            print(":(")
            sys.exit(0)
    print("Yay!")


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    //final List<Integer> list = new ArrayList<>();
    //final List<Long> list2 = new ArrayList<>();

    long w = sc.nextLong();
    long h = sc.nextLong();
    long x = sc.nextLong();
    long y = sc.nextLong();

    long ans = w * h;
    System.out.print((double)ans / 2);
    if(w == x * 2 && h == y * 2){
        System.out.print(" " + 1);
    }else{
        System.out.print(" " + 0);
    }



    



   
    





}
}

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

int main()
{
	bool cek[200010];
	int i,j,k,n,m;
	vector<int> satu;
	cin>>n>>m;
	memset(cek,0,sizeof(cek));
	for (i=1;i<=m;i++)
	{
		cin>>j>>k;
		if (j==1)
		 satu.push_back(k);
		if (k==n)
		 cek[j]=1;
	}
	for (i=0;i<satu.size();i++)
	{
		if (cek[satu[i]])
		{
			cout<<"POSSIBLE\n";
			return 0;
		}
	}
	cout<<"IMPOSSIBLE\n";
}

Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using P = pair<int, int>;
const int inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9+7;
const ll MAX = 1e9+7;
template<typename T> T factorial(T n){
    if(n==1) return 1;
    else return n*factorial(n-1)%MOD;
}
template<typename T> T Pow(T x, T n, T m){
    if(n == 0) return 1;
    if(n % 2 == 0) return Pow(x * x % m, n / 2, m);
    else return x * Pow(x, n - 1, m) % m;
}
template<typename T> T combination(T n, T k, T m){
    return factorial<T>(n) * Pow<T>(factorial(k), m-2, m) % m * Pow<T>(factorial(n-k), m-2, m) % m;
}
struct edge{
    int to; // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using graph = vector<vector<edge>>;
using Graph = vector<vector<int>>;

int main(){
    int n, m;
    cin >> n >> m;
    double tmp;
    int ans = 0;
    double all_sum = 0;
    vector<double> a;
    rep(i, n){
        cin >> tmp;
        a.push_back(tmp);
        all_sum += tmp;
    }
    rep(i, n){
        if(a[i] >= (double)(all_sum / ((double)4.0 * m))) ans += 1;
    }
    if(ans >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 100000000
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < n; ++i)
#define out(x) cout << x << endl;
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(v) v.begin(), v.end()

using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;


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

	return a;
}


void ABC118C2() {
	int N;
	cin >> N;

	int attack;
	cin >> attack;

	for (int i = 0; i < N-1; i++)
	{
		int target;
		cin >> target;

		//体力の少ない方が攻撃をする
		if (attack > target) {
			swap(attack, target);
		}
		attack = gcd(attack, target);
	}

	out(attack);
}

int main() {
	ABC118C2();

	return 0;
}

Measured memory_bytes: 256
n, m = map(int,input().split())
h = list(map(int,input().split()))
miti = []
miti_w = []
miti_l = []
for i in range(m):
    miti.append(list(map(int,input().split())))
for i in range(m):
    if h[(miti[i][0]-1)] > h[(miti[i][1]-1)]:
        miti_l.append(miti[i][1])
    elif h[(miti[i][0]-1)] < h[(miti[i][1]-1)]:
        miti_l.append(miti[i][0])
    else:
        miti_l.append(miti[i][0])
        miti_l.append(miti[i][1])
for i in range(1,n+1):
    miti_w.append(i)
print(len(list(set(miti_w) - set(miti_l))))

Measured memory_bytes: 44808
#include <bits/stdc++.h>
#include <numeric>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;

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

    string S, T;
    cin >> S >> T;
    vector<int> charsS(26, 0), charsT(26, 0);
    rep(i, 0, S.size()) {
        ++charsS[S[i] - 'a'];
        ++charsT[T[i] - 'a'];
    }
    sort(charsS.begin(), charsS.end());
    sort(charsT.begin(), charsT.end());

    bool res = true;
    rep(i, 0, 26) {
        if (charsS[i] != charsT[i]) {
            res = false;
            break;
        }
    }

    cout << (res ? "Yes" : "No") << "\n";
}

Measured memory_bytes: 916
n = int(input())
s = input()
count = 0
ans = 0
for i in range(0, n - 1):
    x = list(s[:i + 1])
    y = list(s[i + 1:])
    for c in range(ord('a'), ord('z') + 1):
        if chr(c) in x and chr(c) in y:
            count += 1
    if ans < count:
        ans = count
    count = 0
print(ans)

Measured memory_bytes: 8956
import java.util.Scanner;

class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		for (int i = 0; i < str.length(); i++)
		{
			int a = str.charAt(i) - 'A';
			a -= 3;
			if (a < 0) a += 26;
			str.setCharAt(i, (char)(a + 'A')); 
		}
		System.out.println(str.toString());
	}
}

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

int main() {
  string s, t; cin >> s >> t;
  
  sort(s.begin(), s.end());
  sort(t.rbegin(), t.rend());
  
  if (s < t) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*) array, (T*) (array + N), val);
}
pii Dir [] = {
	{ 1,0 },{ 0,1 }
};
signed main() {
	char str [1001];
	scanf("%s", str);
	map<char, bool> c;
	REP(i, strlen(str)) {
		c[str[i]] = 1;
	}
	if (c['W'] == c['E'] && c['N'] == c['S'])
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 256
#include<iostream>

int b,r,g,c,s,t,ans;

int main(){
	while(true){
		std::cin >> b >> r >> g >> c >> s >> t;
		if(!b && !r && !g && !c && !s && !t)
			return 0;
		ans = 100 + (c*2+g*7+(r+b)*15+(3*r+5*b)*15) - ((t-s)*3-(5*b)-(3*r));
		std::cout << ans << std::endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

int main(){
  int n;
  cin>>n;
  int b[n];
  ll dp[n];
  for(int i=0;i<n;i++){
    cin>>b[i];
    dp[i]=inf;
  }
  dp[0]=0;
  dp[1]=abs(b[0]-b[1]);
  for(int i=2;i<n;i++){
    dp[i]=min(dp[i-2]+abs(b[i]-b[i-2]),dp[i-1]+abs(b[i-1]-b[i]));
  }
  cout<<dp[n-1]<<endl;
  return 0;
}



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

int main(void){
    string g;
    int y,m,d;
    while(cin>>g, g!="#"){
        cin>>y>>m>>d;
        if(!(y <= 30 || (y == 31 and m <= 4))){
            g = "?";
            y -= 30;
        }
        cout<<g<<" "<<y<<" "<<m<<" "<<d<<endl;
    }
}



Measured memory_bytes: 3156