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

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);   cout.tie(nullptr);
    if (ifstream("test.inp"))
    {
        freopen("test.inp", "r", stdin);
        #ifdef CHECKING
            freopen(taskname".out", "w", stdout);
        #else
            freopen("test.out", "w", stdout);
        #endif //CHECKING
    }
    else if (ifstream(taskname".inp"))
    {
        freopen(taskname".inp", "r", stdin);
        freopen(taskname".out", "w", stdout);
    }


    int n;  cin >> n;
    int d1[n + 10], d2[n + 10];
    bool ans = false;
    for (int i = 1; i <= n; ++i)
    {
        cin >> d1[i] >> d2[i];
        if (i >= 3)
        {
            if (d1[i - 2] == d2[i - 2] && d1[i - 1] == d2[i - 1] && d1[i] == d2[i]) ans = true;
        }
    }
    if (ans) cout << "Yes";
    else cout << "No";
}


Measured memory_bytes: 3624
#include<iostream>
#include<string>
using namespace std;
int main(){
long f=0;
string s;
string::size_type p,q=0;
getline(cin,s);
for(;;){
p=s.find_first_of(" .,",q);
if(2<p-q&&p-q<7){if(f==1)cout<<" ";cout<<s.substr(q,p-q);f=1;}
q=s.find_first_not_of(" .,",p);
if(q==string::npos)break;
}
cout<<endl;
return 0;
}

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

fn read<T: std::str::FromStr>() -> T {
    let stdin = stdin();
    let mut buf = String::new();
	stdin.lock().read_line(&mut buf);
	buf.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
	read::<String>().trim().split_whitespace()
        .map(|w| w.parse().ok().unwrap()).collect()
}

fn main() {
    let v = read_vec::<usize>();
    let (n,m) = (v[0],v[1]);
    let f1 = n==1;
    let f2 = m==1;
    let ans =
    if f1 && f2 {
        1
    }else if f1 {
        m-2
    }else if f2 {
        n-2
    }else{
        (n-2)*(m-2)
    };
    println!("{}",ans);
}


Measured memory_bytes: 4352
n,m=map(int,input().split())
a=[0]*n
for _ in range(m):
  l,r=map(int,input().split())
  a[l-1]+=1
  a[r-1]-=1
for i in range(n-1):
  a[i+1]+=a[i]
print(['YES','NO'][any([i%2 for i in a])])

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

int N;

int Linear_Search(int A[],int key){
  for(int i=0;i<N;i++)if(A[i] == key) return 1;
  return 0;
}


int main(){
  int T[100000];
  int q;
  int a;
  int sum=0;
  //cout<<"move"<<endl;
  cin>>N;
  for(int i=0;i<N;i++)cin>>T[i];
  cin>>q;
  for(int i=0;i<q;i++){
    cin>>a;
    sum += Linear_Search(T,a);
  }

  cout<<sum<<endl;

  return 0;

}
  

Measured memory_bytes: 3092
/**
 *    author:  RM07
 *    created: August 15, 2020 5:59 PM
 *    motto: Knowledge is Power, Strive for Excellence
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long 
signed main(){
    int x,k,d;
    cin >> x >> k >> d;
    x = abs(x);
    int count = x / d;
    count = min(count , k);
    k -= count;
    x = x - count * d;
    if(k) {
        if(k%2) {
            cout << min(abs(x + d), abs(x - d)) << endl;
        } else {
            cout << x << endl;
        }
    } else {
        cout << x << endl;
    }
}

Measured memory_bytes: 3616
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define SIZE 100005

using namespace std;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
long long int MOD = 1000000007;
int N;
vector<int> a[2];
int main()
{
	cin>>N;
	for(int j=0;j<2;j++){
		for(int i=0;i<N;i++){
			int aa;
			cin>>aa;
			a[j].pb(aa);
		}
	}
	int sum1[105],sum2[105];
	int sum=0;
	for(int i=0;i<N;i++){
		sum+=a[0][i];
		sum1[i]=sum;
		
	}
	sum=0;
	for(int i=N-1;i>=0;i--){
		sum+=a[1][i];
		sum2[i]=sum;
		//cout<<sum<<" ";
	}
	//cout<<endl;
	int ma=0;
	for(int i=0;i<N;i++){
		ma=max(ma,sum1[i]+sum2[i]);
	}
	cout<<ma<<endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
long long n,a,b,ans;
int main(){
	scanf("%lld%lld%lld",&n,&a,&b);
	if(b<a)putchar('0');
	else if(n==1&&a!=b)putchar('0');
	else if(n==1&&a==b)putchar('1');
	else printf("%lld",max(0ll,(n-2)*(b-a)+1));
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
int main(){
  cin >> n;
  ll ma = n;
  for(ll i=1 ; i*i<=n ; i++){
    if(n%i == 0){
      ma = min(ma, n/i + i - 2);
    }
  }
  cout << ma << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>

using namespace std;

static const int MAX = 100;
static const long long INFTY = (1LL<<32);

int n;
long long d[MAX][MAX];

void floyd(){
    for (int k=0;k<n;k++){
        for (int i=0;i<n;i++){
            if(d[i][k] == INFTY){
                continue;
            }
            for (int j=0;j<n;j++){
                if (d[k][j] == INFTY){
                    continue;
                }
                d[i][j] = min(d[i][j],d[i][k] + d[k][j]);
            }
        }
    }
}

int main() {
   
    int e,u,v,c;
    cin >> n >> e;
    for (int i=0;i<n;i++){
        for (int j=0;j<n;j++){
            d[i][j] = ((i==j) ? 0:INFTY);
        }
    }

    for (int i=0;i<e;i++){
        cin >> u >> v >> c;
        d[u][v] = c;
    }

    floyd();

    bool negative = false;
    for (int i=0;i<n;i++){
        if(d[i][i] < 0){
            negative = true;
        }
    }
    if(negative){
        cout << "NEGATIVE CYCLE" << endl;
    }else{
        for (int i=0;i<n;i++){
            for (int j=0;j<n;j++){
                if (j) cout << " ";
                if(d[i][j] == INFTY) cout << "INF";
                else cout << d[i][j];
            }
            cout << endl;
        }
    }


}


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

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n; --i)
#define INF (ll)1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define all(arr) arr.begin(),arr.end()

void boost(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

set<ll> ss,ss1;
vpll arr;

void solve(){
	int n;
	cin>>n;
	int x,y;
	fr(i,0,n){
		cin>>x>>y;
		arr.pb(mp(x,y));
	}
	sort(all(arr));
	ss.insert(arr[0].first-arr[0].second);
	ss1.insert(arr[0].first+arr[0].second);
	ll dist=-INF;
	fr(i,1,n){
		dist=max(arr[i].first+arr[i].second - (*ss1.begin()),dist);
		dist=max(arr[i].first-arr[i].second - (*ss.begin()),dist);
		ss.insert(arr[i].first-arr[i].second);
		ss1.insert(arr[i].first+arr[i].second);
	}
	cout<<dist<<endl;
	return;
}

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

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

long long lcm(long long a, long long b) {
  return a / __gcd(a, b) * b;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  set<int> se;
  for (auto&& e : a) {
    cin >> e;
    se.insert(__builtin_ctz(e));
  }
  if (se.size() > 1) {
    cout << "0\n";
    return 0;
  }
  int b = *begin(se);
  for (auto&& e : a) {
    e >>= b;
  }
  long long x = 1;
  for (int e : a) {
    x = lcm(x, e);
    if (x > m) {
      cout << "0\n";
      return 0;
    }
  }
  x <<= b - 1;
  long long lb = 1 + x, ub = m + x;
  lb = (lb + 2 * x - 1) / (2 * x);
  ub = ub / (2 * x);
  cout << ub - lb + 1 << '\n';
}


Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> H(N);
  rep(i,N) cin >> H[i];
  sort(H.rbegin(), H.rend());
  ll res = 0;
  for (int i = K; i < N; i++) {
    res += H[i];
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3568
#include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<set>
#include<cstring>
#include<map>
 
 
using namespace std;
#define int long long int
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define mp make_pair
#define pb push_back
#define mod 1000000007

double L;
signed main(){
    scanf("%lf",&L);
    double ans=(L/3.0)*(L/3.0)*(L/3.0);
    printf("%lf\n",ans);
    return 0;
}


Measured memory_bytes: 128
#include <bitset>
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N, M;
  cin >> N >> M;

  vector<vector<bool>> bulbs(M, vector<bool>(N, false));
  for (int m = 0; m < M; ++m) {
    int k;
    cin >> k;
    for (int i = 0; i < k; ++i) {
      int s;
      cin >> s;
      bulbs[m][--s] = true;
    }
  }
  vector<int> checks(M);
  for (int m = 0; m < M; ++m) {
    cin >> checks[m];
  }
  
  int res = 0;
  for (int i = 0; i < pow(2, N); ++i) {
    bitset<10> bs(i);
    vector<bool> switch_on(N, false);
    for (int j = 0; j < N; ++j) {
      switch_on[j] = bs.test(j);
    }
    bool success = true;
    for (int b = 0; b < M; ++b) {
      vector<bool> bulb = bulbs[b];
      int cnt_on = 0;
      for (int n = 0; n < N; ++n) {
        if (bulb[n] && switch_on[n]) {
           ++cnt_on;
        }
      }
      if (cnt_on % 2 != checks[b]) {
        success = false;
        break;
      }
    }
    if (success) {
      ++res;
    }
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 4028
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int D;
vector<int> C;
vector<vector<int>> S;

long long getTime() {
	timespec ts;
	clock_gettime(CLOCK_REALTIME_COARSE, &ts);
	long long r = ts.tv_sec;
	r *= 1000000000;
	r += ts.tv_nsec;
	return r;
}

ll calcScore(const vector<int>& T) {
	vector<int> last(26, -1);
	ll score = 0;
	for (int i = 0; i < D; ++ i) {
		int d = i - last[T[i]];
		score -= C[T[i]] * d * (d-1) / 2;
		last[T[i]] = i;
		score += S[i][T[i]];
	}
	for (int j = 0; j < 26; ++ j) {
		int d = D - last[j];
		score -= C[j] * d * (d-1) / 2;
	}
	return score;
}

int hoge(const vector<int>& T) {
	vector<int> last(26, -1);
	vector<ll> pena(26);
	for (int i = 0; i < D; ++ i) {
		last[T[i]] = i;
		for (int j = 0; j < 26; ++ j) {
			pena[j] += C[j] * (i - last[j]);
		}
	}
	int r = 0, cnt = 1;
	for (int j = 1; j < 26; ++ j) {
		if (pena[j] > pena[r]) {
			r = j; cnt = 1;
		} else if (pena[j] == pena[r]) {
			if (rand() % ++cnt == 0) { r = j; }
		}
	}
	return r;
}

int main() {
	auto startTime = getTime();

	cin >> D;
	C.resize(26);
	for (auto& x : C) cin >> x;
	S = vector<vector<int>>(D, vector<int>(26));
	for (auto& x : S) for (auto& y : x) cin >> y;

	vector<int> res(D);
	for (int i = 0; i < D; ++ i) {
		res[i] = 0;
		for (int j = 1; j < 26; ++ j) {
			if (S[i][j] > S[i][res[i]]) res[i] = j;
		}
	}

	for (int tt = 1; ; ++ tt) {
		int x = hoge(res);
		int ii = 0;
		ll m = -(1LL<<62);
		for (int i = 0; i < D; ++ i) {
			int tmp = res[i];
			res[i] = x;
			auto s1 = calcScore(res);
			if (s1 > m) {
				ii = i;
				m = s1;
			}
			res[i] = tmp;
		}
		if (res[ii] == x) break;
		res[ii] = x;
	}

	ll maxScore = calcScore(res);
	auto ans = res;

	auto s0 = maxScore;
	for (int tt = 1; ; ++ tt) {
		if (tt % 1024 == 0 && getTime() - startTime >= 1900000000) break;
		int i = rand() % D;
		int tmp = res[i];
		if (tt % 2 == 0) {
			res[i] = hoge(res);
		} else {
			res[i] = rand() % 26;
		}
		if (tmp == res[i]) continue;
		auto s1 = calcScore(res);
		if (s1 > maxScore) { maxScore = s1; ans = res; /*cerr << s1 << endl;*/ }
		if (s1 <= s0) {
			auto d = s0 - s1;
			if (rand() / (1.0 + RAND_MAX) < 1 - exp(-0.001 * d))
			{
				res[i] = tmp;
			} else {
				s0 = s1;
			}
		} else {
			s0 = s1;
		}
	}

	for (auto x : ans) cout << x + 1 << endl;
}


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


int main() {
    int N,K,ans;
    ans=300000000;
    cin >> N >> K;
    vector<int> line(N);
    for(int i=0; i<N;i++) cin >> line[i];

    for(int i=0; i<N-K+1; i++){
        int first,dist;
        first = min(abs(line[i]),abs(line[i+K-1]));
        dist = abs(line[i]-line[i+K-1]);
        ans=min(ans,first+dist);
    }

    cout << ans << endl;

    
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#define REP(i,a) for(int i = 0; i < (a); i++)
using namespace std;

int main(){
	int a,b,c,d,e;
	cin >> a >> b >> c >> d >> e;
	int min = 1e9;
	if(a % 10 != 0){
		if(a % 10 < min)min = a % 10;
		a += 10 - a % 10;
	}
	if(b % 10 != 0){
		if(b % 10 < min)min = b % 10;
		b += 10 - b % 10;
	}
	if(c % 10 != 0){
		if(c % 10 < min)min = c % 10;
		c += 10 - c % 10;
	}
	if(d % 10 != 0){
		if(d % 10 < min)min = d % 10;
		d += 10 - d % 10;
	}
	if(e % 10 != 0){
		if(e % 10 < min)min = e % 10;
		e += 10 - e % 10;
	}
	if(min != 1e9)cout << a + b + c + d + e - 10 + min << endl;
	else cout << a + b + c + d + e << endl;
}

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

int main(){
    int N;
    cin >> N;
    string s;
    cin >> s;
    map<string, int> cnt;
    cnt[s] = 1;

    for(int i = 1; i < N; i++){
        string t;
        cin >> t;
        if(cnt[t] || s.back() != t.front()){
            cout << "No" << endl;
            return 0;
        }
        cnt[t] = 1;
        s = string(t);
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 256
#define rep(i,n) REP(i,0,n)
#define REP(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

class store {
   public:
   int id = 0;
   string city = "";
   ll pnt = 0;
   store(){};
   store(int i, string s, ll p) {id=i;city = s;pnt=p;};
   bool operator<(const store &another) const
   {
      if (city != another.city) return city < another.city;
      else return pnt > another.pnt;
   };
};

int main(void) {
   ll N;
   cin>>N;
   vector<store> vS;
   rep(i,N) {
      string s;
      ll p;
      cin>>s>>p;
      vS.push_back(store(i+1,s,p));
   }
   sort(vS.begin(),vS.end());
   for (auto itr = vS.begin(); itr != vS.end();itr++) {
      // cout<<(*itr).city<<" "<<(*itr).pnt<<endl;
      cout<<(*itr).id<<endl;
   }
   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

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

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

signed main() {
  ll N;
  cin >> N;
  vll P(N);

  ll count = 0;
  rep(i, N) {
    ll p;
    cin >> p;
    if (p == i + 1) {
      continue;
    } else {
      count++;
    }
  }

  if (count == 0 || count == 2) {
    COUT("YES");
  } else {
    COUT("NO");
  }

  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc  = new Scanner(System.in);
    int a = sc.nextInt();//長身
    int b = sc.nextInt();//短針
    int h = sc.nextInt();//時間
    int m = sc.nextInt();//分

    double small = 30 * h + 30 * (double)m/60;
    double big = 360 * (double)m/60;

     // System.out.println(small);
     // System.out.println(big);

    double reg = small - big;
    if(reg>180){
      reg = 360 - reg;
    }else if(reg<-180){
      reg = reg + 360;
    }



    double ans = a*a + b*b - 2 * a * b * Math.cos(Math.toRadians(reg));
     ans = Math.sqrt(ans);
    System.out.println(ans);

  }
}

Measured memory_bytes: 36008
d,g = map(int,input().split())
P,C=[],[]
ans = 10**9
for i in range(d):
  p,c = map(int,input().split())
  P.append(p)
  C.append(c)

for i in range(2**d):
  score,solved_num,max_unsolve = 0,0,0
  for j in range(d):
    if i>>j&1:
      point = (j+1)*100
      simple_sum = point * P[j]
      add_bonus_sum = simple_sum + C[j]
      score += add_bonus_sum
      solved_num += P[j]
    else:
      max_unsolve = max(max_unsolve, j)
  if score >= g:
    ans = min(ans, solved_num)
  else:
    dif = abs(g-score)
    max_unsolve_point = (max_unsolve+1)*100
    nece_num = (dif+max_unsolve_point-1)//max_unsolve_point
    if nece_num<=P[max_unsolve]:
      ans = min(ans, solved_num+nece_num)
print(ans)


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

typedef long long LL;  
using namespace std;

#define fillchar(a, x) memset(a, x, sizeof(a))
#define MP make_pair
#define PB push_back
#define endl '\n'

const int M = (int)1e9+7;

int main()
{
//ios_base::sync_with_stdio(0); 
cout.precision(15);
cout.setf(ios::fixed);

string s;

cin >> s;

int n = s.size();

if(s[0]==s[n-1])
	{
	if(n%2==1)
		cout << "Second" << endl;
	else 	
		cout << "First" << endl;

	}
else
	{
	if(n%2==0)
		cout << "Second" << endl;
	else 	
		cout << "First" << endl;	

	}

}


Measured memory_bytes: 512
# -*- coding: utf-8 -*-
import sys

input()
l = list(map(lambda x: int(x), str(input()).split(" ")))
r = 1
finished = False

for i in l:
  if i == 0:
    print(str(0))
    sys.exit()
    
for i in l:
    r = r * i
    if r > 10 ** 18:
        print(str(-1))
        sys.exit()

print(str(r))


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

#define rep(i, N) for (ll i = 0; i < N; i++)
#define rep1(i, N) for (ll i = 1; i <= N; i++)
#define repr(i, N) for (ll i = N-1; i >= 0; i--)
#define repr1(i, N) for (ll i = N; i > 0; i--)

#define MOD 1000000007

using ll = long long;
using namespace std;

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<P> vpi;
typedef pair<ll,ll> Pl;
typedef vector<ll> vl;
typedef vector<Pl> vpl;

ll gcd(ll a, ll b){
    if(a < b) swap(a, b);
    if(b <= 0) return -1;
    ll r = a % b;
    while(r != 0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

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


int main() {
    int N;
    cin >> N;
    vi A(N), As(N), Ad(N);
    rep(i, N) cin >> A[i];
    rep(i, N){
        As[i] = i+1 + A[i];
        Ad[i] = (i+1) - A[i];
    }

    map<ll,ll> cns,cnd;

    rep(i, N){
        auto itrs = cns.find(As[i]);
        if(itrs != cns.end()){
            cns[As[i]]++;
        } else {
            cns[As[i]] = 1;
        }
        if(Ad[i] > 0) {
            auto itrd = cnd.find(Ad[i]);
            if(itrd != cnd.end()){
                cnd[Ad[i]]++;
            } else {
                cnd[Ad[i]] = 1;
            }
        }
    }

    ll ans = 0;
    auto itr = cns.begin();
    while(itr != cns.end()){
        auto itrd = cnd.find(itr->first);
        if(itrd != cnd.end()){
            ans += (itr->second)*(itrd->second);
        }
        itr++;
    }
    

    //string ans = ( flag ? "Yes" : "No" );
    //printf("%.8lf", ans);
    cout << ans;
    cout << "\n";
    return 0;
}


Measured memory_bytes: 21584
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
  map<string,ll> a;
  ll n;
  cin>>n;
  for(ll i=0;i<n;i++){
   string s;
   cin>>s;
   a[s]--;
  }
  vector<pair<ll,string> > b;
  for(auto i:a){
   b.push_back( pair<ll,string>( i.second , i.first ) );
  }
  sort(b.begin() , b.end() );
  ll cnt = b[0].first;
  for(auto i:b){
   if( cnt != i.first ) break;
  cout<<i.second<<endl;
  }
  return 0;
}


Measured memory_bytes: 29300
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
#include <numeric>
#include <queue>
#include <set>

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

using namespace std;

typedef long long ll;

int main(int argc, char const *argv[])
{
  ll n;
  cin >> n;
  vector<ll> x(n), y(n);
  REP(i, n)
  {
    cin >> x[i] >> y[i];
  }
  vector<vector<pair<ll, ll>>> d(n, vector<pair<ll, ll>>(n));

  REP(i, n)
  {
    REP(j, n)
    {
      if (i == j)
        continue;
      d[i][j] = {x[j] - x[i], y[j] - y[i]};
    }
  }
  set<pair<ll, ll>> s;
  map<pair<ll, ll>, ll> m;
  REP(i, n)
  {
    REP(j, n)
    {
      if (i == j)
        continue;
      s.insert(d[j][i]);
    }
    for (auto hoge : s)
    {
      if (m[hoge] == 0)
      {
        m[hoge] = 1;
      }
      else
      {
        m[hoge]++;
      }
    }
    s.clear();
  }
  ll res = 0;
  for (auto itr = m.begin(); itr != m.end(); ++itr)
  {
    res = max(res, itr->second);
  }
  cout << n - res << endl;
  return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> L(N);
  for(int i=0; i<N; i++) cin >> L.at(i);
  sort(L.begin(),L.end());
  
  int count=0;
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      for(int k=j+1; k<N; k++){
        if( L.at(i) + L.at(j) > L.at(k) ){
          count++;
        }
      }
    }
  }
  cout << count << endl;
}



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





int main()
{
	  	ll n,a[200001],i,j,ans=0;
	  	cin>>n;
        for(i=0;i<n;i++)
        cin>>a[i];
        for(i=0;i<(n-1);i++)
        {
          for(j=i+1;j<n;j++)
          {
            ans=ans+(a[i]*a[j]);
          }
        }
        cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int k;
  cin >> k;
  
  int ans = 0;
  
  int m = 0;
  
  for (int a = 1; a <= k; a++){
    for (int b = 1; b <= k; b++){
      for (int c = 1; c <= k; c++){
        int x;
        x = min(a, min(b, c));
        for (int i = 1; i <= x; i++){
          if (a % i == 0 && b % i == 0 && c % i == 0){
            m = i;
          }
        }
        ans += m;
        m = 0;
      }
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

ll N;
// next, cost
vector<pair<ll, ll> > to[100005];

#define SIRO 1
#define KURO 2

ll ans[100005];

void dfs(ll pa, ll cur, ll color) {
	ans[cur] = color;
	for(pair<ll, ll> next: to[cur]) {
		if(pa == next.first) continue;
		if(next.second % 2 == 0) {
			dfs(cur, next.first, color);
		} else {
			ll nc;
			if(color == KURO) {
				nc = SIRO;
			} else {
				nc = KURO;
			}
			dfs(cur, next.first, nc);
		}
	}
}


int main(){
	cin >> N;
	rep(i, N - 1) {
		ll u, v, w;
		cin >> u >> v >> w;
		u--;v--;
		to[u].push_back(make_pair(v, w));
		to[v].push_back(make_pair(u, w));
	}

	dfs(-1, 0, KURO);



	rep(i, N) {
		if(ans[i] == SIRO) {
			cout << 0 << endl;
		} else {
			cout << 1 << endl;
		}
	}


}


Measured memory_bytes: 14080
#include<stdio.h>
#include<math.h>

typedef struct P { double x, y; } Point;

void koch(int n, Point a, Point b){
  Point s, t, u;
  double th = M_PI * 60.0 / 180.0;
  
  if( n == 0 ) return;

  s.x = ( 2.0 * a.x + 1.0 * b.x ) / 3.0;
  s.y = ( 2.0 * a.y + 1.0 * b.y ) / 3.0;
  t.x = ( 1.0 * a.x + 2.0 * b.x ) / 3.0;
  t.y = ( 1.0 * a.y + 2.0 * b.y ) / 3.0;
  u.x = ( t.x - s.x ) * cos(th) - ( t.y - s.y ) * sin(th) + s.x;
  u.y = ( t.x - s.x ) * sin(th) + ( t.y - s.y ) * cos(th) + s.y;

  koch(n-1, a, s);
  printf("%.8f %.8f\n", s.x, s.y);
  koch(n-1, s, u);
  printf("%.8f %.8f\n", u.x, u.y);
  koch(n-1, u, t);
  printf("%.8f %.8f\n", t.x, t.y);
  koch(n-1, t, b);
}

int main(){
  Point a, b;
  int n;

  scanf("%d", &n);

  a.x = 0;
  a.y = 0;
  b.x = 100;
  b.y = 0;

  printf("%.8f %.8f\n", a.x, a.y);
  koch(n, a, b);
  printf("%.8f %.8f\n", b.x, b.y);

  return 0;
}



Measured memory_bytes: 2052
l,m,n=map(int,input().split())
A=[]
B=[]
C=[[0 for _ in range(n)] for _ in range(l)]
for _ in range(l):
	A.append(input().split())

for _ in range(m):
	B.append(input().split())

for i in range(l):
	for j in range(n):
		s=0
		for k in range(m):
			s+=int(A[i][k])*int(B[k][j])
		C[i][j]=s
#print(C)
for i in range(l):
	print(" ".join(map(str,C[i])))

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

using namespace std;

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

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

ll A[100005];

struct Combination {
    Combination(ll n) {
        mNumTbl.resize(n + 1);
        mInverseNumTbl.resize(n + 1);
        mNumTbl[0] = 1;
        mInverseNumTbl[0] = 1;
        FOR(i, n + 1, 1) {
            mNumTbl[i] = (mNumTbl[i - 1] * i) % MOD;
        }
        FOR(i, n + 1, 1) {
            mInverseNumTbl[i] = modpow(mNumTbl[i]);
        }
    }

    ll get(ll n, ll r) {
        if (n < r || n < 0)
            return 0;
        return (((mNumTbl[n] * mInverseNumTbl[r]) % MOD) * mInverseNumTbl[n - r]) % MOD;
    }

    ll modpow(ll n) {
        ll s = 1, p = n;
        for (ll i = 0; (1LL << i) <= MOD - 2; ++i, p = (p * p) % MOD) {
            if (((MOD - 2) & (1 << i)) == 0)
                continue;
            s *= p;
            s %= MOD;
        }
        return s;
    }

    vector<ll> mInverseNumTbl;
    vector<ll> mNumTbl;
};

int main() {
    ll N, K;
    cin >> N >> K;

    Combination cmb(N + 5);
    REP(i, N) {
        cin >> A[i];
    }
    sort(A, A + N);

    ll ans = 0;
    FOR(i, N, K - 1) {
        ans = (ans + A[i] * cmb.get(i , K - 1)) % MOD;
    }
    REP(i, N - K + 1) {
        ans = (ans + MOD - (A[i] * cmb.get(N - i - 1, K - 1)) % MOD) % MOD;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
using namespace std;
void swapdomya(int* x, int* y);

int main(void)
{
    int a, b, c;
    cin >> a >> b >> c;
    
    if(a > b) swapdomya(&a, &b);
    if(b > c) swapdomya(&b, &c);
    if(a > b) swapdomya(&a, &b);

    cout << a << " " << b << " " << c << endl;

    return 0;
}

void swapdomya(int* x, int* y)
{
    int temp = *x;
    *x = *y;
    *y = temp;
}

Measured memory_bytes: 1164
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <list>
#include <bitset>
#include <vector>
using namespace std;

#define I64d_OJ

//#ifdef I64d_OJ
//#define LL __int64
//#endif // I64d_OJ
#ifdef I64d_OJ
#define LL long long
#endif // I64d_OJ

typedef unsigned LL ULL;
typedef unsigned uint;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;
typedef vector<int> vi;

inline int read(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-f; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}

#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define ls rt<<1
#define rs rt<<1|1
#define MID(a,b) (((LL)(a)+(LL)(b))>>1)
#define absx(a) ((a)<0?-(a):(a))
#define MK(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define lowbit(x) ((x)&-(x))

#define lc c[x][0]
#define rc c[x][1]

template< typename T >
inline void Max(T &a,T &b){if(a<b) a=b;}
template< typename T>
inline void Min(T &a,T &b){if(a>b) a=b;}

const double pi=(double)acos(-1.0);
const double eps=(double)1e-8;
const int INF = (int) 0x3f3f3f3f;
const int MOD = (int) 1e9+7;
const int MAXN =(int) 2e5+10;
const int MAXM = (int) 3e6+10;

///--------------------START-------------------------
int M,N;

void work(){
    scanf("%d%d",&N,&M);
    if(N%2==1){
        for(int i=1;i<=M;i++){
            printf("%d %d\n",i,N+1-i);
        }
    }
    else{
        int oddl,oddst=1;
        if(M&1) oddl=M;
        else oddl=M-1;
        for(int i=2;i<=M;i+=2){
//            printf("i = %d , oddl = %d\n",i,oddst);
            oddst=i/2+1;
            printf("%d %d\n",i/2,N-i/2);
        }
        for(int i=1;i<=M;i+=2){
            printf("%d %d\n",oddst,oddst+oddl);
            oddst++;
            oddl-=2;
        }
    }
}

///--------------------END-------------------------
int main(){
#ifdef NNever
//freopen("data.in","r",stdin);
///freopen("out.txt","w",stdout);
#endif // NNever
    work();
    return 0;
}









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

using namespace std;

typedef pair<int, int> P;
#define int long long
#define ll long long
#define mod 1000000007
#define INF (1LL<<60)


int yakusu[100];

signed main(){

	int N;
	cin >> N;

	for (int i = 1; i <= N; i++){
		int t = i;
		for (int y = 2; y <= 100; y++){
			while (t%y == 0){
				yakusu[y]++;
				t /= y;
			}
		}
	}

	int ans = 0;
	int prime[25] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, \
	47, 53, 61, 67, 71, 73, 83, 97 };


	if (yakusu[2] >= 74) ans++;

	// 25個から2個をとる
	for (int p = 0; p < 25; p++){
		for (int q = p + 1; q < 25; q++){
			// 3*25の場合 (2, 24)
			if (yakusu[prime[p]] >= 2 && yakusu[prime[q]] >= 24){
				ans++;
			}
			if (yakusu[prime[p]] >= 24 && yakusu[prime[q]] >= 2){
				ans++;
			}
			// 5*15の場合(4,14)
			if (yakusu[prime[p]] >= 4 && yakusu[prime[q]] >= 14){
				ans++;
			}
			if (yakusu[prime[p]] >= 14 && yakusu[prime[q]] >= 4){
				ans++;
			}
		}
	}

	// 25個から3個をとる
	for (int p = 0; p < 25; p++){
		for (int q = p + 1; q < 25; q++){
			for (int r = q + 1; r < 25; r++){
				// 3*5*5の場合 (2,4,4)
				if (yakusu[prime[p]] >= 2 && yakusu[prime[q]] >= 4 && yakusu[prime[r]] >= 4){
					ans++;
				}
				if (yakusu[prime[p]] >= 4 && yakusu[prime[q]] >= 2 && yakusu[prime[r]] >= 4){
					ans++;
				}
				if (yakusu[prime[p]] >= 4 && yakusu[prime[q]] >= 4 && yakusu[prime[r]] >= 2){
					ans++;
				}
			}
		}
	}
	cout << ans << endl;



	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define db double
#define pint pair<int,int>
#define mk(x,y) make_pair(x,y)
#define fir first
#define sec second
#define Rep(x,y,z) for(int x=y;x<=z;x++)
#define Red(x,y,z) for(int x=y;x>=z;x--)
using namespace std;
const int MAXN=55,INF=1e9;
char buf[1<<12],*pp1=buf,*pp2=buf,nc;int ny;
inline char gc() {return pp1==pp2&&(pp2=(pp1=buf)+fread(buf,1,1<<12,stdin),pp1==pp2)?EOF:*pp1++;}
//inline char gc(){return getchar();}
inline int read(){
	int x=0;for(ny=1;nc=gc(),(nc<48||nc>57)&&nc!=EOF;)if(nc==45)ny=-1;if(nc<0)return nc;
	for(x=nc-48;nc=gc(),47<nc&&nc<58&&nc!=EOF;x=(x<<3)+(x<<1)+(nc^48));return x*ny;
}
vector<int>G1[MAXN],G2[MAXN],G3[MAXN],G4[MAXN];queue<int>q;
int n,d1[MAXN],d2[MAXN],p1[MAXN],p2[MAXN],deg[MAXN];
void dfs1(int x){for(int i=0,len=G2[x].size(),y;i<len;i++)if((y=G2[x][i])!=p1[x])p1[y]=x,dfs1(y);}
void dfs2(int x){for(int i=0,len=G3[x].size(),y;i<len;i++)if((y=G3[x][i])!=p2[x])p2[y]=x,dfs2(y);}
inline int Solve(int n,int rt){
	p1[rt]=p2[rt]=0,dfs1(rt),dfs2(rt);int s=0;
	Rep(i,1,n)G4[i].clear();memset(deg,0,sizeof(deg));
	Rep(i,1,n)if(p1[i]==p2[i]&&p1[p1[i]]!=p2[p1[i]])return INF;
	Rep(i,1,n)if(p1[i]!=p2[i]){
		s++;
		for(int j=0,len=G2[i].size(),y;j<len;j++)if((y=G2[i][j])!=p1[i])G4[y].push_back(i),deg[i]++;
		for(int j=0,len=G3[i].size(),y;j<len;j++)if((y=G3[i][j])!=p2[i])G4[i].push_back(y),deg[y]++;
	}Rep(i,1,n)if(!deg[i])q.push(i);
	for(int x;!q.empty();q.pop()){
		x=q.front();
		for(int i=0,len=G4[x].size(),y;i<len;i++)(!--deg[y=G4[x][i]])?q.push(y),0:0;
	}Rep(i,1,n)if(deg[i])return INF;return s;
}
int main(){
	for(int t=read();t--;){
		memset(d1,0,sizeof(d1)),memset(d2,0,sizeof(d2)),n=read();
		Rep(i,1,n)G1[i].clear(),G2[i].clear();
		Rep(i,1,n-1){int x=read(),y=read();G2[x].push_back(y),G2[y].push_back(x),d1[x]++,d1[y]++;}
		Rep(i,1,n-1){int x=read(),y=read();G1[x].push_back(y),G1[y].push_back(x),d2[x]++,d2[y]++;}
		Rep(i,1,n)G3[i]=G1[i];int ans=INF;Rep(i,1,n)ans=min(ans,Solve(n,i));
		if(ans==INF){
			Rep(i,1,n)if(d2[i]==1)Rep(j,1,n)if(j!=i){
				Rep(k,1,n)if(k!=i){G3[k].clear();for(int l=0,len=G1[k].size(),y;l<len;l++)if((y=G1[k][l])!=i)G3[k].push_back(y);}
				G3[j].push_back(i),G3[i].clear(),G3[i].push_back(j),ans=min(ans,Solve(n,i)+1);
			}
		}if(ans<INF)cout<<ans<<'\n';else puts("-1");
	}
	return 0;
}




Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
long long MOD=998244353;
long long fac[200005], inv[200005];
long long modpow(long long x,long long e){
	if(x==1||e==0) return 1;
	long long c=modpow(x,e/2);
	long long c1=(c*c)%MOD;
	if(e%2==0) return c1;
	else return (c1*x)%MOD;
}
long long choose(long long n, long long k){
	if(k>n) return 0;
	return ((fac[n]*inv[k])%MOD*inv[n-k])%MOD;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	fac[0]=inv[0]=1;
	for(int i=1;i<200005;i++){
		fac[i]=(fac[i-1]*i)%MOD;
		inv[i]=(inv[i-1]*modpow(i, MOD-2))%MOD;
	}
	long long ans=0;
	long long n, m, k;
	cin>>n>>m>>k;
	for(int i=0;i<=k;i++){
		long long add=((m*choose(n-1, i))%MOD*modpow(m-1, n-i-1))%MOD;
		//cout<<add<<endl;
		ans=(ans+add)%MOD;
	}
	cout<<ans;
}

Measured memory_bytes: 6712
from collections import deque, Counter
import sys

N_MAX = 100000 + 5
sys.setrecursionlimit(N_MAX)

N, M, K = map(int, sys.stdin.readline().rstrip().split())

fr = [[] for _ in range(N)]  # 友達関係
for _ in range(M):
    a, b = map(int, sys.stdin.readline().rstrip().split())
    fr[a - 1].append(b - 1)
    fr[b - 1].append(a - 1)

bl = [[] for _ in range(N)]  # ブロック関係
for _ in range(K):
    a, b = map(int, sys.stdin.readline().rstrip().split())
    bl[a - 1].append(b - 1)
    bl[b - 1].append(a - 1)


gr = [0] * N  # 友達候補グループ


# ## BFS ## #
def bfs(u, num):

    q = deque()
    q.append(u)
    gr[u] = num
    while q:
        u = q.popleft()
        for v in fr[u]:
            if gr[v] == 0:  # state を確認
                gr[v] = num  # state を変更
                q.append(v)


num = 1
for i in range(N):
    if gr[i] == 0:
        bfs(i, num)
        num += 1

# print(gr)

gr_num = Counter(gr)  # グループの人数を数えておく


# グループの中から、友達でも
ans = []
for i in range(N):
    kouho_suu = gr_num[gr[i]]
    for f in fr[i]:
        if gr[i] == gr[f]:
            kouho_suu -= 1
    for b in bl[i]:
        if gr[i] == gr[b]:
            kouho_suu -= 1
    kouho_suu -= 1

    ans.append(kouho_suu)

print(*ans)

Measured memory_bytes: 52584
package main
import (
    "fmt"
)

func min (a int,b int) int {
    if a < b {
        return a
    }
    return b
}

func div2 (x int) int {
    ans := 0
    for x % 2 == 0 {
        x /= 2
        ans ++
    }
    return ans
}

func main(){
    var n int
    fmt.Scan(&n)
    arr := make([]int, n)
    for i := range(arr) {
        fmt.Scan(&arr[i])
    }
    var ans int
    ans = 1e9
    for _, e := range arr {
        ans = min(ans, div2(e))
    }
    fmt.Println(ans)
}

Measured memory_bytes: 1780
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main()
{
    string s,t;
    cin>>s>>t;
    map<char,char> mp,gorl;
    for(unsigned int i=0;i<s.size();i++)
    {
        if(mp[s[i]]>='a'&&mp[s[i]]<='z')
        {
            if(mp[s[i]]!=t[i])
            {
                cout<<"No";
                return 0;
            }
        }
        if(gorl[t[i]]>='a'&&gorl[t[i]]<='z')
        {
            if(gorl[t[i]]!=s[i])
            {
                cout<<"No";
                return 0;
            }
        }
        mp[s[i]]=t[i];
        gorl[t[i]]=s[i];
    }
    cout<<"Yes";
}

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

int main() {
  char A;
  cin >> A;
  if(A == 'T'){
    cout << 'A' << endl;
  }
  else if(A == 'A'){
    cout << 'T' << endl;
  }
  else if(A == 'G'){
    cout << 'C' << endl;
  }
  else{
    cout << 'G' << endl;
  }
}


Measured memory_bytes: 3584
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<ctime>
#include<vector>
#include<queue>
#include<map>
#include<deque>
#include<stack>
#include<algorithm>
#define N
using namespace std;
const int INF=0x7fffffff;
const double Pi=acos(-1);
int main()
{
	int i,n;
	scanf("%d",&n);
	if(n%2==0)printf("%d\n",n);
	else printf("%d\n",n*2);
	return 0;
}


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

int dp[100010][3];
int a[100010],b[100010],c[100010];
int main(){
  int N; cin>>N;
  for(int i=0;i<N;i++)
    cin>>a[i]>>b[i]>>c[i];
  dp[0][0] = a[0];
  dp[0][1] = b[0];
  dp[0][2] = c[0];
  for(int i=1;i<N;i++){
    dp[i][0] += a[i] + max(dp[i-1][1],dp[i-1][2]);
    dp[i][1] += b[i] + max(dp[i-1][2],dp[i-1][0]);
    dp[i][2] += c[i] + max(dp[i-1][0],dp[i-1][1]);
  }
  int ans = 0;
  for(int i=0;i<3;i++)
    ans = max(ans,dp[N-1][i]);
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 2560
#include <stdio.h>

int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    
    int temp = b - a;
    int b_height = 0;
    int i;
    for(i=1;i<=temp;i++) b_height += i; 
    printf("%d", b_height - b);
    
    return 0;
}

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

#define TR 100005

using namespace std;

long long b[TR][3], a[TR][3];

long long solve(int day, int k) {
	if(b[day][k] != -1)
		return b[day][k];
	b[day][k] = max(solve(day - 1, (k + 1) % 3), solve(day - 1, (k + 2) % 3)) + a[day][k];
	return b[day][k];
}

int main() {
	int n;
	cin >> n;
	for(int i = 0 ; i < n ; i++)
		cin >> a[i][0] >> a[i][1] >> a[i][2];
	for(int i = 0 ; i < n ; i++)
		b[i][0] = b[i][1] = b[i][2] = -1;
	b[0][0] = a[0][0];
	b[0][1] = a[0][1];
	b[0][2] = a[0][2];
	solve(n - 1, 0);
	solve(n - 1, 1);
	solve(n - 1, 2);

	// for(int i = 0 ; i < n ; i++)
		// printf("%d %d %d\n", b[i][0], b[i][1], b[i][2]);
	cout << max(b[n - 1][0], max(b[n - 1][1], b[n - 1][2])) << endl;
}

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

  auto a=readln.split.to!(int[]);

  sort(a);
  int cnt=0;
  while(a[0]+2<=a[2]) a[0]+=2, cnt++;
  while(a[1]+2<=a[2]) a[1]+=2, cnt++;
  sort(a);
  assert(a[2]-a[0]<=1);

  int ad=0;
  if(a[0]==a[1] && a[1]==a[2]) ad=0;
  else if(a[0]==a[1]) ad=1;
  else if(a[1]==a[2]) ad=2;

  writeln(cnt+ad);
}

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
main = do
  inputs <- map(read::[Char]->Int) <$> words <$> getLine
  let a = head inputs
      b = last inputs
  putStr $ judge a b

judge::Int->Int->String
judge x y | x <= 0 && y >= 0 = "Zero"
          | x > 0 && y > 0 = "Positive"
          | odd (min y 0 - x) = "Positive"
          | otherwise = "Negative"
            where a = mod 2 $ abs x - abs y

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

using namespace std;
typedef long long ll;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const int INF = 1000000;
const double PI=3.14159265359;


int main(){

  int x;cin>>x;

  int sum=0;


  for(int i=1;i<=1000;i++){
    // cout<<100*i<<"-"<<105*i<<endl;
    if(100*i<=x&&x<=105*i){
      out(1);
      return 0;
    }
  }

  out(0);



  // for(int i=0;sum<=x;i++){
  //   for()
  // }


  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#define mod 998244353
#define point complex<double>
#define pi acos(-1)
#define pb push_back


typedef long long ll;
typedef long double ld;

using namespace std;

void Fastio(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

int main()
{
    Fastio();
    int ttt=1; //cin>>ttt;
    while(ttt--){
        ll n, arr[105][11], p[105][12];
        cin>>n;
        for(int i=0; i<n; i++){
            for(int y=0; y<10; y++){
                cin>>arr[i][y];
            }
        }
        for(int i=0; i<n; i++)
            for(int y=0; y<=10; y++){cin>>p[i][y];}
        ll res=-1e18;
        for(int i=1; i<=(1<<10)-1; i++){
            ll ans=0;
            for(int y=0; y<n; y++){
                int c=0;
                for(int j=0; j<10; j++){
                    if(!arr[y][j] || (i>>j)%2==0)continue;
                    c++;
                }
                ans+=p[y][c];
            }
            res=max(res, ans);
        }
        cout<<res<<'\n';
    }

    return 0;
}


Measured memory_bytes: 3672
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
using ull=unsigned long long;
constexpr auto inf=static_cast<ll>(1e18);
template<typename T=ll>inline T in(){T ret;cin>>ret;return ret;}
template<typename T=ll>inline auto vec2(size_t h,size_t w,T v=T()){return vector<vector<T>>(h,vector<T>(w,v));}
inline void setp(int n){cout<<fixed<<setprecision(n);}
inline void delnl(){cin.ignore(numeric_limits<streamsize>::max(),'\n');}

template<ull mod,ull phi_mod=mod-1>
class basic_mod_int{
    private:
        using mod_int=basic_mod_int<mod,phi_mod>;
        ull num;
        static ull pow_mod(ull x,ull y){x%=mod;return(y==0?1:y%2==0?pow_mod(x*x%mod,y/2):x*pow_mod(x,y-1))%mod;}
    public:
        basic_mod_int()=default;
        basic_mod_int(ull num):num(num%mod){}
        explicit operator ull()             const{return num;}
        bool    operator==(const mod_int&mi)const{return num==mi.num;}
        bool    operator!=(const mod_int&mi)const{return !operator==(mi);}
        mod_int operator~ ()                const{return pow_mod(num,phi_mod-1);}
        mod_int operator+ (const mod_int&mi)const{return num+mi.num;}
        mod_int operator- (const mod_int&mi)const{return num-mi.num+mod;}
        mod_int operator* (const mod_int&mi)const{return num*mi.num;}
        mod_int operator/ (const mod_int&mi)const{return num*(~mi).num;}
        mod_int&operator= (const mod_int&mi)     {num=mi.num;       return*this;}
        mod_int&operator+=(const mod_int&mi)     {*this=operator+(mi);return*this;}
        mod_int&operator-=(const mod_int&mi)     {*this=operator-(mi);return*this;}
        mod_int&operator*=(const mod_int&mi)     {*this=operator*(mi);return*this;}
        mod_int&operator/=(const mod_int&mi)     {*this=operator/(mi);return*this;}
};
using mod_int=basic_mod_int<1000000007>;
mod_int factorial_mod(ull n)
{
    mod_int ret=1;
    for(ull i=1;i<=n;++i){
        ret*=i;
    }
    return ret;
}
int main()
{
    ll x=in(),y=in();
    if((2*y-x)%3!=0||(2*x-y)%3!=0){
        cout<<0<<endl;
    }else{
        ll a=(2*y-x)/3,b=(2*x-y)/3;
        if(a<0||b<0){
            cout<<0<<endl;
            return 0;
        }
        cout<<(ull)(factorial_mod(a+b)*~(factorial_mod(a)*factorial_mod(b)))<<endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define llu unsigned long long
#define pb push_back
#define ll long long
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fs(s) for(ll i=0;s[i]!='\0';i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define gcd(a,b) __gcd(a,b)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define c1(x) __builtin_popcountll(x)
#define setprs(x) cout << fixed << setprecision(x);
#define endl '\n'
const ll mod=1000000007;
const ll sz=2e5+100;
const double PI =3.14159265;
ll power(ll a, ll b, ll m = mod){if(b==0)return 1;else if(b==1)return a%m;else{ll t=power(a,b>>1,m);t=((t%m)*(t%m))%m;if(b&1)return ((t%m)*(a%m))%m;else return t%m;}}
 
//--------------------------------------------------------

void solve()
{
    string s, t;
    cin >> s >> t;
    int c = 0;
    int ans = 0;
    f(i,0,s.length() - t.length() + 1){
        c = 0;
        f(j,0,t.length()){
            if(s[i+j] == t[j]){
                c ++;
            }
        }
        // cout << c << " ";
        ans = max(ans, c);
    }
    ans = t.length() - ans;
    cout << ans;

} 
 
int32_t main()
{
    fastio
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t=1;
    //cin>>t;
    while(t--){
        solve();
        cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 3652
# D - Multiple of 2019

from collections import Counter

s = input()

count = 0
counter = Counter([0])

suffix = [0] * (len(s) + 1)
pow = 1
for i in range(len(s) - 1, -1, -1):
    suffix[i] = (int(s[i]) * pow + suffix[i + 1]) % 2019
    pow = pow * 10 % 2019
    count += counter[suffix[i]]
    counter[suffix[i]] += 1

print(count)


Measured memory_bytes: 16500
#include <bits/stdc++.h>
using namespace std;
#define ll long long int 
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mx *max_element
#define mn *min_element
#define fo(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define rfo(i,n) for(ll i=n-1;i>=0;i--)
#define rloop(i,a,b) for(ll i=a;i>=b;i--)
#define all(x) x.begin(),x.end()
#define sortall(x) sort(all(x))
#define precision cout<<fixed<<setprecision(10)
#define mem(x,p) memset(x,p,sizeof(x))
#define w(t) ll t;cin>>t;while(t--)
#define kk "\n"
#define setbits(x) __builtin_popcountll(x)
const double pi=3.1415926535897932384626;
//const ll mod = 998244353;
const ll mod=1e9+7;
int main()
{
  IOS
  ll a,b;
  cin>>a>>b;
  cout<<a*b;
  return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rep3(i, n) for (int i = 1; i < (int)(n+1); i++)
#define rep4(i, s, n) for (int i = (s); i < (int)(n+1); i++)
#define repr(i,n) for (int i = (n-1); i>=0;i--)
#define repr3(i,n) for(int i = (n);i>0;i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
#define INF const ll INF = 1001001001;
#define PI const ld PI = 3.14159265358979323846;


int main() {
    int N,all,odd=1;
    cin>>N;
    int A[101];
    rep(i,N){
        cin>>A[i];
    }
    all=pow(3,N);
    rep(i,N){
        if(A[i]%2==0){
            odd*=2;

        }
        

    }
    cout<<(all-odd)<<endl;


return 0;
}

Measured memory_bytes: 256