akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
long long sum[100100];
long long cost[100100];
int to[100100];
long long K;
long long count(int x)
{
	int it=0;
	int now=x;
	while(true)
	{
		now=to[now];
		it++;
		sum[it]=sum[it-1]+cost[now];
		if(now==x)
			break;
	}
	if(K<=it)
	{
		return *max_element(sum+1,sum+K+1);
	}
	else
	{
		if(sum[it]<=0)
		{
			return *max_element(sum+1,sum+it+1);
		}
		else
		{
			int x1=K/it,x2=K%it;
			return max(x1*sum[it]+*max_element(sum,sum+x2+1),(x1-1)*sum[it]+*max_element(sum+(x1==1),sum+it+1));
		}
	}
}
int main()
{
	int N;
	cin>>N>>K;
	for(int i=0;i<N;i++)
	{
		cin>>to[i];
		to[i]--;
	}
	for(int i=0;i<N;i++)
		cin>>cost[i];
	long long ans=-1e10;
	for(int i=0;i<N;i++)
		ans=max(ans,count(i));
	cout<<ans<<endl;
	return 0;
}


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

int main(){
  long long N, A, B;
  cin>>N>>A>>B;
  long long set=N/(A+B);
  if(N-set*(A+B)<=A) cout<<A*set+N-set*(A+B)<<endl;
  else cout<<A*set+A<<endl;
}


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

int main() {
  int N; cin >> N;
  int A, chain = 0, ans = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    if (A == 1) chain++; else chain = 0;
    ans = max(chain + 1, ans);
  }
  cout << ans << endl;
  return 0;
}


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

const int mod = 1e9+7;

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

    int n, x;
    cin >> n >> x;

    if (x == 1) {
        cout << "No" << endl;
    }
    else if (n == x) {
        cout << "Yes" << endl;
        rep(i, 2*n-1) { cout << i+1 << endl; }
    }
    else if (2*n-1 <= x) {
        cout << "No" << endl;
    }
    else if (2*n-1 > x){
        cout << "Yes" << endl;
        int s = (2*n-1)/2;
        if (n > x) s = 2*n-1-(n-x);
        else s = x - n;
        for (int i = s; i < 2*n-1; ++i) {
            cout << i+1 << endl;
        }
        rep(i, s) { cout << i+1 << endl; }
    }

    return 0;
}


Measured memory_bytes: 1536
/* SANDEEP YADAv*/
#include<bits/stdc++.h>
using namespace std;
#define lld long long int
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
lld gcd(lld a,lld b){ if(a<b) { a=a+b; b=a-b; a=a-b;}while(b!=0){lld r=a%b; a=b; b=r;} return a;}
long long power(long long a, long long b, long long m) {a %= m;long long res = 1;while (b > 0) {if (b & 1)res = res * a % m;a = a * a % m;b >>= 1;}return res;}
void judge()
{
      #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("error.txt","w",stderr);
    #endif
}

int main()
{
    fastio;
    // judge();
    
    lld n;
    cin>>n;
    unordered_map<lld,lld>mp;
    lld a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        mp[a[i]]++;
    }
    lld s=0;
    for(auto it:mp)
    {
        lld x=it.second;
        s+=(x*(x-1))/2;
    }

    for(int i=0;i<n;i++)
    {
        cout<<s-mp[a[i]]+1<<"\n";
    }

    return 0;
}

Measured memory_bytes: 9160
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(150) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int main(){
  lli A,B,C,D,E,F,N,M,K,L,R,X,Y,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> N;
  map<int,int>P;
  rep(i,0,N){cin >> A;P[A]++;}
  for(auto v:P){if(v.first!=1)sum+=v.second%v.first;else sum+=v.second-1;}
  Out(sum);
}

Measured memory_bytes: 4736
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String[] days = {"", "SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"};
		for(int i=1; i<days.length; i++){
			if(days[i].equals(s)){
				System.out.println(i);
				break;
			}
		}
	}
}


Measured memory_bytes: 35460
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <cctype>
using namespace std;

int main() {
    string s;
    cin >> s;
    for (int i = 0; i < 3; i++) {
        if (s[i] == '1') s[i] = '9';
        else if (s[i] == '9') s[i] = '1';
    }
    cout << s << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		int num = Integer.parseInt(line);
		System.out.println((int) Math.pow(num, 3));
	}
}

Measured memory_bytes: 17072
w,h,n = (int(i) for i in input().split())
a = [[int(i) for i in input().split()] for i in range(n)]
x = [0,w,0,h]
for i in a:
	if i[2]==1 and i[0]>x[0]: x[0]=i[0]
	elif i[2]==2 and i[0]<x[1]: x[1]=i[0]
	elif i[2]==3 and i[1]>x[2]: x[2]=i[1]
	elif i[2]==4 and i[1]<x[3]: x[3]=i[1]
print(max(x[1]-x[0],0)*max(x[3]-x[2],0))

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

#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define ANS(ans) cout << (ans) << endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) for (long long i = 0; i < (n); ++i)

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

  VI v(n);
  REP(i, n) {
    cin >> v[i];
  }

  int ans = 0;
  REP(i, n) {
    if (v[i] >= k) {
      ans++;
    }
  }

  ANS(ans);
  
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define MEM 200006
#define sanic ios_base::sync_with_stdio(0)
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
const ll MOD = 1e9+7;
ll n,m,sum;
ll c[MEM];
string s;
int main()
{
    sanic; cin.tie(0);
    cin >> n;
    ll sxm=0;
    for(int i=0; i<n; i++){
        cin >> c[i];
        sxm^=c[i];
    }
    for(int i=0; i<n; i++)
        cout << (sxm^c[i]) << ' ';
}


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

int main(){
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    if(s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long int n,m,i=0,j,MOD=1000000007,a=1,c=1,p=1;
    cin >> n;
    for(i=0;i<n;i++)
    {
        a=a*10%MOD;
        c=c*9%MOD;
        p=p*8%MOD;
    }
    cout << (a+MOD+MOD-c-c+p)%MOD << endl;
    
                                    
    return 0;

}


Measured memory_bytes: 3568
using System;
using System.Text;
using System.Collections.Generic;
class Solve{
    int N;
    int[] p;
    public Solve(){}
    public static int Main(){
        new Solve().Calc();
        return 0;
    }
    void Calc(){
        getinput();
        int[] a = new int[N-1];
        int[] b = new int[N-1];
        for(int i=0;i<N;i++){
            if(p[i] == 1){
                b[0] = i+1;
            }
            else if(p[i] == N){
                a[N-2] = i+1;
            }
            else{
                a[p[i]-2] = i+1;
                b[p[i]-1] = i+1;
            }
        }
        int[] A = new int[N];
        int[] B = new int[N];
        for(int i=0;i<N;i++){
            if(i == 0){
                A[i] = 1; 
            }
            else{
                A[i] = A[i-1]+a[i-1];
            }
        }
        for(int i=N-1;i>=0;i--){
            if(i == N-1){
                B[i] = 1;
            }
            else{
                B[i] = B[i+1]+b[i];
            }
        }
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N-1;i++){
            sb.Append(A[i]+" ");
        }
        sb.Append(A[N-1]+"\n");
        for(int i=0;i<N-1;i++){
            sb.Append(B[i]+" ");
        }
        sb.Append(B[N-1]+"\n");
        Console.Write(sb.ToString());
    }
    void getinput(){
        N = int.Parse(Console.ReadLine());
        string[] str = Console.ReadLine().Split(' ');
        p = new int[N];
        for(int i=0;i<N;i++){
            p[i] = int.Parse(str[i]);
        }
    }    
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

const int md = 1e9 + 7;

void add(int &a, int b) {
	a += b;
	if (a >= md) a -= md;
}

const int N = 2e5 + 7;

int last[N];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.setf(ios::fixed); cout.precision(20);
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < N; ++i) last[i] = -1;
    vector <int> dp(n + 1, 0);
	dp[0] = 1;
	for (int i = 1; i <= n; ++i) {
		add(dp[i], dp[i - 1]);
		if (last[a[i - 1]] != -1 && last[a[i - 1]] != i - 1) {
			add(dp[i], dp[last[a[i - 1]]]);
		}
		last[a[i - 1]] = i;
	}
	cout << dp[n] << '\n';
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
using boost::sort;
using boost::adaptors::reversed;

int main() {
    int n;
    cin >> n;
    map<string, int> m;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        m[s] += 1;
    }
    cout << "AC x " << m["AC"] << endl;
    cout << "WA x " << m["WA"] << endl;
    cout << "TLE x " << m["TLE"] << endl;
    cout << "RE x " << m["RE"] << endl;
}


Measured memory_bytes: 3632
#include <fstream>
#include <cmath>

using namespace std;

const int MAXN = 2000;

int v[1 + MAXN];
int dp[1 + MAXN][2];

int main() {
    //freopen("tema.in", "r", stdin);
    //freopen("tema.out", "w", stdout);
    int n, a, b;
    scanf("%d%d%d", &n, &a, &b);
    for (int i = 1; i <= n; i++)
        scanf("%d", &v[i]);
    for (int i = n; i >= 2; i--) {
        dp[i][0] = abs(v[n] - v[i - 1]);
        for (int j = i; j < n; j++)
            dp[i][0] = max(dp[i][0], dp[j + 1][1]);
        dp[i][1] = abs(v[n] - v[i - 1]);
        for (int j = i; j < n; j++)
            dp[i][1] = min(dp[i][1], dp[j + 1][0]);
    }
    int answer = abs(b - v[n]);
    for (int i = 1; i < n; i++)
        answer = max(answer, dp[i + 1][1]);
    printf("%d\n", answer);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <cctype>
#include <ctype.h>
#define ll long long
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    if(a==1&&b==2||a==2&&b==1)
    {
        cout << "3" << endl;
    }
    else if(a==1&&b==3||a==3&&b==1)
    {
        cout << "2" << endl;
    }
    else if(a==2&&b==3||a==3&&b==2)
    {
        cout << "1" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
#define add(x,y)(x=(x+y)%MOD)
 
//階乗,二項係数
//*
ll fact[2000010];
ll invfact[2000010];
void makefact(int n,ll m){
	n=min(n,m-1);
	fact[0]=1;
	rep(i,0,n)fact[i+1]=fact[i]*(i+1)%m;
	invfact[n]=invp(fact[n],m);
	for(int i=n;i>0;i--)invfact[i-1]=invfact[i]*i%m;
}
ll choose(int n,int r,int m){return n<0||r<0||n-r<0?0:fact[n]*invfact[r]%m*invfact[n-r]%m;}
//*/
 
char s[1000010];
int main(){
	makefact(2000005,MOD);
	int k;
	scanf("%d %s",&k,s);
	int n=strlen(s);
	
	ll ans=0;
	rep(i,0,k+1){
		//末尾にi個
		ans+=choose(k-i+n-1,n-1,MOD)*pom(25,k-i,MOD)%MOD*pom(26,i,MOD)%MOD;
	}
	printf("%lld",ans%MOD);
}

Measured memory_bytes: 33932
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main {
	static PrintWriter pw;
	static int n;

	static long gcd(long n, long m) {
		return (m == 0 ? n : gcd(m, n % m));
	}
	static int[] gcd2(int p, int q) {
	      if (q == 0)
	         return new int[] { p, 1, 0 };

	      int[] vals = gcd2(q, p % q);
	      int d = vals[0];
	      int a = vals[2];
	      int b = vals[1] - (p / q) * vals[2];
	      return new int[] { d, a, b };
	   }

	public static void main(String[] args) throws IOException, InterruptedException {
		Scanner sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int []count =new int[m+1];
		for(int i =0;i<n;i++){
			int k = sc.nextInt();
			while(k-->0){
				count[sc.nextInt()]++;
			}
		}
		int c=0;
		for(int i =1;i<=m;i++){
			if(count[i]==n)c++;
		}
		pw.println(c);
		pw.flush();
				}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}


Measured memory_bytes: 22356
#include<stdio.h>

long long gcd(long long a,long long b){
		if(a%b==0)return b;
		return gcd(b,a%b);
}

int main(){
		int n,a[100],i;
		scanf("%d",&n);
		long long ans=0,anss=1;
		for(i=0;i<n;i++){
				scanf("%d",&a[i]);
				anss*=a[i]/gcd(a[i],anss);
		}
		for(i=0;i<n;i++)ans+=anss/a[i];
		printf("%.10f\n",anss/(double)ans);
		return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    for (int i = 0; i < N; i++) {
      int a = sc.nextInt();
      if (a % 2 == 0) {
        if (!(a %3 == 0 || a %5 == 0)) {
          System.out.println("DENIED");
          return;
        }
      }
    }
    System.out.println("APPROVED");
  }
}


Measured memory_bytes: 22996
import bisect

N = int(input())
A = list(map(int, input().split()))
A.sort()

neg = [A[0]]
pos = [A[-1]]
if N >= 3:
    i = bisect.bisect_left(A, 0, lo=1, hi=N - 1)
    neg += A[1:i]
    pos += A[i:N - 1]

M = neg.pop()
Op = []
for i in range(len(pos) - 1):
    p = pos.pop()
    Op.append((M, p))
    M -= p
p = pos.pop()
Op.append((p, M))
M = p - M
for i in range(len(neg)):
    n = neg.pop()
    Op.append((M, n))
    M -= n

print(M)
for O in Op:
    print(O[0], O[1])


Measured memory_bytes: 62908
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

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

/*
0-index
functionの中を書いて使う
segtree<ll> seg(n, [](ll a, ll b){return a + b;}, 0);
*/
template<typename T>
struct segtree{
	int n;
	vector<T> dat;
	T ZERO;
	function<T(T,T)> func;//要素と要素をマージする関数

	segtree(int n_, function<T(T,T)> func_, T zero):func(func_), ZERO(zero){
	  n = 1;
	  while(n < n_)n*=2;
	  dat.resize(2*n);
	  for(int i = 0;i < 2*n;i++)dat[i] = ZERO;
	}

	void update(int k, T a){
	  k += n - 1;dat[k] = a;
	  while(k > 0){
		k = (k-1)/2;
		dat[k] = func(dat[k*2+1],dat[k*2+2]);
	  }
	}

	void set(int k, T a) {
		k += n - 1;dat[k] = a;
	}

	void build(){
		for(int i = n - 2;i >= 0;i--){
			dat[i] = func(dat[2 * i + 1], dat[2 * i + 2]);
		}
	}

	T get(int k){return dat[k+n-1];}

	T que(int a,int b){
		T L = ZERO,R = ZERO;
		int A = a + n - 1;
		int B = b + n - 1;
		while(A < B){
			if((A & 1) == 0)L = func(L,dat[A++]);
            if((B & 1) == 0)R = func(dat[--B],R);
            A = A >> 1;
            B = B >> 1;
		}
		return func(L,R);
	}
};

segtree<ll> seg(500500, [](ll a, ll b){return a | b;}, 0);

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

  ll n;cin >> n;
  string str;cin >> str;
  REP(i, n)seg.update(i, (1<<(str[i]-'a')));
  ll q;cin >> q;
  REP(_, q){
    ll t;cin >> t;
    if(t == 1){
      int a;
      char c;
      cin >> a >> c;a--;
      seg.update(a, (1<<(c-'a')));
    }
    else {
      ll l, r;cin >> l >> r;l--;r--;
      ll now = seg.que(l, r + 1);
      ll ans = 0;
      REP(i, 30)if(now & (1 << i))ans++;
      cout << ans << endl;
    }

    // REP(i, n)cout << bitset<30>(seg.get(i)) << endl;cout << endl;
  }

	return 0;
}


Measured memory_bytes: 9364
#include <stdio.h>

int main(){
	int A, B, C;
	scanf("%d %d %d", &A, &B, &C);
	if(A==B && A==C && B==C){
		printf("No");
	}else if(A==B || A==C || B==C){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;
}

Measured memory_bytes: 1708
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
vector<vector<int> > a(n,vector<int>(m));
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin>>a.at(i).at(j);
}
}
vector<int> b(m);
for(int i=0;i<m;i++){
cin>>b[i];
}
int ans=0;
for(int i=0;i<n;i++){
ans=0;
for(int j=0;j<m;j++){
ans+=b[j]*a[i][j];
}
cout<<ans<<endl;
}
}


Measured memory_bytes: 3164
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

X,Y,Z,K=rl()
A=rl()
B=rl()
C=rl()
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
ans = []
for a in range(1,X+1):
    for b in range(1,Y+1):
        for c in range(1,Z+1):
            if a*b*c<=K:
                ans.append(A[a-1]+B[b-1]+C[c-1])
            else:
                break
ans.sort(reverse=True)
for i in range(K):
    print(ans[i])

Measured memory_bytes: 8724
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>

using namespace std;

#define REP(i,n)	for(int i=0;i<(n);++i)
#define REPS(i,s,t)	for(int i=(s);i<(t);++i)
#define SUMV(v)		(accumulate(v.begin(),v.end(),0.0))

#define INF 		2000000007
#define MOD			998244353

#define MAX 		100005

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int ll;

//uint dp[MAX];


int main(){
	int N,M;cin>>N>>M;
	ll ans = -(1LL << 60);
	vector<ll> x(N),y(N),z(N);
	REP(i,N) cin>>x[i]>>y[i]>>z[i];
	REP(i,8){
		vector<ll> s(N);
		REP(j,N){
			s[j] =  (i&1) ? x[j] : (-x[j]);
			s[j] += (i&2) ? y[j] : (-y[j]);
			s[j] += (i&4) ? z[j] : (-z[j]);
		}
		sort(s.begin(),s.end(),greater<ll>());
		ll suml=0;
		REP(j,M)suml+= s[j];
		ans = max(ans,suml);
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
from math import degrees, atan2
a, b, x = map(int, input().split())

if x / (b * a**2 ) < 1/2:
    x2 = (2*x) / (a*b)
    y2 = b
else:
    x2 = a
    y2 = 2 * (b-(x / a ** 2))
    


print(degrees(atan2(y2, x2)))

Measured memory_bytes: 38256
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,b,a) for(int i=b;i>=a;i--)
#define efo(i,v,u) for(int i=last[v],u=to[last[v]];i;i=nxt[i],u=to[i])
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)<(y)?(x):(y))
#define mset(a,x) memset(a,x,sizeof(a))
using namespace std;
typedef long long ll;
void read(int &n)
{
	int t=0,p=1;char ch;
	for(ch=getchar();!('0'<=ch && ch<='9');ch=getchar())
		if(ch=='-') p=-1;
	for(;'0'<=ch && ch<='9';ch=getchar()) t=t*10+ch-'0';
	n=t*p;
}
const int N=4e5+5,M=50000005;
int n,nn,rtn,tot,ext,b[N][2];
struct node
{
	int x,id;
}a[N];
bool cmp(node a,node b){return a.x<b.x;}
int m,co[N],to[M],nxt[M],last[N],list[N],L[N],R[N];
void link(int u,int v)
{
	to[++m]=v,nxt[m]=last[u],last[u]=m;
}
bool dfs(int v)
{
	if(v<=tot && co[v^1]) return 0;
	if(v<=tot && co[v]) return 1;
	co[v]=1;
	list[++list[0]]=v;
	efo(i,v,u) if(!co[u])
		if(!dfs(u)) return 0;
	return 1;
}
bool check(int lim)
{
	m=0;mset(last,0);
	fo(i,1,n)
	{
		link(b[i+i-1][0],b[i+i][1]),link(b[i+i][1],b[i+i-1][0]);
		link(b[i+i-1][1],b[i+i][0]),link(b[i+i][0],b[i+i-1][1]);
	}
	fo(i,1,rtn)
		fo(j,L[i],R[i]) link(tot+i,b[a[j].id][0]);
	int l=1,r=1;
	fo(i,1,nn)
	{
		while(l<nn && a[i].x-a[l].x>=lim) ++l;
		while(r<nn && a[r+1].x-a[i].x<lim) ++r;
		int ql=min(rtn,(l-1)/rtn+1),qr=min(rtn,(r-1)/rtn+1),qi=min(rtn,(i-1)/rtn+1);
		if(ql==qr)
		{
			fo(j,l,r)
				if(j!=i) link(b[a[i].id][1],b[a[j].id][0]);
		}
		else
		{
			if(ql==qi)
				fo(j,l,i-1) link(b[a[i].id][1],b[a[j].id][0]);
			else
			{
				fo(j,l,R[ql]) link(b[a[i].id][1],b[a[j].id][0]);
				fo(j,ql+1,qi-1) link(b[a[i].id][1],tot+j);
				fo(j,L[qi],i-1) link(b[a[i].id][1],b[a[j].id][0]);
			}
			if(qi==qr)
				fo(j,i+1,r) link(b[a[i].id][1],b[a[j].id][0]);
			else
			{
				fo(j,i+1,R[qi]) link(b[a[i].id][1],b[a[j].id][0]);
				fo(j,qi+1,qr-1) link(b[a[i].id][1],tot+j);
				fo(j,L[qr],r) link(b[a[i].id][1],b[a[j].id][0]);
			}
		}
	}
	mset(co,0);
	fo(i,1,tot)
	{
		int x=i+i-1;
		if(!co[b[x][0]] && !co[b[x][1]])
		{
			list[0]=0;
			if(!dfs(b[x][0]))
			{
				fo(j,1,list[0]) co[list[j]]=0;
				list[0]=0;
				if(!dfs(b[x][1])) return 0;
			}
		}
	}
	return 1;
}
int main()
{
	int x,y;
	read(n);nn=n+n;
	fo(i,1,n) read(a[i+i-1].x),read(a[i+i].x);
	tot=1;
	fo(i,1,nn) a[i].id=i,b[i][0]=++tot,b[i][1]=++tot;
	rtn=sqrt(nn);
	fo(i,1,rtn-1) L[i]=1+rtn*(i-1),R[i]=rtn*i;
	L[rtn]=1+rtn*(rtn-1),R[rtn]=nn;
	sort(a+1,a+nn+1,cmp);
	int l=0,r=a[nn].x+1;
	while(l<r-1)
	{
		int mid=(l+r)>>1;
		if(check(mid)) l=mid;
		else r=mid;
	}
	printf("%d\n",l);
	return 0;
}

Measured memory_bytes: 119040
class UnionFind: #引数は頂点の数、1インデックス
    def __init__(self, n):
        self.parents = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.parents[x] == x:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.parents[x] = y
        else:
            self.parents[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)


if __name__ == "__main__":
    N, M = map(int, input().split())
    bridges = [tuple(map(int, input().split())) for _ in range(M)]

    count = 0
    for i in range(M):
        union_find = UnionFind(N)
        for j in range(M):
            if i == j:
                continue
            a, b = bridges[j]
            union_find.union(a, b)

        for j in range(1, N):
            if union_find.find(j) != union_find.find(j+1):
                count += 1
                break

    print(count)
        
    








Measured memory_bytes: 9240
N, = (int(x) for x in input().split())
h_arr = [int(x) for x in input().split()]

def n_water(p_arr):
    if len(p_arr) == 0:
        return 0
    if 0 in p_arr:
        i_0 = p_arr.index(0)
        return n_water(p_arr[:i_0])+n_water(p_arr[i_0+1:])
    p_arr = [x-1 for x in p_arr]
    return n_water(p_arr)+1

print(n_water(h_arr))


Measured memory_bytes: 3188
n = int(input())
l = list(map(int, input().split()))
even = 0
count = 0
for i in range(n):
    if l[i] % 2 == 0:
        even += 1
        if l[i] % 3 == 0 or l[i] % 5 == 0:
            count += 1
if count == even:
    print("APPROVED")
else:
    print("DENIED")


Measured memory_bytes: 3060
// Created by ...
#include <bits/stdc++.h>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
//#define rep(i,n) for(int i=0;i<(n);++i)
//#define repA(i,a,n) for(int i=a;i<=(n);++i)
//#define repD(i,a,n) for(int i=a;i>=(n);--i)

#define vll vector< ll >
#define M 100000
#define MD 1000000007
#define pb push_back
#define rep(i,a,b) for(ll i = a; i <= b; i++)
#define pii pair<ll,ll> 
#define vec(a) vector<a >
#define se second
#define fi first
#define inf 0xffffffff
#define inchar getchar_unlocked
#define outchar(x) putchar_unlocked(x)

using namespace std;
using ll = long long;

/*template<typename T>inline void in(T &x){x=0;register T c=inchar();while(((c<48)||(c>57))&&(c!='-'))c=inchar();bool neg=false;if(c=='-')neg=true;for(;c<48||c>57;c=inchar());for(;c>47&&c<58;c=inchar())x=(x<<3)+(x<<1)+(c&15);if(neg)x=-x;}
 template<typename T>inline void out(T n){if(n<0){outchar('-');n*=-1;}char snum[65];ll i=0;do {snum[i++]=n%10+'0';n/=10;}while(n);i=i-1;while(i>=0)outchar(snum[i--]);}
ll pr[M+1],freq[M+1];
ll fact[M+1],inv[M+1];*/

ll md=MD;
ll exp(ll a,ll b){ll r=1ll;while(b>0){if(b&1){r=r*(a%md);r=(r+md)%md;}b/=2;a=(a%md)*(a%md);a=(a+md)%md;}return (r+md)%md;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
//ll chose(ll n,ll k){ll r=fact[n]%md;r=(r+md)%md;r=r*inv[k]%md;r=(r+md)%md;r=r*inv[n-k]%md;r=(r+md)%md;return r;}

ll Min(ll a,ll b){if(a<b)return a; return b;}
int main() {
    ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    
        ll n,k,i,j;
        cin>>n>>k;
        vll v(n+1);
        rep(i,1,n) cin>>v[i];
        vll dp(n+1,inf);
        dp[1]=0;
        for(i=1;i<=n;++i)
        {
        	for(j=1;j<=k;++j)
        	{
        		if(i+j<=n)
        		{
        			dp[i+j]=Min(dp[i+j],dp[i]+abs(v[i+j]-v[i]));
        		}
        	}
        }
        cout<<dp[n];
        












    
        cout<<'\n';
    return 0;
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    priority_queue<ll,vector<ll>,greater<ll>> aka;
    priority_queue<int> ao;
    ll s[200005],t[200005];
    int a[300005];
    cin>>n;
    rep(i,3*n){
        cin>>a[i];
    }
    s[0]=0;
    t[0]=0;
    for(int i=0;i<n;i++){
        s[i+1]=a[i]+s[i];
        aka.push(a[i]);
    }
    for(int i=n;i<=2*n;i++){
        ll mini=aka.top();
        if(mini<a[i]){
            aka.pop();
            s[i+1]=s[i]-mini+a[i];
            aka.push(a[i]);
        }
        else s[i+1]=s[i];
    }

    for(int i=0;i<n;i++){
        t[i+1]=a[3*n-1-i]+t[i];
            ao.push(a[3*n-1-i]);
    }
    for(int i=n;i<2*n;i++){
        ll maxi=ao.top();
        if(maxi>a[3*n-i-1]){
            ao.pop();
            t[i+1]=t[i]-maxi+a[3*n-i-1];
            ao.push(a[3*n-i-1]);
        }
        else t[i+1]=t[i];
    }

    
    ll res=s[n]-t[2*n];
    for(int i=0;i<=n;i++){
        ll k=s[n+i]-t[2*n-i];
        if(k>res)res=k;
    }
    cout<<res<<endl;
    return 0;
}



Measured memory_bytes: 6260
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	long long a[s.size()+1];
	long long sum=0;
	long long p=1;
	for(int i=s.size()-1;i>=0;i--){
		sum=(s[i]-'0')*p+sum;
		p*=10;
		p%=2019;
		sum%=2019;
		a[i+1]=sum;
	}
	sort(a+1,a+s.size()+1);
	sum=1;
	long long ans=0;
	a[0]=0;
	for(int i=1;i<=s.size();i++){
		if(a[i]==a[i-1]){
			sum++;
		}else{
			ans+=sum*(sum-1)/2;
			sum=1;
		}
	}
	ans+=sum*(sum-1)/2;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 5284
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
	ll n;
	cin >> n;
	vector<ll> a(n);
	rep(i, n){
		cin >> a[i];
		a[i] = a[i] - i - 1;
	}
	sort(all(a));
	ll ave = a[n/2];
	ll ans = 0;
	rep(i, n)ans += abs(a[i]-ave);
	cout << ans << endl;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
#define inf 999999999999
#define F first
#define S second
#define pb push_back
#define read(x)  freopen("input.txt","r",stdin);
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi 2*acos(0.0)
#define ee exp(1)
#define mx 200009
using namespace std;

int main(){//read(x);
fast;
ll a,b,c,d,e,f,g,h,i,j,k,l,n,t;
cin>>n;d=0;
for(i=1;i<=n;i++){
    cin>>a;
    if(i&1 && a&1)d++;
}
cout<<d<<endl;
}















Measured memory_bytes: 3604
n = int(raw_input())
S = map(int, raw_input().split())
cnt = 0

def merge(A, left, mid, right):
    global cnt
    n1 = mid - left
    n2 = right - mid
    L = [0] * (n1+1) 
    R = [0] * (n2+1)
    #L[:n1] = A[left:mid]
    #R[:n2] = A[mid:right]
    for i in xrange(n1):
        L[i] = A[left + i]
    for i in xrange(n2):
        R[i] = A[mid + i]
    L[n1] = float('inf')
    R[n2] = float('inf')
    i = 0
    j = 0
    for k in xrange(left,right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
            cnt += 1
        else:
            A[k] = R[j]
            j += 1
            cnt += 1
    return 0

def mergeSort(A, left, right):
    if right - left > 1:
        mid = int((left + right) / 2)
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)
    return 0

def main():
    mergeSort(S, 0, len(S))
    print ' '.join(map(str, S))
    print cnt
    return 0

main()

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

using namespace std;

typedef long long llint;

int main() {
  llint x;
  cin >> x;
  for (int i = -120; i <= 120; i++) {
    for (int j = -120; j <= 120; j++) {
      llint a = pow(i, 5);
      llint b = pow(j, 5);
      if (a - b == x) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }

  return 0;
}

Measured memory_bytes: 4064
a, b = map(int, input().split())
count = 0
for i in range(a+1):
  for j in range(a+1-i):
    s = (10000*i) + (5000*j) + (1000*(a-i-j))
    if s == b:
      print(i,j,(a-i-j))
      count += 1
      break
  else:
    continue
  break
  
if count == 0:
  print(-1,-1,-1)

Measured memory_bytes: 3188
#include <iostream>
#include <algorithm>
using namespace std;
int A[1000000]={};
int sum=0;
void sort(int n){
    int flag = 1;
    while(flag){
        flag=0;
        for(int j=n-1;j>=1;j--){
            if(A[j]<A[j-1]){
                int tmp=A[j];
                A[j]=A[j-1];
                A[j-1]=tmp;
                flag=1;
                sum++;
            }
        }
    }
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>A[i];
    }
    sort(n);
    for(int i=0;i<n;i++){
        if(i==n-1){
            cout<<A[i];
        }
        else{
            cout<<A[i]<<" ";
        }
    }
    cout<<endl;
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 3116
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


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

  cin >> n >> a >> b;

  cout << min(n * a, b) << endl;
  
  return 0;
}



Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 100000000

n, m = LI()
G = [[0] * n for _ in range(n)]
for u, v in LIR(m):
    G[u - 1][v - 1] = 1
    G[v - 1][u - 1] = 1


cnt = 0
for path in permutations(range(1, n)):
    for i in range(1, len(path)):
        if not G[path[i - 1]][path[i]]:
            break
    else:
        if G[0][path[0]]:
            cnt += 1

print(cnt)

Measured memory_bytes: 40688
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>  // sort, 二分探索, etc
#include <iomanip>  // setprecision (浮動小数点の出力の誤差)
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cmath>

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=a,i##_len=(b);i<i##_len;++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define cauto const auto&
#define UNIQUE(v) (v).erase( unique(all(v), (v).end() );
#define SZ(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define INF 1000000000000
#define MOD 1000000007
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

using namespace std;
using ll = long long;
using ull = unsigned long long;

template<class T>bool chmax(T &a, const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b;return true;}return false;}

const char newl = '\n';

ll qp(ll a,ull b){ll ans=1;do{if(b&1u)ans*=a;a*=a;}while(b>>=1u);return ans;}
ll qp(ll a,ull b,ll mod){ll ans=1;do{if(b&1u)ans=ans*a%mod;a=a*a%mod;}while(b>>=1u);return ans;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll comb(int n, int r) {
    vector<vector<ll> > v(n+1, vector<ll>(r+1, 0));
    for(int i=0;i<n+1;i++) {v[i][0]=1; if(i < r+1)v[i][i]=1; }
    for(int i=1;i<n+1;i++) {for(int j=1;j<min(i,r+1);j++) {v[i][j]=v[i-1][j-1]+v[i-1][j];}}
    return v[n][r];
}

// INT_MAX   = 2.1e+09 (2147483647)
// LONG_MAX  = 9.2e+18 (9223372036854775807)
// LLONG_MAX = 9.2e+18 (9223372036854775807)


int main() {
    ll k;
    cin >> k;

    ll k2 = (k % 7 == 0) ? k / 7 : k;
    if (k2 == 1) {
        cout << 1 << newl;
        return 0;
    }
    if (k2 % 2 == 0) {
        cout << -1 << newl;
        return 0;
    }

    ll total = 1;
    ll r = 1;
    ll cnt = 1;
    map<pair<ll, ll>, ll> mp;
    while (true) {
        if (mp[pair<ll, ll>(r, total)] > 0) {
            cout << -1 << newl;
            return 0;
        } else {
            mp[pair<ll, ll>(r, total)] += 1;
        }
        r = (r * 10) % k2;
        total = (total + r) % k2;
        if (total == 0) {
            cout << cnt + 1 << newl;
            return 0;
        }
        cnt++;
    }
}


Measured memory_bytes: 65604
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <map>
#include <algorithm>
#include <iomanip>
using namespace std;

int point(long long int W, long long int H, long long int x, long long int y) {
	long double x2 = static_cast<long double>(W) / 2, y2 = static_cast<long double>(H) / 2;
	if (x == W || x == 0 || y == H || y == 0 || (x != x2 || y != y2)) return 0;
	return 1;
}
int main() {
	long long int W, H, x, y;
	long double S;
	int C;
	cin >> W >> H >> x >> y;
	S = static_cast<long double>(W * H) / 2;
	C = point(W, H, x, y);

	cout << fixed << setprecision(6) << S << ' ' << C << endl;
}

Measured memory_bytes: 256
use std::collections::*;
use std::io::BufRead;
use std::io::*;
struct StdinReader<R: BufRead> {
    pub reader: R,
    pub buf: String,
}
impl<R: BufRead> StdinReader<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buf: String::new(),
        }
    }
}
macro_rules! get {
    ($r:expr, $t:ty) => {
        {
            let mut line = &mut $r.buf;
            line.clear();
            $r.reader.read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($r:expr, $($t:ty),*) => {
        {
            let mut line = &mut $r.buf;
            line.clear();
            $r.reader.read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($r:expr, $t:ty; $n:expr) => {
        // items in n lines
        (0..$n).map(|_|
                    get!($r, $t)
                   ).collect::<Vec<_>>()
    };
    ($r:expr, $($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    get!($r, $($t),*)
                   ).collect::<Vec<_>>()
    };
    ($r:expr, $t:ty ;;) => {
        // items in a line
        {
            let mut line = &mut $r.buf;
            line.clear();
            $r.reader.read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($r:expr, $t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($r, $t ;;)).collect::<Vec<_>>()
    };
}

fn main() {
    let reader = stdin();
    let mut reader = StdinReader::new(reader.lock());
    let out = stdout();
    let mut out = BufWriter::new(out.lock());
    let n = get!(reader, i64);
    let mut sum: i64 = 0;
    for i in 1..=n {
        sum += (i + i * (n / i)) * (n / i) / 2;
    }
    writeln!(out, "{}", sum);
}


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;

  int A, B, C;
  cin >> A >> B >> C;
  if(A - B > C){
    cout << 0 <<endl;
  } else{
    cout << C - A + B <<endl;
  }
}

Measured memory_bytes: 256
// Copyright (C) 2017 __debug.

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; version 3

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; If not, see <http://www.gnu.org/licenses/>.


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>

#define x first
#define y second
#define MP std::make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#ifdef __linux__
#define getchar getchar_unlocked
#define putchar putchar_unlocked
#endif

using std::pair;
using std::vector;
using std::string;

typedef long long LL;
typedef pair<int, int> Pii;

const int oo = 0x3f3f3f3f;

template<typename T> inline bool chkmax(T &a, T b) { return a < b ? a = b, true : false; }
template<typename T> inline bool chkmin(T &a, T b) { return b < a ? a = b, true : false; }
string procStatus()
{
    std::ifstream t("/proc/self/status");
    return string(std::istreambuf_iterator<char>(t), std::istreambuf_iterator<char>());
}
template<typename T> T read(T &x)
{
    int f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar())
        f = (ch == '-' ? -1 : 1);
    for (x = 0; isdigit(ch); ch = getchar())
        x = 10 * x + ch - '0';
    return x *= f;
}
template<typename T> void write(T x)
{
    if (x == 0) {
        putchar('0');
        return;
    }
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    static char s[20];
    int top = 0;
    for (; x; x /= 10)
        s[++top] = x % 10 + '0';
    while (top)
        putchar(s[top--]);
}
// EOT

const int MAXN = 105;

char S[MAXN];
int A[MAXN];

int main()
{
#ifdef __DEBUG
    freopen("A.in", "r", stdin);
    freopen("A.out", "w", stdout);
#endif

    scanf("%s", S + 1);
    int N = strlen(S + 1);
    int ans = +oo;

    for (char c = 'a'; c <= 'z'; ++c) {
        bool flag = false;
        for (int i = 1; i <= N; ++i) {
            flag |= A[i] = (S[i] == c);
        }
        if (!flag) continue;

        int cur = 0;
        for (;;) {
            for (int i = 1; i <= N - cur; ++i) {
                if (!A[i])
                    goto NEXT;
            }
            break;
          NEXT:
            ++cur;
            for (int i = 1; i <= N - cur; ++i) {
                A[i] |= A[i+1];
            }
        }
        chkmin(ans, cur);
    }

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

    return 0;
}

// 少壮不努力，老大徒伤悲。


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

int X[100005];

int main() {

    ios::sync_with_stdio(0);
    cin.tie(NULL), cout.tie(NULL);

    int N;
    cin >> N >> X[0];
    
    for(int i=1; i<=N; i++)
        cin >> X[i];
    
    sort(X, X+N+1);
    
    int ans = 0;
    
    for(int i=1; i<=N; i++)
        ans = __gcd(ans, X[i] - X[i-1]);
    
    cout << ans << "\n";
    return 0;
}


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

/* * * *   * * *   	* * * */
#define ll long long
#define ld long double
#define II pair<int, int>
#define LL pair<ll, ll>
#define VI vector<int>
#define VB vector<bool>
#define VS vector<string>
#define VL vector<ll>
#define VII vector<II>
#define VLL vector<LL>
#define PB push_back
#define B begin()
#define E end()
#define F first
#define S second
#define SZ size()
#define P complex <ll> 
#define X real()
#define Y imag()
const int oo = 1e9;
const ll mod = 1e7;
/* * * *   * * *   	* * * */

/* *
 *
 * Author: Hamkor
 *
 * */
 
int main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int h, w; cin>>h>>w;
	VS a(h);
	for(int i=0; i<h; ++i) cin>>a[i];
	VB r(h, 0), c(w, 0);
	for (int i=0;i<h;++i) for (int j=0; j<w; ++j) if (a[i][j] == '#') {r[i] = 1; c[j]=1;}
	for (int i=0; i<h; ++i){ 
		if (!r[i]) continue;
		for (int j=0; j<w; ++j) {
			if (!c[j]) continue;
			cout<<a[i][j];
		}
		cout<<"\n";
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int m=999;
  int w;
  for(int i=2;i<s.size();i++){
    w=(s[i]-48)+((s[i-1]-48)*10)+((s[i-2]-48)*100);
    m=min(abs(753-w),m);
  }
  cout<<m<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = Long.parseLong(sc.next());
        long M = Long.parseLong(sc.next());

        if (N == 1 && M == 1) {
            System.out.println(1);
        } else if (N == 1) {
            System.out.println(M - 2);
        } else if (M == 1) {
            System.out.println(N - 2);
        } else {
            System.out.println(N*M - 2*(N+M) + 4);
        }
    }
}

Measured memory_bytes: 22612
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include <unordered_set>

using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  int n,q;
  cin >> n >> q;
  int s[n],t[n],x[n];
  rep(i,n){
    cin >> s[i] >> t[i] >> x[i];
    s[i]-=x[i];
    t[i]-=x[i]+1;
  }
  pair<int,pint> p[n];
  rep(i,n){
    p[i].first=x[i];
    p[i].second.first=s[i];
    p[i].second.second=t[i];
  }
  sort(p,p+n);
  int d[q];
  rep(i,q)cin >> d[i];
  map<int,int> mp;
  set<int> se;
  rep(i,q)se.insert(d[i]);
  rep(i,n){
    auto it=se.lower_bound(p[i].second.first);
    while(it!=se.end() && *it<=p[i].second.second){
      mp[*it]=p[i].first;
      auto it2=it;
      it2++;
      se.erase(it);
      it=it2;
    }
  }
  rep(i,q){
    auto it=mp.find(d[i]);
    if(it!=mp.end())cout << it->second << endl;
    else cout << -1 << endl;
  }
return 0;}

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

using namespace std;

int N, D, ans;
int con[11][11], aa[11];

int a[10];
int b[1000];
//a为存放待组合的数值，b为用于暂存的数组
//n，m代表从n中取出m个数的组合
// M=m M用于输出
void c(int a[],int b[],int n, int m,const int M)
{
	if (m>0)
	{
		for (int i =n;i>=m;i--)
		{
			b[m-1]=a[i-1];
			//由于确定了当前位置的值
			//则下次递归c(n-1,m-1)
			c(a,b,i-1,m-1,M);
		}
	}
	else
	{
	    int fir, sec, sumab = 0;


	    /*cout << endl;
		for(int i =0 ; i < M;i++)
        {
            cout<<b[i]<<" ";
        }
        cout<<endl;*/

        fir = b[0];
        sec = b[1];
        for(int i = 1;i <= D;i++)
        {
            sumab += con[fir][i]*con[sec][i];
        }
        sumab *= 2;


        sumab = aa[fir] + aa[sec] - sumab;
        double test = sqrt(sumab);
        if(floor(test) == test)
            ans++;
	}

}


int main()
{
    cin >> N >> D;
    /**/
    for(int i = 1;i <= N;i++)
    {
        for(int j = 1;j <= D;j++)
        {
            cin >> con[i][j];
            aa[i] += con[i][j] * con[i][j];
        }
        //cout << "aa[" << i << "] = " << aa[i];
    }
    int ccc = 0;
    for(int i = 1;i <= N;i++)
    {
        a[ccc] = i;
        ccc++;
    }
    c(a, b, N, 2, 2);

    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 256