akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
    詰まった時に、別の分野の問題として考え直す（これdpでは？、グラフとしてみればいいのでは？）
    多くの問題はパターンマッチだが、パターンに落とし込むまでが難しく、そのための訓練としてわからない問題をあれこれ色々な角度から考察してみるのではないか
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };

/* <--------------------------------------------> */

int n;
vector<vector<ll>> a(18, vector<ll>(18));
vector<ll> memo(1<<18, 0);
vector<bool> flg(1<<18, false);

ll f(int S){
    if(flg[S]) return memo[S];
    flg[S]=true;

    ll tmp=0;
    rep(i, n) repr(j, i+1, n) if(S&1<<i && S&1<<j) tmp+=a[i][j];
    for(int T=S; T>0; T=(T-1)&S){
        chmax(tmp, f(T)+f(S^T));
    }
    return memo[S]=tmp;
}


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

    cin >> n;
    rep(i, n) rep(j, n) cin >> a[i][j];
    cout << f((1<<n)-1) << endl;

    
    return 0;
}


Measured memory_bytes: 2304
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>


using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

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

#define pb push_back
#define mp make_pair
#define mt make_tuple



int main(void)
{
    cin.sync_with_stdio(false);
    ll N, X;
    cin >> N >> X;
    vector<ll> Xs(N);
    REP(n, N) cin >> Xs[n];

    auto Ys = Xs;
    reverse(ALL(Ys));

    vector<ll> Y_sum(N);
    Y_sum[0] = Ys[0];
    FOR(i, 1, N) Y_sum[i] = Y_sum[i - 1] + Ys[i];

    //ll ans = 1e18; // ★本番はこれのせいでWA？
    __int128 ans = 1e18;
    FOR(rep_num, 1, N + 1) { // ゴミ箱に行く回数
        __int128 local_ans = X * rep_num;

        local_ans += 5 * Y_sum[rep_num-1];

        ll i = 2 * rep_num - 1;
        ll n = 1;

        // ★正答解以外の解の計算中、long long intの範囲を飛び出してしまうことがありうるらしい（回答pdfより）
        // よって__int128などを使う必要がある
        while (i <= N - 1) {
            local_ans += (2LL * n + 3) * (Y_sum[i] - Y_sum[i - rep_num]);
            n += 1;
            i += rep_num;
        }

        local_ans += (2LL * n + 3) * (Y_sum[N - 1] - Y_sum[i - rep_num]);

        ans = min(ans, local_ans);
    }

    ll ans2 = (ll)ans;
    cout << (ans2 + N * X) << endl;

    return 0;
}


Measured memory_bytes: 4992
ll= lambda : list(map(int,input().split()))
testcases=1
#testcases=int(input())
for testcase in range(testcases):
	[N,A,B,C,D]=ll()
	s=input() 
	index = [(n+1) for n, v in enumerate(s) if s[n:n+3] == "..."]
	if C < D:
	    if "##" in s[A-1:D]:
	        print("No")
	    else:
	        print("Yes")
	 
	if C > D:
	    if "##" in s[A-1:C]:
	        print("No")
	    else:
	        if len(index)>=1:
	            for i in index:
	                if B <= i+1 <= D:
	                    print("Yes")
	                    exit()
	            print("No")
	        else:
	            print("No")

Measured memory_bytes: 40176
#include<stdio.h>
#include<stdlib.h>

typedef struct list{
    int H;
    int W;
    struct list *next;
}List;

List *head = NULL;


void insert(int a, int b){
    List *node = (List *) malloc(sizeof(List));
    node->H = a;
    node->W = b;
    node->next = NULL;

    if (head == NULL){
        head = node;
    }

    else
    {
        List *p = head;

        while (p->next != NULL)
        {
            p = p->next;
        }
        p->next = node;
    }
}

void print(){
    List *p = head;

    while (p != NULL)
    {
        // printf("%d %d\n",p->H , p->W);

        for (int i = 0; i < p->H; i++)
        {
            for (int j = 0; j < p->W; j++){
                if (i%2 == 1 && j%2 == 1){
                    printf("#");
                }
                else if(i%2 == 0 && j%2 == 0){
                    printf("#");
                }
                else{
                    printf(".");
                }
            }
            printf("\n");
        }
        printf("\n");

        p = p->next;
    }

}



int main(){
    while(1){
        int H, W;
        scanf("%d" "%d" , &H, &W);
        if (H == 0 && W == 0){
            break;
        }
        insert(H, W);
    }

    print();



    return 0;
}



Measured memory_bytes: 2104
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		int count = selectionSort(A, N);
		for (int i = 0; i < N; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(A[i]);
		}
		System.out.printf("\n");
		System.out.println(count);
		sc.close();
	}

	public static int selectionSort(int[] A, int N) {
		int count = 0;
		for (int i = 0; i < N - 1; i++) {
			int minj = i;
			for (int j = i; j < N; j++) {
				if (A[j] < A[minj]) {
					minj = j;
				}
			}
			int tmp = A[i];
			A[i] = A[minj];
			A[minj] = tmp;
			if (i != minj) {
				count++;
			}
		}
		return count;
	}
}



Measured memory_bytes: 26288
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

void dfs(int v,vector<int> &group_mem ,const Graph &friends,vector<bool> &seen){
    if(seen[v])return;
    seen[v]=true;
    group_mem.push_back(v);
    for (auto next_v : friends[v]){
        if(seen[next_v])continue;
        dfs(next_v,group_mem, friends, seen);
    }
}
int main() {
    int M,K;
    int N;
    cin >> N >> M >> K;
    Graph friends(N);
    vector<bool> seen(N);
    vector<int> ans(N,0);
    vector<int> group(N);

    int a,b;
    for (int i = 0; i < M; i++){
        cin >> a >> b;
        friends[a-1].push_back(b-1);
        friends[b-1].push_back(a-1);
    }
    seen.assign(N,false);
    int label=0;
    for (int i = 0; i < N; i++){
        vector<int> group_mem;
        dfs(i,group_mem, friends, seen);
        for (auto v:group_mem){
            group[v]=label;
            ans[v]+=group_mem.size()-friends[v].size()-1;
        }
        if(group_mem.size()>0)label++;
    }
    for (int i = 0; i < K; i++){
        cin >> a >> b;
        if(group[a-1]==group[b-1]){
            ans[a-1]--;ans[b-1]--;
        }
    }

    for (int i = 0; i < N; i++){
        cout << ans[i] << " ";
    }
    cout << endl;
}


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

#define rep(a,b) for(int a = 0;a < b;a++)
#define REP(i, x, n) for(int i = x; i < n; i++)
#define P(a) cout << a << endl
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ssort(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define vP(v) for(int i = 0;i < v.size();i++){cout << v[i];if(i != v.size()-1)cout << endl;}

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 1, -1 , 0 , 0 };
int dy[] = { 0,  0,  1, -1 };
ll MOD = 1000000007;

void solve(){
	vector<int> v;
	rep(i,3){
		int a;
		cin >> a;
		v.pb(a);
	}
	ssort(v);
	if(v[0] == 5 and v[1] == 5 and v[2] == 7){
		P("YES");
	}else{
		P("NO");
	}
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static int roo(int n){
    int ans =1;
    while(n>0){
      ans = ans * n;
      n = n-1;
    }
    return ans;
  }
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n= sc.nextInt();
    int[][] array = new int[n][2];
    double sum =0;

    for(int i=0; i<n; i++){
      array[i][0] = sc.nextInt();
      array[i][1] = sc.nextInt();
    }
    int k =1;
    for(int i=0; i<n-1;i++){

      for(int j=k; j<n; j++){
        sum += Math.sqrt((array[i][0]-array[j][0])*(array[i][0]-array[j][0])+(array[i][1]-array[j][1])*(array[i][1]-array[j][1]));
      }
      k += 1;
    }

    sum = sum * roo(n-2)* (n-1) *2 ;



    System.out.println(sum/roo(n));

  }
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int h,w,m; cin >> h >> w >> m;
  static int br[300001];
  static int bc[300001];
  int cntr[300001] = {};
  int cntc[300001] = {};
  int maxr=0,maxc=0;
  for(int i = 0; i < m; ++i){
    cin >> br[i] >> bc[i];
    ChangeMax(maxr,++cntr[br[i]]);
    ChangeMax(maxc,++cntc[bc[i]]);    
  }
  static uset<int>r,c;
  for(int i = 1; i <= h; ++i)if(maxr == cntr[i])r.insert(i);
  for(int i = 1; i <= w; ++i)if(maxc == cntc[i])c.insert(i);
  int cntd = 0;
  for(int i = 0; i < m; ++i)
    cntd += r.count(br[i])&&c.count(bc[i]);
  cout << maxr + maxc - (cntd == (ll)r.size()*(int)c.size()) << endl;
}


Measured memory_bytes: 35404
#coding: utf-8

n = int(input())
R = []

#input_value?????????
for i in range(n):
    R.append(int(input()))

max_dif = -2000000000
min_value = R[0]

for i in range(1, n):
    max_dif = max(max_dif, R[i] - min_value)
    min_value = min(min_value, R[i])

print(max_dif)

Measured memory_bytes: 15628
import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n     = sc.nextLong
  val sqrtN = Math.sqrt(n).toInt


  val res =
    (1 to sqrtN)
      .withFilter(n % _ == 0)
      .map{a => (a - 1) + (n / a - 1)}
      .min

  println(res)
}


Measured memory_bytes: 36304
/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-03-19 12:31:43
**/

#include <iostream>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
#include <bitset>
#include <cassert>
#include <cctype>
#include <iomanip>
#include <random>
#include <utility>
#include <chrono>

using namespace std;

using int64 = long long;

template<class T> using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) { os << '{'; size_t n = vec.size(); for (size_t i = 0; i < n; ++i) { os << vec[i]; if (i != n - 1) os << ','; } os << '}'; return os; }
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) { return os << '{' << p.first << " " << p.second << '}'; }
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) { os << '{'; for (auto it = mp.begin(); it != mp.end(); ++it) { os << '{' << it->first << ':' << it->second << '}'; if (it != --mp.end()) os << ','; } os << '}'; return os; }
template<class T> std::ostream& operator<<(std::ostream& os, const std::set<T>& st) { os << '{'; for (auto it = st.begin(); it != st.end(); ++it) { os << *it; if (it != --st.end()) os << ','; } os << '}'; return os; }
template<class T> std::istream& operator>>(std::istream& is, std::vector<T>& vec) { size_t n = vec.size(); for (size_t i = 0; i < n; ++i) is >> vec[i]; return is; }

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...) 1728
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

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

  int n, l; cin >> n >> l;
  vector<int> a(n); cin >> a;

  int pos = -1;
  for (int i = 0; i < n - 1; ++i) {
    if (a[i] + a[i + 1] >= l) {
      pos = i; break;
    }
  }

  if (pos == -1) {
    cout << "Impossible" << endl; return 0;
  }

  cout << "Possible" << '\n';
  ++pos;
  debug(pos);

  for (int i = 1; i < pos; ++i) {
    cout << i << '\n';
  }

  for (int i = n - 1; i >= pos; --i) {
    cout << i << '\n';
  }

  return 0;
}

Measured memory_bytes: 1280
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<deque>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

using namespace std;

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

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

int main()
{
	int h,w;
	int a,b;
	cin >> h >> w;
	REP(i,h)
	{
		REP(j,w)
		{
			string str;cin >> str;
			if(str == "snuke"){a=i;b=j;}
		}
	}
	
	cout << (char)('A'+b) << a+1 << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int i = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define MP make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int MOD = 1e9 + 7;

int main() {
    int W, a, b;
    cin >> W >> a >> b;
    int res = INF;
    if(b > a + W) {
        res = b - (a + W);
    } else if(a > b + W) {
        res = a - (b + W);
    } else {
        res = 0;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
using namespace std;
 
#define ll long long
 
 
int main() {
  	string S, T;
  	cin >> S >> T;
  	
  	for(ll i=0; i < S.size(); i++){
     	 if(S[i]!=T[i]){
           	cout << "No" << endl;
           	exit(0);
         }
    }
  	cout << "Yes" << endl;
  	
}

Measured memory_bytes: 3624
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

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

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

// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
// clang-format on
char b;
int main(void)
{
  cin >> b;
  char res;
  if (b == 'A')
    res = 'T';
  else if (b == 'C')
    res = 'G';
  else if (b == 'G')
    res = 'C';
  else if (b == 'T')
    res = 'A';
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define hhh printf("hhh\n")
#define see(x) (cerr<<(#x)<<'='<<(x)<<endl)
using namespace std;
typedef long long ll;
typedef pair<int,int> pr;
inline int read() {int x=0,f=1;char c=getchar();while(c!='-'&&(c<'0'||c>'9'))c=getchar();if(c=='-')f=-1,c=getchar();while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return f*x;}

const int maxn = 3e5+7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9+7;



int main() {
    ll n; cin>>n;
    if(n&1) return printf("0\n"), 0;
    n/=10;
    ll ans=n, t=5;
    while(t<=n) ans+=n/t, t*=5;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long l;
int main()
{
    string s , t;
    cin>>s;
    cin>>t;
    l l1 = s.length();
    l l2 = t.length();
    l dp[l1+1][l2+1]; 
   l i, j; 
   
 
   for (i=0; i<=l1; i++) 
   { 
     for (j=0; j<=l2; j++) 
     { 
       if (i == 0 || j == 0) 
         dp[i][j] = 0; 
   
       else if (s[i-1] == t[j-1]) 
         dp[i][j] = dp[i-1][j-1] + 1; 
   
       else
         dp[i][j] = max(dp[i-1][j], dp[i][j-1]); 
     } 
   } 
   l ans = dp[l1][l2];
   
   
   
   
   char LCS[ans+1];
   LCS[ans] = '\0'; 
   
   
    i = l1, j = l2;
   while (i > 0 && j > 0)
   {
      if (s[i-1] == t[j-1])
      {
          LCS[ans-1] = s[i-1]; 
          i--; j--; ans--;     
      }
      else if (dp[i-1][j] > dp[i][j-1])
         i--;
      else
         j--;
   }
 
   cout<<LCS;
   
   
    return 0;
}

Measured memory_bytes: 70656
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Stack;

class Main{
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int q=sc.nextInt();
		String name[]=new String[n];
		
		String queue[]=new String[1000000];
		int head=0, tail=0;
		int totaltime=0;
		int now=0;
		Map<String,Integer> time=new HashMap<String,Integer>();
		
		for(int i=0;i<n;++i) {
			name[i]=sc.next();
			time.put(name[i],sc.nextInt());
			totaltime+=time.get(name[i]);
			queue[tail]=name[i];
			++tail;
		}

		while(now!=totaltime) {
			if(time.get(queue[head])>q) {
				time.put(queue[head], time.get(queue[head])-q);
				queue[tail]=queue[head];
				++head;
				++tail;
				now+=q;
			}
			else {
				now+=time.get(queue[head]);
				System.out.println(queue[head]+" "+now);
				++head;
			}
		}
		

	}
}



Measured memory_bytes: 84872
#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<functional>
#include<assert.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define IOS cin.tie(0); ios::sync_with_stdio(false)
const int INF = 1e9;
using namespace std;

signed main() {
    int N; cin >> N; int A[N];
    rep(i,N) cin >> A[i];
    int sum=0;
    for(int i=0;i<N-1;i++){
        for(int j=i+1;j<N;j++){
            sum+=A[i]*A[j];
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
import numpy as np
K,N=map(int, input().split())  
A=np.array(input().split(),np.int64)
A_diff = np.diff(A, n=1)
A_diff = np.insert(A_diff, 0, A[0]+(K-A[-1]))
#print(A_diff)
ans = np.sum(A_diff)-np.max(A_diff)
print(ans)

Measured memory_bytes: 40860
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

int main()
{
	
	int a, b,c;
	cin >> a >> b >> c;
	if ((a + b) >= c) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
import java.io.PrintWriter
import kotlin.math.pow

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any = "") = pw.print(s)
fun println(s: Any = "") = pw.println(s)

fun <T> Iterable<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun <T> Array<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun Int.pow(n: Int) = pow(n.toLong())
fun Int.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()
fun Long.pow(n: Int) = pow(n.toLong())
fun Long.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val (s1, s2, s3) = nextList()
    println("${s1[0].toUpperCase()}${s2[0].toUpperCase()}${s3[0].toUpperCase()}")
}

Measured memory_bytes: 35836
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <math.h>
#include <utility>
#include <vector>
#include <map>
#include <cstdlib>
#define div1 1000000007
const long long INF = 1LL << 60;
using namespace std;
// a>b -> a==b;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
// a<b -> a==b;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(void)
{
    long long N, M, K, i, j, judge=0;

    cin >> N >> M >> K;

    if(K%N==0) judge = 1;
    if(K%M==0) judge = 1;

    if(N>=2 && M>=2){
        for(i=1; i<=N-1; i++){
            for(j=1; j<=M-1; j++){
                if(i*j + (N-i)*(M-j) == K) judge = 1;
            }
        }
    }

    if(judge==1) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<string>> vvs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define vrep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, l, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
#define sort(v) sort(v.begin(), v.end())
#define sortr(v) sort(v.rbegin(), v.rend())
void chmin(int &a, int b) {if(a > b) a = b;}
void chmax(int &a, int b) {if(a < b) a = b;}

const int mod = 1000000007;
const int inf = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};


int main(){
    int n;
    cin >> n;
    vector<int> p(n), q(n);
    rep(i,n) cin >> p[i];
    rep(i,n) cin >> q[i];
    vector<int> a(n), d(n);
    rep(i,n) a[i] = i + 1;
    rep(i,n) d[i] = i + 1;
    int c, b, cnt = 0;
    do{
        cnt++;
        bool flag = true;
        rep(i,n){
            if(a[i] != p[i]){
                flag = false;
                break;
            }
        }
        if(flag){
            c = cnt;
            break;
        }
    }while(next_permutation(a.begin(), a.end()));
    cnt = 0;
    do{
        cnt++;
        bool flag = true;
        rep(i,n){
            if(d[i] != q[i]){
                flag = false;
                break;
            }
        }
        if(flag) {
            b = cnt;
            break;
        }
    }while(next_permutation(d.begin(), d.end()));
    cout << abs(b-c) << endl;
}

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

int main(){
    int n, m;
    cin >> n >> m;
    vector<int> h(n);
    for(int i = 0; i < n; i++)  cin >> h[i];
    vector<int> v[n];
    while(m--){
        int a, b;
        cin >> a >> b;
        a--, b--;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    int ret = 0;
    for(int i = 0; i < n; i++){
        bool val = true;
        for(int j : v[i])   val &= h[i] > h[j];
        if(val) ret++;
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 8724
#include<stdio.h>

int main()
{
    int arr[]= {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;

    scanf("%d",&k);

    printf("%d\n", arr[k-1]);

}


Measured memory_bytes: 128
//        ★★ ASHWINI SHARMA ★★ 
#include <bits/stdc++.h>
using namespace std;
 
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr(i,a,b) for (int i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (int i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (int i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (long long i = (n) - 1; i >= 0; i--)
#define foreach(it,ar) for ( typeof(ar.begin()) it = ar.begin(); it != ar.end(); it++ )
#define debug(x) cout<<#x<<": "<<x<<endl
#define ull unsigned long long int
#define ll long long int
#define ld double
#define ui unsigned int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second 
 
 
#define PI 3.1415926535897932385
#define INF 1e18
#define EPS 1e-7
#define MAXN 1000005
#define MOD 1000000007
                                  //          ★★ ASHWINI SHARMA ★★      
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
ll exp(ll x, ll y, ll p)
{
    ll res = 1;   
    x = x % p;  
    while (y > 0)
    {
        if (y & 1)    
            res = (res*x) % p;
        y = y>>1;     
        x = (x*x) % p; 
    }
    return res;
}

 
 
int main() {
    #ifdef sharma
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);      
    #endif
    fastio;
    ll r;
    cin >> r;
    cout << 3*r*r;
    return 0; 
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        
        int K = sc.nextInt();
        int S = sc.nextInt(); 
        int count = 0;
        
        for(int X = 0; X <= K; X++){
            for(int Y = 0; Y <= K; Y++){
                int Z = S - X - Y;
                if(Z >= 0 && Z <= K) count++;
            }
        }
        System.out.println(count);
    }
}


Measured memory_bytes: 22996
#include<bits/stdc++.h>
using namespace std;
set<int> s;
int n,x;
int main() {
	cin>>n;
	while(n--) {
		cin>>x;
		if(s.count(x))
			s.erase(x);
		else
			s.insert(x);
	}
	cout<<s.size()<<endl;
	return 0;
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)

template <class T = int>T in(){
    T x;
    cin >> x;
    return (x);
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H = in(),W = in();
    vector<string> A(H);
    REP(i,H)A[i] = in<string>();
    int place = 0;
    bool over = 0;
    REP(i,H){
        while(1){
            if(A[i][place] == '#'){
                A[i][place] = '.';
            }else{
                over = 1;
            }
            if(i == H-1 && place == W-1)break;
            if(place >= W-1)break;
            if(place + 1 < W){
                if(A[i][place+1] == '.'){
                    break;
                }else{
                    place++;
                }
            }
            if(over)break;
        }
        if(over)break;
    }
    REP(i,H){
        REP(l,W){
            if(A[i][l] == '#')over = 1;
        }
    }
    cout<<fixed<<setprecision(10);
    cout << (over ? "Impossible" : "Possible") << "\n";
}

Measured memory_bytes: 256
extern crate core;

use std::io::{self, Read};

fn main() {
    let mut input = String::new();
    io::stdin().read_to_string(&mut input).unwrap();
    let output = run(input.trim().to_string());
    println!("{}", output);
}

fn run(input: String) -> String {
    let n = input.parse::<i32>().unwrap();
    (n / 3).to_string()
}

#[test]
fn test() {
    let tests = vec![("8", "2"), ("2", "0"), ("9", "3")];
    for (i, (input, output)) in tests.into_iter().enumerate() {
        println!("test:{}", i);
        assert_eq!(run(input.to_string()), output.to_string());
    }
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		new Main();
	}

	public Main() {
		Scanner in = new Scanner(System.in);

		while(true) {
			int n = in.nextInt();
			if(n==0) break;
			int a = 0;
			int b = 0;
			for(int i=0; i<n; i++) {
				int ac = in.nextInt();
				int bc = in.nextInt();
				if(ac > bc) a += ac + bc;
				if(ac == bc){ a += ac; b += bc; }
				if(ac < bc) b += ac + bc;
			}

			System.out.printf("%d %d\n", a, b);
		}
	}
}

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

int main()
{
    int n,k;
    cin >> n >> k;
    long long int fans = 0;
    for(int i = 1; i <= n; i++) //b
    {
        int cur = i;
        int times = n / i;
        int left = n % i;
        int get = max(0,i - k);
        fans += get * 1ll * times;
        if(!k)
        fans--;
        fans += max(0,left - k + 1);
    }
    printf("%lld\n",fans);
    return 0;
}


Measured memory_bytes: 256
using System;

public class Hello
{
    public static void Main()
    {
        var s = Console.ReadLine().Trim();
        var cp = s.IndexOf('C');
        var fp = s.LastIndexOf('F');
        if (cp < 0 | fp < 0) Console.WriteLine("No");
        else Console.WriteLine(cp < fp ? "Yes" : "No");
    }
}


Measured memory_bytes: 11092
// https://atcoder.jp/contests/

#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for (int(i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for (int(i) = (m); (i) < (n); i++)
#define FORR(i, m, n) for (int(i) = (n); (i) >= (m); i--)
#define rep(...) _overload3(__VA_ARGS__, FOR, REP, )(__VA_ARGS__)
#define repr(...) _overload3(__VA_ARGS__, FORR, REPR, )(__VA_ARGS__)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;

int main()
{
  ll W, H, x, y;
  cin >> W >> H >> x >> y;

  double S = (double)W * H / 2;
  ll center = W == x * 2 && H == y * 2 ? 1 : 0;

  cout << fixed << setprecision(9) << S << ' ' << center << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a)
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
using namespace __gnu_pbds;

const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod;

inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}

const int maxn=100005;
//i_am_noob
int n,a[maxn],ans=4e18;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
    cin >> n;
    rep(n) cin >> a[i];
    sort(a,a+n);
    rep(n-1) if(min(a[i],a[n-1]-a[i])>min(ans,a[n-1]-ans)) ans=a[i];
    print2(a[n-1],ans);
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
	int n,i,f,g=1;
	long long a[100000];
	scanf("%lld",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lld",&a[i]);
	}
	if(a[1]>a[0])f=1;
	if(a[1]<a[0])f=-1;
	if(a[1]==a[0])f=0;
	for(i=2;i<n;i++)
	{
		if(f==0&&a[i]>a[i-1]){f=1;}
		if(f==0&&a[i]<a[i-1]){f=-1;}
		if(f==1&&a[i]<a[i-1]){g++;f=0;}
		if(f==-1&&a[i]>a[i-1]){g++;f=0;}
	}
	printf("%d\n",g);
	return 0;
}


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

int main(){
  int X,Y,Z;
  cin >> X >> Y >> Z;
  int swap;
  swap = X;
  X = Y;
  Y = swap;
  
  swap = X;
  X = Z;
  Z = swap;
  
  cout << X << " " << Y << " " << Z << endl;
}

Measured memory_bytes: 256
// D - Patisserie ABC
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int main(){
	int N,M; cin>>N>>M;
	vector<ll> X(N),Y(N),Z(N), S(N);
	rp(i, 0, N) cin>>X[i]>>Y[i]>>Z[i];
	ll ans = 0;
	rp(bits, 0, 8){
		priority_queue<ll> pq;
		rp(i, 0, N) pq.push(X[i]*(bits&1?1:-1) + Y[i]*(bits&2?1:-1) + Z[i]*(bits&4?1:-1));
		ll s = 0; rp(i, 0, M){ s += pq.top(); pq.pop(); }
		ans = max(ans, s);
	}
	cout<< ans <<endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;


public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (n * a > b) {
            System.out.println(b);
        } else {
            System.out.println(n * a);
        }
    }


    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }


        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


Measured memory_bytes: 22100
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0;i < n;i++)
#define rev(i, n) for(int i = n;i >= 0;i--)
#define Rep(i, m, n) for(int i = m;i < n;i++)
#define repeatrev(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define itn int
const int MAX = 510000;


using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
typedef priority_queue<int> Pr;

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    ll a[n];
    ll sum = 0;
    ll sum_1 = 0;
    rep(i, n){
        cin >> a[i];
        sum += a[i];
        if(i % 2 != 0)sum_1 += a[i];
    }
    sum /= 2;
    cout << 2 * (sum - sum_1) << " ";
    ll x_1 = sum - sum_1;
    rep(i, n - 1){
        cout << 2 * (a[i] - x_1) << " ";
        x_1 = a[i] - x_1;
    }
}

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

int main() {
 string S;
	cin >> S;
	char a = S.at(2);
	char b = S.at(3);
	char c = S.at(4);
	char d = S.at(5);
	if (a == b && c == d) {
      cout << "Yes" << endl;}
	else {
      cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
using ll = long long;
using ull = unsigned long long;

string ss = "CODEFESTIVAL2016";

int main() {
    FAST;

    string s;
    cin >> s;

    int ans = 0;
    rep(i, size(s)){
        if(s[i] != ss[i]){
            ans++;
        }
    }

    println(ans);
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
  #include <set>
  #include <array>
  #include <map>
  #include <unordered_map>
  #include <unordered_set>
  #include <stack>
  #include <queue>
  #include <vector>
  #include <tuple>
  #include <string>
  #include <math.h>
  #include <time.h>
  #include <bitset>
  #include <stdio.h>
  #include <string.h>
  #include <iostream>
  #include <algorithm>
  #include <limits>
  #include <climits>
  #include <numeric>
  #include <functional>
  #include <iomanip>
  #include <cmath>

  #define lnd '\n'
  // #define reverse(i, n) for(ll i = n-1; i >= 0; --i)
  #define from(i, n) for (ll i = 0; i < n; ++i)
  #define loop(i, n) for(ll i = 0; i < n; i++)
  #define REPN(i, n) for (ll i = 1; i <= n; ++i)
  #define ALL(s) (s).begin(), (s).end()
  #define rALL(s) (s).rbegin(), (s).rend()
  #define sz(s) (int)(s).size()
  #define mk make_pair
  #define pb push_back
  #define sqr(s) ((s) * (s))

  using namespace std;

  typedef long long ll;
  typedef long long int lli;
  typedef long double ld;
  typedef unsigned long long ull;
  typedef unsigned int ui;

  template <class T>
  T GCD (T a, T b) {
    if(a == 0) return b;
    return GCD(b%a, a);
  }

  template <class T>
  T LCM(T a, T b){
    return a*b/GCM(a,b);
  }

  template <class T>
  T modpow(T x, T p){
      T res = 1;
      while(p > 0){
          if(p&1) res *= x;
          x *= x;
          p /= 2;
      }
      return res;
  }

  template <class T>
  T modpow(T x, T p, ll mod){
      T res = 1;
      while(p > 0){
          if(p&1) res = (res*x)%mod;
          x = (x*x)%mod;
          p /= 2;
      }
      return res%mod;
  }

  template <class T>
  void print(T a[], ll n){
      for (ll i = 0; i < n; i++) std::cout << a[i] << ' ';
      cout << endl;
  }

  template<class T>
  void printc(T c){
      for(auto const& v: c) std::cout << v << ' ';
      cout << endl;
  }

  struct HASH{
    size_t operator()(const pair<long,long>&x)const{
      return hash<long long>()(((long long)x.first)^(((long long)x.second)<<32));
    }
  };

  bool pair_sort(const pair<int, int> &p1, const pair<int,int> &p2){
      if(p1.first != p2.first) return p1.first < p2.first;
      else return p1.second < p2.second;
  }

  const int INF = std::numeric_limits<int>::max();
  const ll M_INF = std::numeric_limits<ll>::min();
  const ll LL_INF = std::numeric_limits<ll>::max();

  void solution();
  int main(){
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);
      solution();
      return 0;
  }

  void solution(){
    ll a, b, v, w, t;
    cin >> a >> v >> b >> w >> t;

    ld d = abs(a-b);
    if(v < w || (v == w && d > 0)){
      cout << "NO" << endl;
    }else{
      ld dist = (1.0*d*v)/(1.0*(v-w));
      ld t1 = dist/(1.0*v);
      if(t1 <= t){
        cout << "YES" << endl;
      }else{
        cout << "NO" << endl;
      }
    }
  }    
    

Measured memory_bytes: 3040
N, K = map(int, input().split())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7

fac=[]
finv=[]
inv=[]
def combi_init():
    fac.append(1)
    fac.append(1)
    finv.append(1)
    finv.append(1)
    inv.append(1)
    inv.append(1)

    for i in range(2,N+1):
        fac.append(fac[i-1]*i%mod)
        inv.append(mod-mod//i*inv[mod%i]%mod)
        finv.append(finv[i-1]*inv[i]%mod)

def combi_mod(n,k):

    ret=fac[n]*finv[n-k]*finv[k]%mod
    return ret

A.sort()

ans=0
combi_init()
for i in range(N-1,K-2,-1):
    ans+=(A[i]-A[(N-1)-i])*combi_mod(i,K-1)


ans%=mod

print(ans)


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

int main(){
    string s;
    cin >> s;
    bool ok=true;
    map<char,int> Map;
    for(int i=0;i<s.size();i++){
        Map[s[i]]++;
    }
    for(int i=0;i<26;i++){
        if(Map['a'+i]%2==0){}
        else{ok=false;}
    }
    if(ok)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repv(i,a,b) for(ll i=b-1;i>=a;i--)
#define MAXN 300005
#define endl "\n"

ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;}

int dp[3005][3005];
string s,t;
char s1[3005],t1[3005];

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>s>>t;
    // string q=t;
    // if(s.size()<t.size())
    for(int i=0;i<s.size();i++) s1[i+1]=s[i];
    for(int i=0;i<t.size();i++) t1[i+1]=t[i];
    for(int i=1;i<=s.size();i++)
    {
        for(int j=1;j<=t.size();j++)
        {
            if(s1[i]==t1[j])
                dp[i][j]=dp[i-1][j-1]+1;
            else 
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
        }
    }
    int i=s.size(),j=t.size();
    string p="";
    while(i>0 && j>0)
    {
        if(s1[i]==t1[j])
        {
            p=s1[i]+p;
            i--;j--;
        }
        else
        {
            if(dp[i-1][j]>dp[i][j-1]) i--;
            else j--;
        }
    }
    cout<<p<<endl;
}

Measured memory_bytes: 35456
#include<stdio.h>
#include<math.h>
int main()
{
    float a,b,c;
    int n,x[100],i,j,s=0,m,p=0,q=0,temp;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&x[i]);
      b=(float)x[i];
      s=s+x[i];
      //c=(float)s;
    }
    c=(float)s;
    b=c/n;
    m=round(b);
    for(i=0;i<n;i++)
    {
        p=(x[i]-m);
        p=p*p;
        q=p+q;
    }
    printf("%d\n",q);
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int point(char c, char d) { // 自分 相手
    if(c == 'r' && d == 's') return 1;
    if(c == 's' && d == 'p') return 1;
    if(c == 'p' && d == 'r') return 1;
    return 0;
}
int main()
{
    int n, k, r, s, p, ans = 0;
    string t;
    cin >> n >> k >> r >> s >> p >> t;
    vector<vector<int>> score(n, vector<int> (3, 0));
    // 0 -> r を出した時(s に勝てる、p に負ける)
    // 1 -> s を出した時(p に勝てる、r に負ける)
    // 2 -> p を出した時(r に勝てる、s に負ける)
    for(int i = 0; i < n; i++){
        // r を出した時
        score[i][0] = point('r', t[i]) * r;
        if(i >= k) score[i][0] += max(score[i-k][1], score[i-k][2]);
        // s を出した時
        score[i][1] = point('s', t[i]) * s;
        if(i >= k) score[i][1] += max(score[i-k][0], score[i-k][2]);
        // p を出した時
        score[i][2] = point('p', t[i]) * p;
        if(i >= k) score[i][2] += max(score[i-k][0], score[i-k][1]);
    }
    for(int i = n-1; i > n-1 - k && i >= 0; i--) {
        ans += max({score[i][0], score[i][1], score[i][2]});
    }
    cout << ans << endl;
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
int INF = 1000000007;
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 main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;
  int A[N], B[N], C[N];
  for(int i=0;i<N;i++){
    cin >> A[i] >> B[i] >> C[i];
  }
  int dp[N+1][3] = {};
  for(int i=1;i<=N;i++){
    dp[i][0] = max(dp[i-1][1] + A[i-1], dp[i-1][2] + A[i-1]);
    dp[i][1] = max(dp[i-1][0] + B[i-1], dp[i-1][2] + B[i-1]);
    dp[i][2] = max(dp[i-1][0] + C[i-1], dp[i-1][1] + C[i-1]);
  }
  cout << max({dp[N][0], dp[N][1], dp[N][2]}) << endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause") //comment out this on AOJ.
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10; //1e-9?
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int n; cin >> n;
    VI a;
    FOR(i, 0, n) {
        int x; cin >> x;
        --x;
        if (!a.empty() && a.back() == x)continue;
        a.push_back(x);
    }
    n = a.size();

    VL c(200000), dp(n + 1);
    dp[0] = 1;
    FOR(i, 0, n) {
        (dp[i + 1] += dp[i]) %= mod;
        (dp[i + 1] += c[a[i]]) %= mod;
        (c[a[i]] += dp[i]) %= mod;
    }
    cout << dp[n] << "\n";
}

Measured memory_bytes: 4340