akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int M=4005,MM=M*2,N=(int)2e5+5,P=(int)1e9+7;
void Rd(int &res){
	res=0;static char p;
	while(p=getchar(),p<'0');
	do{
		res=(res*10)+(p^48);
	}while(p=getchar(),p>='0');
}
void Add(int &x,int y){
	x+=y;
	if(x>=P)x-=P;
}
void Del(int &x,int y){
	x-=y;
	if(x<0)x+=P;
}
int fast(int x,int p){
	int re=1;
	while(p){
		if(p&1)re=(long long)re*x%P;
		x=(long long)x*x%P,p>>=1;
	}return re;
}
int dp[M][M];
int n,A[N],B[N];
int fac[MM],rfac[MM];
int C(int a,int b){
	return (long long)fac[a]*rfac[b]%P*rfac[a-b]%P;
}
int main(){
	fac[0]=1;
	for(int i=1;i<MM;i++)fac[i]=(long long)fac[i-1]*i%P;
	rfac[MM-1]=fast(fac[MM-1],P-2);
	for(int i=MM-2;i>=0;i--)rfac[i]=(long long)rfac[i+1]*(i+1)%P;
	Rd(n);
	for(int i=1;i<=n;i++)Rd(A[i]),Rd(B[i]),dp[2001-A[i]][2001-B[i]]++;
	for(int i=1;i<M;i++)
		for(int j=1;j<M;j++)
			Add(dp[i][j],dp[i][j-1]),Add(dp[i][j],dp[i-1][j]);
	int ans=0;
	for(int i=1;i<=n;i++)Add(ans,dp[2001+A[i]][2001+B[i]]),Del(ans,C(A[i]*2+B[i]*2,A[i]*2));
	ans=(long long)ans*fast(2,P-2)%P;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 64512
import sys
from collections import Counter
input = sys.stdin.readline

n = int(input())
vn = [int(x) for x in input().strip().split()]

v1 = [v for i, v in enumerate(vn) if i % 2 == 0]
v2 = [v for i, v in enumerate(vn) if i % 2 != 0]
v1cnt = Counter(v1)
v2cnt = Counter(v2)
maxv11 = 0
maxv12 = 0
maxv21 = 0
maxv22 = 0
c_ = 0
for v, c in v1cnt.items():
    if c > c_:
        maxv12 = c_
        c_ = c
        maxv1 = [v]
    elif c == c_:
        maxv1.append(v)
    else:
        maxv12 = max(maxv12, c)

c_ = 0
for v, c in v2cnt.items():
    if c > c_:
        maxv22 = c_
        c_ = c
        maxv2 = [v]
    elif c == c_:
        maxv2.append(v)
    else:
        maxv22 = max(maxv22, c)

if maxv1 != maxv2 or len(maxv1) > 1 or len(maxv2) > 1:
    print(len(v1) - max(v1cnt.values()) + len(v2) - max(v2cnt.values()))
else:
    print(min(len(v1) - max(v1cnt.values()) + len(v2) - maxv22, \
        len(v1) - maxv12 + len(v2) - max(v2cnt.values())))

Measured memory_bytes: 19032
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Set<String> se = new HashSet<>();
		for (int i = 0; i < N; i++) {
			se.add(sc.next());
		}
		System.out.println(se.size());
	}
}

Measured memory_bytes: 21844
import java.util.Scanner;

public class Main {

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

		if (k == 4 || k == 6 || k == 9 || k == 10 || k == 14 || k == 21 || k == 22 || k == 25 || k == 26) {
			print(2);
		} else if (k == 8 || k == 12 || k == 18 || k == 20 || k == 27) {
			print(5);
		} else if (k == 16) {
			print(14);
		} else if (k == 24) {
			print(15);
		} else if (k == 28 || k == 30) {
			print(4);
		} else if (k == 32) {
			print(51);
		} else {
			print(1);
		}
	}

	public static void print(Object obj) {
		System.out.println(obj);
	}

}


Measured memory_bytes: 21844
#include<iostream>

int main(){
    long long int a;
    std::cin>>a;
    std::cout<<a<<":";
    bool hantei[1000000];
    for(long long int i=2;i*i<=a+1000;i++){
        if(!hantei[i]){
            for(long long int j=i*2;j*j<=a+1000;j+=i){
                hantei[j]=true;
            }
        }
    }
    for(long long int i=2;i*i<=a+1000;i++){
        if(!hantei[i]){
        while(true){
            if(a%i==0){
                a=a/i;
                std::cout<<" "<<i;
            }else break;
        }
        }
    }
    if(a!=1)std::cout<<" "<<a;
    std::cout<<std::endl;
}


Measured memory_bytes: 3136
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int n, m;
	while (cin >> n >> m, n || m) {
		vector<int>v(1,0);
		rep(i, 0, n + m) {
			int a; cin >> a;
			v.push_back(a);
		}
		sort(all(v));
		vector<int>ans;
		rep(i, 0, v.size()-1) {
			ans.push_back(v[i + 1] - v[i]);
		}
		cout << *max_element(all(ans)) << endl;
	}
	return 0;
}

Measured memory_bytes: 3156
#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  1001001001;
#define PI  3.14159265358979323846;

int main(){
int N;
cin>>N;
int a[N];
rep(i,N){
    cin>>a[i];
}
int count=1;
rep(i,N){
    if(a[i]==count){
        count++;
    }
}
if(count!=1){
cout<<(N-count+1)<<endl;
}
else{
    cout<<-1<<endl;
}
return 0;
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;
//using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

    void solve()
    {
        int A = cin.nextint;
        int B = cin.nextint;
        if (A <= 8 && B <= 8)
        {
            WriteLine("Yay!");
        }
        else
        {
            WriteLine(":(");
        }
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 11092
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <unordered_map>
#define maxn 100005
#define mod 998244353
using namespace std;
typedef long long LL;
int main()
{
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    printf("%d %d %d",c,a,b);
    return 0;
}


Measured memory_bytes: 888
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
	int n;
	cin>>n;
	int res = 0;
	for(int i = 2;i <= 55555; ++i)
	{
		int cnt = 0;
		for(int j = 2;j < i; ++j)
		{
			if(i % j == 0)
			{
				cnt++;
			}
		}
		if(cnt == 0 && i % 5 == 1)
		{
			cout<<i<<endl;
			res++;
			if(res == n)
			{
				return 0;
			}
		}
	}
	return 0;
}

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

int main()
{
    long long int n,k,i,j;
    cin>>n>>k;

    vector<long long int> v(n+1);
    for(i=1;i<=n;i++)
        cin>>v[i];

    long long int dp[n+1][k+5];

    for(i=0;i<n+1;i++)
        for(j=0;j<k+5;j++)
            dp[i][j]=0;
    dp[0][0]=1;

    for(i=1;i<=n;i++)
    {
        vector<long long int> temp(k+5,0);

        for(j=0;j<=k;j++)
        {
            long long int req=min(v[i],k-j);
            temp[j]=(temp[j]+dp[i-1][j])%mod;
            if(j+req+1<k+5)
                temp[j+req+1]=(temp[j+req+1]-dp[i-1][j]+mod)%mod;
        }

        long long int prefix=0;
        for(j=0;j<k+5;j++)
        {
            prefix=(prefix+temp[j])%mod;
            dp[i][j]=prefix;
        }
    }

    cout<<dp[n][k];
}


Measured memory_bytes: 79984
A, B, C, X, Y = tuple(map(int, input().split()))

byeEachAB = A * X + B * Y
byeABless = A * (X - min(X, Y)) + B * (Y - min(X, Y)) + C * min(X, Y) * 2
byeABmore = C * max(X, Y) * 2
print(min(byeEachAB, byeABless, byeABmore))

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

#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)

int func(int n,int m){
    vector<int> min_score(n,0);
    vector<int> max_score(n,0);
    for(int i=0;i<m;++i){
        int score;
        int k;
        cin >> score >> k;
        for(int j=0;j<k;++j){
            int d;
            cin >> d;
            --d;
            max_score[d] += score;
            if(k==1)min_score[d] += score;
        }
    }

    using pii = pair<int,int>;
    vector<pii> mins;
    vector<pii> maxs;
    for(int i=0;i<n;++i){
        mins.emplace_back(min_score[i],i);
        maxs.emplace_back(max_score[i],i);
    }

    sort(mins.begin(),mins.end());
    sort(maxs.begin(),maxs.end(),greater<pii>());
    
    int res = 0;
    for(int i=0;i<2;++i){
        for(int j=0;j<2;++j){
            if(mins[i].second==maxs[j].second)continue;
            int d = maxs[j].first - mins[i].first + 1;
            if(res<d)res=d;
        }
    }
    return res;
}

int main(){
    int n,m;
    while(true){
        cin >> n >> m;
        if(n==0 and m==0)break;
        cout << func(n,m) << endl;
    }
    return 0;
}



Measured memory_bytes: 3288
#include<bits/stdc++.h>
#define ll long long
#define rg register
using namespace std;
const int MAXN=1e5+10;
const int Mod=1e9+7;
char Str[MAXN];
int n,Ans=1,Num[30];
int main()
{   scanf("%d\n%s",&n,Str+1);
	for(rg int i=1;i<=n;i++) Num[Str[i]-'a']++;
	for(rg int i=0;i<=25;i++) Ans=1ll*Ans*(Num[i]+1)%Mod;
	printf("%d\n",(Ans-1+Mod)%Mod);
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
string S[100];
int H, W;
int ans[200][200];

int main() {
  cin >> H >> W;
  rep(i, 0, H) { cin >> S[i]; }
  rep(y, 0, H) {
    rep(x, 0, W) {
      if (S[y][x] == '#') {
        ans[y][x] = -1;
        continue;
      }
      int cnt = 0;
      rep(i, 0, 8) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (0 <= nx && nx < W && 0 <= ny && ny < H) {
          if (S[ny][nx] == '#') {
            ++cnt;
          }
        }
      }
      ans[y][x] = cnt;
    }
  }

  rep(y, 0, H) {
    rep(x, 0, W) {
      if (ans[y][x] == -1) {
        cout << "#";
      } else {
        cout << ans[y][x];
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++)
#define REP(i,b) FOR(i,0,b)
#define ALL(c) c.begin(),c.end()
#define PB push_back
#define cat //cout << __LINE__ << endl;
using namespace std;
typedef long long LL;
typedef double ld;
typedef LL ut;
typedef vector<ut> VI;
typedef pair<ut,ut> pr;
const int SIZE=5+3*1e3;
const int INF=10+1e9;
bool exist[10][10];

int N,M;
int solve(int now,bool ended[10],int times){
	if(times==N) return 1;
	int ans=0;
	FOR(i,1,N+1)
		if(exist[now][i] && !ended[i]) {
			ended[i]=true;
			ans+=solve(i,ended,times+1);
			ended[i]=false;
		}
	return ans;
}
int main(){
	int a,b;
	cin >> N >> M;
	REP(i,M){
		cin >> a>> b;
		exist[a][b]=exist[b][a]=true;
	}
	bool ended[10]={0,1};
	cout << solve(1,ended,1) << endl;

	return 0;
}

Measured memory_bytes: 256
N,x=list(map(int,input().split(" ")))
a=list(map(int,input().split(" ")))
time=0
for i in range(N-1):
    if a[i]+a[i+1]>x:
        time+=a[i+1]+a[i]-x
        if x-a[i]<0:
            a[i+1]=0
            a[i]=x
        else:
            a[i+1]=x-a[i]
print(time)

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

const long long MOD = 1000000007;
const long long MAX = 2000000;

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

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


Measured memory_bytes: 256
import java.util.Scanner;


public class Main {
//	final static int MOD = 1000000007;

	public static long ans = 0;

	public static void main(String[] args) {

//		int ans = 0;
		Scanner sc = new Scanner(System.in);
		boolean f = false;

//		long a = sc.nextLong();

		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i]= sc.nextInt();
		}

		//-------------------------------------------------------------------------------------

		for(int i = 0; i < n; i += 2) {

			if(a[i] % 2 != 0)
				ans++;


		}

		//-------------------------------------------------------------------------------------

//		if(f) {
//			System.out.println("Yes");
//		} else {
//			System.out.println("No");
//		}

		System.out.println(ans);

		sc.close();
	}
}

Measured memory_bytes: 35744
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <functional>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, n) for (int i = 1; i < (int)(n); ++i)
using namespace std;
using lint = int64_t;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    vector<lint> sum(N + 1, 0);
    rep(i, N) sum[i + 1] = sum[i] + A[i];
    map<lint, int> mp;
    lint ans = 0;
    rep(i, N + 1) {
        ans += mp[sum[i] % M];
        ++mp[sum[i] % M];
    }
    cout << ans << "\n";
    return 0;
}


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


int main(){
    ll X; cin >> X;
    ll ans = 0;
    for(int i = 1; ; i++){
        ans += i;
        if(ans >= X) {
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define inf 1000000005
#define mod 1000000007
#define eps 1e-10
#define rep(i,n) for(int i = 0; i < (n); ++i) /*0からn-1までのrepeat*/
#define rrep(i,n) for(int i = 1; i <= (n); ++i) /*1からnまでのrepeat*/
#define drep(i,n) for(int i = (n)-1; i >= 0; --i) /*n-1から0までのrepeat*/
#define srep(i,s,t) for (int i = s; i < t; ++i) /*sからt-1までのrepeat*/
#define isin(x,l,r) ((l) <= (x) && (x) < (r)) /*l以上r未満のx*/
#define each(a,b) for(auto& (a): (b)) /*よくわからん*/
#define pct __builtin_popcountll /*1bitの数*/
#define all(a) a.begin(),a.end() /*範囲*/
#define sz(v) (int)(v).size() /*大きさ*/
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end()) /*重複削除*/
#define cmx(x,y) x=max(x,y) /*最大*/
#define cmn(x,y) x=min(x,y) /*最小*/
#define rev(v) reverse((v).begin(),(v).end()); /*逆順*/
#define so(v) sort((v).begin(), (v).end()); /*ソート*/
#define yn {puts("Yes");}else{puts("No");} /*はい・いいえ*/
#define dame { puts("-1"); return 0;}/*だめ*/
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using namespace std;

using ll = long long;
using unit = unsigned;
using ull = unsigned long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vp = vector<P>;
using vt = vector<T>;
using vs = vector<string>;

int main() {
    int a, b,c,d;
    cin >> a >> b>>c>>d;
    if (a != c) {
        cout << 1 << endl;
    }
    else {
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <climits>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long H, W;
    cin >> H >> W;

    if(H % 3 == 0 || W % 3 == 0){
        cout << 0 << endl;
        return 0;
    }
    long long ans = 1LL << 30;
    ans = min(ans, W);
    ans = min(ans, H);

    for(int i=1; i<H; i++){
        long long S1 = W * i;
        long long W1 = W / 2;
        long long W2 = W - W1;
        long long S2 = W1 * (H - i);
        long long S3 = W2 * (H - i);
        long long mx = max(S1, max(S2, S3));
        long long mn = min(S1, min(S2, S3));
        ans = min(ans, mx - mn);
    }

    for(int i=1; i<W; i++){
        long long S1 = H * i;
        long long H1 = H / 2;
        long long H2 = H - H1;
        long long S2 = H1 * (W - i);
        long long S3 = H2 * (W - i);
        long long mx = max(S1, max(S2, S3));
        long long mn = min(S1, min(S2, S3));
        ans = min(ans, mx - mn);
    }

    cout << ans << endl;

    return 0;
}

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

int main(){
    bool flag = true;
    ll run, a, ans=1;
    ll M =  1e18;
    ll  list1[100005];

    cin >> run;

    for (ll i = 0; i < run; i++){
        cin >> a;
        list1[i]=a;
    }

    sort(list1, list1 + run);

    if(list1[0]==0){
        flag = false;
        cout << 0;
    }
    else{
        for (ll i = 0; i <run; i++){
            if(list1[i]<=M/ans){
                ans *= list1[i];
            }
            else{
                flag = false;
                cout << -1;
                break;
            }
        }
    }

    if(flag){
        cout << ans;
    }
}


Measured memory_bytes: 4384
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int get() { int r; cin >> r; return r; }
void cgl7e(double x0, double y0, double r1, double x3, double y3, double r2) {
	double r = r1, x1, x2, y1, y2;
	if (y0 == y3) {
		y1 = 1;
		x1 = ((x0 - x3) * (x0 + x3) + (y0 - y3) * (y0 + y3) - (r1 - r2) * (r1 + r2) - 2 * (y0 - y3) * y1) / (x0 - x3) / 2;
		y2 = 2;
		x2 = ((x0 - x3) * (x0 + x3) + (y0 - y3) * (y0 + y3) - (r1 - r2) * (r1 + r2) - 2 * (y0 - y3) * y2) / (x0 - x3) / 2;
	}
	else {
		x1 = 1;
		y1 = ((x0 - x3) * (x0 + x3) + (y0 - y3) * (y0 + y3) - (r1 - r2) * (r1 + r2) - 2 * (x0 - x3) * x1) / (y0 - y3) / 2;
		x2 = 2;
		y2 = ((x0 - x3) * (x0 + x3) + (y0 - y3) * (y0 + y3) - (r1 - r2) * (r1 + r2) - 2 * (x0 - x3) * x2) / (y0 - y3) / 2;
	}

	double p = ((y2 - y1) * (x0 - x1) - (x2 - x1) * (y0 - y1)) / ((x2 - x1) * (x1 - x2) + (y2 - y1) * (y1 - y2));
	p = -p;
	double x4 = x0 + p * (y1 - y2), y4 = y0 - p * (x1 - x2);
	double k = sqrt(r * r - (x0 - x4) * (x0 - x4) - (y0 - y4) * (y0 - y4)) / sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
	if (x1 < x2) { swap(x1, x2); swap(y1, y2); }
	else if (x1 == x2 && y1 < y2) { swap(x1, x2); swap(y1, y2); }
	printf("%.10f %.10f\n%.10f %.10f\n", x4 - k * (x1 - x2), y4 - k * (y1 - y2), x4 + k * (x1 - x2), y4 + k * (y1 - y2));
}
signed main() {
	double px, py, cx, cy, r; cin >> px >> py >> cx >> cy >> r; cgl7e(cx, cy, r, (cx + px) / 2, (cy + py) / 2, sqrt((cx - px) * (cx - px) + (cy - py) * (cy - py)) / 2);
}


Measured memory_bytes: 3216
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
using namespace std;


int main(){
    int N;
    cin >> N;
    int x[8], y[8];
    for(int i=0; i<N; i++){
        cin >> x[i] >> y[i];
    }

    vector<int> v;
    for(int j=0; j<N; j++){
        v.push_back(j);        
    }

    int a = 0;
    double sumd = 0;
    do {
        for(int m=0; m<N-1; m++){
            sumd += pow((x[v[m]]-x[v[m+1]])*(x[v[m]]-x[v[m+1]])+(y[v[m]]-y[v[m+1]])*(y[v[m]]-y[v[m+1]]),0.5);
        }                     
        a++;
    }while(next_permutation(v.begin(), v.end()));

    double answer;
    answer = sumd/a;
    cout << fixed << setprecision(10) << answer;


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF LLONG_MAX/5
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
int mypow(int a,int b,int c){
	if(b==0)return 1;
	if(b%2)return mypow(a,b-1,c)*a%c;
	int z=mypow(a,b/2,c);
	return z*z%c;
}
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int x[10],y[10],z[10];
signed main(){
	int a,vx,vy,cnt=0;
	cin>>a;
	f(i,a){
		cin>>x[i];
	}
	f(i,a){
		cin>>y[i];
	}
	f(i,a){
		z[i]=i+1;
	}
	do{
		bool b1=true,b2=true;
		f(i,a){
			if(x[i]!=z[i])b1=false;
			if(y[i]!=z[i])b2=false;
		}
		if(b1)vx=cnt;
		if(b2)vy=cnt;
		cnt++;
	}while(next_permutation(z,z+a));
	cout<<abs(vx-vy)<<endl;	
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define pii Pi
#define pll PL
#define Fi first
#define Se second
#define pb(x) push_back(x)
//#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> pll;
typedef long double ldouble;
typedef pair<double, double> pdd;

const double PI = acos(-1);
const double EPS = 1e-9;

const int MX = 1000005;
const int MM = 998244353;

int main()
{
	int N, A, B;
	scanf("%d%d%d", &N, &A, &B);
	if( (B-A) % 2 == 1 ) printf("Borys\n");
	else printf("Alice\n");
}


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

int main(void)
{
    string s;
    cin >> s;
  	int i;
    int counter = 0;
    if (s[0] == '1') ++counter;
    if (s[1] == '1') ++counter;
    if (s[2] == '1') ++counter;
    cout << counter << endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <cmath>
#include <functional>
#include <limits>
#include <map>
using namespace std;

typedef long long ll;
#define rep1(i, n) for(int i = 1; i <=(ll)(n); i++)
#define rep0(i, n) for(int i = 0; i <=(ll)(n); i++)

int main(){
    int k,n;
    cin >> n >> k;
    int p[n];
    rep0(i,n-1) cin >> p[i];
    sort(p, p+n);
    ll sum = 0;
    rep0(i,k-1){
        sum += p[i];
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using ull = unsigned long long;
//#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<V<T>>;
#define fi first
#define se second
#define maxs(x,y) (x=max(x,y))
#define mins(x,y) (x=min(x,y))
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1), EPS = 1e-10;
const ll MOD = 1e9+7;
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m;
  cin >> n >> m;
  V<bitset<10>> s;
  REP(i,m){
    int k;
    cin >> k;
    bitset<10> a;
    REP(i,k){
      int b;
      cin >> b;
      a[b-1] = 1;
    }
    //cout << a << endl;
    s.eb(a);
  }
  //for(auto i:s) cout << i << endl;
  vi p(m);
  REP(i,m) cin >> p[i];
  int ans = 0;
  for(unsigned i=0;i<(1ULL<<n);++i){
    bool fl = true;
    REP(j,m){
      bitset<10> a = s[j];
      //cout << a << endl;
      //cout << s[j] << endl;
      a&=i;
      //cout << s[j] << endl;
      if((int)a.count()%2!=p[j]){
        fl = false;
        break;
      }
    }
    if(fl) ++ans;
  }
  cout << ans << endl;
}



Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    r = int(next(tokens))  # type: int
    D= int(next(tokens))  # type: int
    X= int(next(tokens))  # type: int
    for i in range(10):
        X = r*X - D
        print(X)
    pass

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define dump(x) cout << (x) << endl

int main() {
  int n;
  cin >> n;
  vector<int> v(n), x(n);
  REP(i, n) {
    cin >> v[i];
  }
  x = v;
  sort(x.begin(), x.end());
  REP(i, n) {
    if (v[i] < x[n/2]) {
      dump(x[n/2]);
    }
    else {
      dump(x[n/2-1]);
    }
  }
  return 0;
}


Measured memory_bytes: 3712
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        sc.close();
        int ans = 0;

        for (int i = 0; i <= n; i++) {
            int cnt = func(s.substring(0, i).toCharArray(), s.substring(i).toCharArray());

            ans = Math.max(ans, cnt);
        }

        System.out.println(ans);
    }

    private static int func(char[] left, char[] right) {
        int cnt = 0;

        for (char c = 'a'; c <= 'z'; c++) {
            boolean flgleft = false;
            boolean flgright = false;
            for (int i = 0; i < left.length; i++) {
                if (left[i] == c) {
                    flgleft = true;
                }
            }
            for (int i = 0; i < right.length; i++) {
                if (right[i] == c) {
                    flgright = true;
                }
            }
            if (flgleft && flgright) {
                cnt++;
            }
        }
        return cnt;
    }
}

Measured memory_bytes: 23508
l = int(input()) - 1
edge = []
for i in range(1, 20):
    edge.append([i, i+1, 0])

a = 1
count = 0
length = []
while a*2-1 <= l:
    edge.append([count+1, count+2, a])
    length.append(a)
    a *= 2
    count += 1
dest = count+1
val = a
lest = l - (a-1)
lest_sep = []
for i in range(19, -1, -1):
    if lest >= 2**i:
        lest -= 2**i
        lest_sep.append(i)

for item in lest_sep:
    edge.append([item+1, dest, val])
    val += 2**(item)

print(20, len(edge))
for a, b, c in edge:
    print(a, b, c)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
ll maxi(ll a,ll b)
{
	if(a>=b) return a;
	else return b;
}
int main()
{
	ll n;// no of objects
	cin>>n;
	ll W; // max capacity of bag
	cin>>W;
	vector<int> w(n);
	vector<int> v(n);
	for(int i=0;i<n;i++)
	{
		cin>>w[i]>>v[i];
	}
	ll dp[W+1][n];
	for(int i=1;i<=W;i++)
	{
		if(i>=w[n-1])
		dp[i][n-1]=v[n-1];
		else
			dp[i][n-1]=0;
	}
	for(int i=0;i<n;i++)
	{
		dp[0][i]=0;
	}
	for(int i=1;i<=W;i++)
	{
		
		for(int j=n-2;j>=0;j--)
		{
			dp[i][j]=0;
			if(w[j]>i)
			dp[i][j]=dp[i][j+1];
			else
			{
			dp[i][j]= maxi( v[j]+dp[i-w[j]][j+1] , dp[i][j+1] );
		    }
		}
	}
	cout<<dp[W][0]<<endl;
	
}


Measured memory_bytes: 78336
#include<bits/stdc++.h>
#include <math.h>
#include <map>
#include <unordered_map>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define pb(s) push_back(s)
#define ci(x) cin >>x
#define co(x) cout<<x<<endl
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
ll GetDigit(ll num){
   ll digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}
long long fac(ll a) {
 long long ans=1;
 while(a>1){
 ans*=a;
 ans%=1000000007;
     a--;
    }
    return ans;
     }
int main() {
  string S;
  cin >>S;
  
    
  ll x=S.size();
  ll c=0;
  ll a=(S.at(0)-'0');
  repl(i,1,x) {
    if(S.at(i)=='9') {
      c++;
    }
  }
  if(c==x-1) {
    cout<<a+9*(x-1)<<endl;
  }
  else {
    cout<<a+9*(x-1)-1<<endl;
  }
}
    
  
    
  


Measured memory_bytes: 256
N,C=map(int,input().split())
D=[list(map(int,input().split())) for _ in [0]*C]
c=[list(map(int,input().split())) for _ in [0]*N]
t=[[0]*C for _ in [0]*3]
for i in range(N):
    for j in range(N):
        t[(i+j)%3][c[i][j]-1]+=1
s=float('inf')
for i in range(C):
    for j in range(C):
        if j==i:continue
        for k in range(C):
            if k==i or k==j:continue
            s=min(s,sum(t[0][n]*D[n][i] for n in range(C))\
                   +sum(t[1][n]*D[n][j] for n in range(C))\
                   +sum(t[2][n]*D[n][k] for n in range(C)))
print(s)

Measured memory_bytes: 5620
#include<iostream>
using namespace std;
int main(){

    int k;
    int a,b;
    cin>>k>>a>>b;
    int qa,ra,qb,rb;
    qa=a/k;
    ra=a%k;
    qb=b/k;
    rb=b%k;
    if(ra==0||rb==0){
        cout<<"OK";
    }
    else if(qb-qa>0){
        cout<<"OK";
    }
    else
        cout<<"NG";


}

Measured memory_bytes: 3168
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

using ll = long long;

const string UNRESTORABLE = "UNRESTORABLE";

int strcmp(string a, string b) {
    for (int j = 0; j < a.size(); ++j) {
        if (a[j] != b[j]) return a[j]-b[j];
    }
    return 0;
}

int main() {
    string ss, t;
    cin >> ss >> t;

    string ans = UNRESTORABLE;
    for (int j = 0; j + t.size() <= ss.size(); ++j) {
        bool ok = true;
        for (int k = 0; k < t.size(); ++k) {
            if (ss[j+k] == '?' || ss[j+k] == t[k]) {
            } else {
                ok = false;
                break;
            }
        }

        if (ok) {
            string u = ss;
            for (int k = 0; k < u.size(); ++k) {
                if (u[k] == '?') u[k] = 'a';
            }
            for (int k = 0; k < t.size(); ++k) {
                u[j+k] = t[k];
            }
            if (ans == UNRESTORABLE) {
                ans = u;
            } else if (strcmp(u, ans) < 0) {
                ans = u;
            }
        }
    }
    cout << ans << endl;

    return 0;
}
	


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

using namespace std;

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

	vector<pair<int,int>> work(N);

	for (int i = 0; i < N; i++)
	{
		int a, b;
		cin >> a >> b;
		work[i].first = b;
		work[i].second = a;
	}

	sort(work.begin(), work.end());

	long long time = 0;

	for (auto i : work) {
		time += i.second;
		if (time > i.first) {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 1792
#include"bits/stdc++.h"
#define int long long
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
typedef pair<int,int> P;
const int mod=1000000007;
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int lcm(int x,int y){return x*y/gcd(x,y);}
void YN(bool flg){cout<<(flg?"YES":"NO")<<endl;}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<endl;}
void yn(bool flg){cout<<(flg?"yes":"no")<<endl;}
signed main(){
	map<char,int> mp;
	string s;cin>>s;
	rep(i,3){
		mp[s[i]]++;
	}
	cout<<mp['1']<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pb push_back
const int N=20005;
const int MOD=1e9+7;
 

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
 int a[N],b[N],c[N];
 
int32_t main()
{
  
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

double a,v;
cin>>a>>v;
double b,w;
cin>>b>>w;
int t;
cin>>t;
double x=abs(b-a);
double y=v-w;
if(y<0)
{
cout<<"NO"<<endl;
return 0;
}
if(y<=0 && b-a>0)
{
cout<<"NO"<<endl;
return 0;
}
else
{
	double z=x/y;
	//cout<<z<<endl;
	if(z<=t)
	cout<<"YES"<<endl;
	else
	cout<<"NO"<<endl;
	
}	 
}


Measured memory_bytes: 3744
#include <bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;

int n, m, x;
int ans[234567], s[234567];
int main() {
    scanf("%d %d", &n, &x);
    m = 2*n-1;
    if (x==1 || x==m) {
        puts("No"); return 0;
    }
    puts("Yes");
    if (n==2) {
        printf("1\n2\n3\n"); return 0;
    }
    ans[n] = x;  s[x] = 1;
    ans[n-1] = x-1; s[x-1] = 1;
    ans[n+1] = x+1; s[x+1] = 1;
    if (x != 2) {
        ans[n+1] = x-1;
        ans[n-1] = x+1;
        ans[n-2] = x-2; s[x-2] = 1;
    } else {
        ans[n-2] = x+2; s[x+2] = 1;
    }
    int ut = 1;
    fo(i,0,m) {
        if (i==n-1 || i==n || i==n+1 || i==n-2) continue;
        while (s[ut]) ut++;
        ans[i] = ut;
        s[ut] = 1;
    }
    fo(i,0,m) printf("%d\n", ans[i]);

        return 0;
}


Measured memory_bytes: 3072
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

#define MAX 100

using Weight = int;
struct Edge {
	int s; //source
	int d; //destination
	Weight w; //weight
	Edge(int s = 0, int d = 0, int w = INF) : s(s), d(d), w(w) {};
};
using Edges = vector<Edge>;
//???????????\???
//g[u].push_back(Edge(u, v, c));
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;

//?????¢?´¢, ??¢?´¢???, ??¢?´¢???
enum { WHITE, GRAY, BLACK };

//???????§????????????? (Dijkstra)
//?????????: ??????????????§????????¢
vector<Weight> dijkstra(Graph g, int s) {
	typedef pair<Weight, int> State; //?§?????????????????°?????????? ??????id
	priority_queue<State, vector<State>, greater<State> >PQ;
	vector<int> color(g.size(), WHITE);
	vector<Weight> dist(g.size(), INF); //distance
	dist[s] = 0; PQ.push(State(0, s)); color[s] = GRAY; //?§????
	while (!PQ.empty()) {
		Weight d; int v;
		tie(d, v) = PQ.top(); PQ.pop(); //dist???????°??????¨??????????´????????????????	
		if (dist[v] < d) continue; //?????§???????????§???????????°??????
		color[v] = BLACK;
		for (auto e : g[v]) { //??£??\????????????????????¨????????????		
			if (color[e.d] == BLACK)continue; //??¢?´¢????????????
			if (dist[e.d] > dist[v] + e.w) {
				dist[e.d] = dist[v] + e.w;
				PQ.push(State(dist[e.d], e.d));
				color[e.d] = GRAY;
			}
		}
	}
	return dist;
}

int main() {
	int n; cin >> n;
	Graph g(n);
	for (int i = 0; i < n; i++) {
		int u, k; scanf("%d%d", &u, &k);
		for (int j = 0; j < k; j++) {
			int v, c; scanf("%d%d", &v, &c);
			g[u].push_back(Edge(u, v, c));
		}
	}
	vector<Weight> ans = dijkstra(g, 0);
	for (int i = 0; i < n; i++) {
		printf("%d %d\n", i, ans[i]);
	}
	return 0;
}

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

pair<int,int> swap(int a, int b) {
    pair<int,int> swapped=make_pair(b,a);
    return swapped;
}

int main() {
    int X,Y,Z;
    cin >> X >> Y >> Z;

    pair<int,int> exchange=swap(X,Y);
    X=exchange.first;
    Y=exchange.second;
    exchange=swap(X,Z);
    X=exchange.first;
    Z=exchange.second;

    cout << X << " " << Y << " " << Z << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
int A,B,V,W,T;
int main(){
	A=read(),V=read();
	B=read(),W=read();
	T=read();
	if(1LL*(V-W)*T>=abs(A-B)){
		printf("YES\n");
	}
	else{
		printf("NO\n");
	}
	return 0;
}


Measured memory_bytes: 3644
import java.io.InputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger[] a = new BigInteger[n];
    for (int i = 0; i < n; i++) {
      a[i] = BigInteger.valueOf(Long.parseLong(sc.next()));
    }
    BigInteger lcm = multiLcm(a);
    BigInteger ans = Arrays.stream(a)
      .parallel()
      .map(ai -> lcm.divide(ai))
      .reduce(BigInteger::add)
      .get().remainder(BigInteger.valueOf(1000000007));
    pw.println(ans);
  }

  static BigInteger multiLcm(BigInteger[] values) {
    return Arrays.stream(values).reduce((a, b) -> {
      BigInteger gcm = a.gcd(b);
      return a.multiply(b.divide(gcm));
    }).get();
  }
}


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

const int MAX = 100000;
const int INFTY = 1 << 30;

struct Edge{
	int t, w;
};

vector<Edge> G[MAX];
int n, d[MAX], cnt;
bool vis[MAX];

void bfs(int s)
{
	for (int i = 0; i < n; ++i)d[i] = INFTY;
	queue<int> Q;
	Q.push(s);
	d[s] = 0;
	int u;
	while (!Q.empty())
	{
		u = Q.front();
		Q.pop();
		for (int i = 0; i < G[u].size(); ++i)
		{
			Edge e = G[u][i];
			if (d[e.t] == INFTY){
				d[e.t] = d[u] + e.w;
				Q.push(e.t);
				
			}
		}
	}
}

void solve()
{
	//从任选的结点出发，选择距离s最远的结点tgt
	bfs(0);
	int maxv = 0, tgt = 0;
	for (int i = 0; i < n; ++i)
	{
		if (d[i] == INFTY)continue;
		if (maxv < d[i]){
			maxv = d[i];
			tgt = i;
		}
	}
	
	bfs(tgt);
	maxv = 0;
	for (int i = 0; i < n; ++i)
	{
		if (d[i] == INFTY)continue;
		maxv = max(maxv, d[i]);
	}
	cout << maxv << endl;
}

int main()
{
	int s, t, w;
	cin >> n;
	for (int i = 0; i < n - 1; ++i)
	{
		cin >> s >> t >> w;
		G[s].push_back(Edge{t, w});
		G[t].push_back(Edge{s, w});
	}
	solve();
	return 0;
}


Measured memory_bytes: 9868
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repq(i,a,n) for(int i=a; i<=n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

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

Measured memory_bytes: 256
com=[0]*1001
chk=[]
while 1:
    try:
        n=list(map(int,input().split(",")))
        com[n[0]]+=1
    except:break
while 1:
    try:
        n=list(map(int,input().split(",")))
        if com[n[0]]>0:
            com[n[0]]+=1
            chk.append(n[0])
    except:break
chk_i=list(set(chk))
chk_i.sort()
for i in chk_i:
    print(i,com[i])


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



int main(){
    ll H,W;
    cin >> H >> W;
    char photo[2 * H][W];
    memset(photo, ' ', sizeof(photo));
    
    for(int i = 0; i < 2 * H; i += 2){
        for(int j = 0; j < W; j++){
            cin >> photo[i][j];
            photo[i + 1][j] = photo[i][j];
        }
    }

    for(int i = 0; i < 2 * H; i++){
        for(int j = 0; j < W; j++){
            cout << photo[i][j];
        }
        cout << endl;
    }
    cout << endl;

}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int size=0;
  int num=0;
  int max=-10000000;
  int min=10000000;
  long long int sum=0;
  scanf("%d",&size);

  for(int i=0;i<size;i++){
    scanf("%d",&num);
    sum+=num;

    if(num<min){
      min=num;
    }
    if(num>max){
      max=num;
    }
  }
  printf("%d %d %lld\n",min,max,sum);

  return 0;
}



Measured memory_bytes: 2760
/**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n, m, q; 
int a[55], b[55], c[55], d[55];
vector<int> x;
int ans;

void rec(int pos) {
    if(pos == n) {
        int res = 0;
        rep(j, q) {
            if(x[b[j]] - x[a[j]] == c[j]) {
                res += d[j];
            }
        }
        chmax(ans, res);
        return;
    }
    for(int i = x[pos]; i <= m; ++ i) {
        x.pb(i);
        rec(pos + 1);
        x.pop_back();
    }
}

void solve() {
	cin >> n >> m >> q;
    rep(i, q) {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        --a[i], --b[i];
    }   
    x.push_back(1);
    ans = 0;
    rec(0);
    cout << ans << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 3660
// C.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

int main(int argc, char* argv[]) {
	while (true) {
		int n = -1;
		cin >> n;
		if (n <= 0) break;
		int prev = 1 << 30, ans = 0;
		for (int i = 0; i < n - 1; ++i) {
			int b;
			cin >> b;
			ans += min(prev, b);
			prev = b;
		}
		ans += prev;
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int arr[n];
  for(int i=0;i<n;i++)
  {
    cin>>arr[i];
  }
  int cost[1000000]={-1};
  cost[n-2] = abs(arr[n-1] - arr[n-2]);
  for(int i=n-3;i>=0;i--)
  {
    cost[i] = min(cost[i+1] + abs(arr[i] -arr[i+1]),cost[i+2] + abs(arr[i+2] - arr[i]));
  }
  cout<<cost[0]<<endl;
  
}

Measured memory_bytes: 4480
// A - XOR Circle
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	int x = 0;
	for (int i = 0; i < n; i++)
		x ^= a[i];

	cout << (x == 0 ? "Yes" : "No") << endl;

	return 0;
}


Measured memory_bytes: 892