akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>

int main() {
    int x, y, r, tmp;
    scanf("%d %d", &x, &y);

    if (x < y) {
        tmp = x;
        x = y;
        y = tmp;
    }

    r = x % y;
    while(r != 0) {
        x = y;
        y = r;
        r = x % y;
    }

    printf("%d\n", y);
    return 0;
}


Measured memory_bytes: 2736
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const ll mod=1e9+7;


int main(){
  ll n;
  cin >> n;
  ll a[5];
  ll b[5];
  rep(i,5){
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b,b+5);
  ll memo;
  rep(i,5){
    if(a[i] == b[0]){
      memo = i;
      break;
    }
  }
  ll cnt = memo;
  cnt += (n+a[memo]-1)/a[memo];
  cnt += 4 - memo;
  printf("%lld\n", cnt);
  return 0;
}


Measured memory_bytes: 256
//header{{{
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
//#include<boost/math/common_factor_rt.hpp>
//#include<boost/multiprecision/cpp_dec_float.hpp>
  
using namespace std;
//using namespace boost;
//using namespace multiprecision;  

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define Fixed fixed << setprecision(12)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9+7; 
constexpr int mod2 = 998244353;

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A, class B> using umap = unordered_map<A,B>;
  
inline int square(int a){ return a * a;}
inline int updiv(int a,int b){ return (a + b - 1) / b; }

template <class A, class B> inline int Max(const A &a, const B &b){ return (a < b ? b : a); }
template <class A, class B> inline int Min(const A &a, const B &b){ return (a > b ? b : a); }

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


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

    string s;
    cin >> s;

    cout << s.substr(0, 3) << '\n';

    return (0);
}


Measured memory_bytes: 3652
import java.io.*;
import java.util.*;

public class Main {
  private static void execute(ContestReader reader, PrintWriter out) {
    int a = reader.nextInt();
    int b = reader.nextInt();
    int c = reader.nextInt();
    out.println(a ^ b ^ c);
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}


Measured memory_bytes: 21204
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    long double ans=0;
    long double x;
    string S;
    for(int i=0;i<n;i++){
        cin >> x >> S;
        if(S=="JPY")ans+=x;
        else ans += 380000.0*x;
    }
    cout << fixed << setprecision(16);
    cout << ans << endl;
}

Measured memory_bytes: 256
// 解き直し.
// https://img.atcoder.jp/agc015/editorial.pdf
// C++(GCC 9.2.1)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
const int MAX = 61;

int main(){
    
    // 1. 入力情報.
    LL A, B;
    scanf("%lld %lld", &A, &B);
    if(A > B) swap(A, B);
    
    // 2. A = B の 場合.
    if(A == B){
        puts("1");
        return 0;
    }
    
    // 3. 二進数用意(61乗未満).
    vector<LL> vPow2(MAX);
    vPow2[0] = 1LL;
    repx(i, 1, MAX) vPow2[i] = vPow2[i - 1] << 1;
    // rep(i, MAX) printf("%lld\n", vPow2[i]);
    
    // 4. 二進数変換(61桁).
    string binA, binB;
    rep(i, MAX){
        if(1 & (A >> i)) binA = "1" + binA;
        else             binA = "0" + binA;
        if(1 & (B >> i)) binB = "1" + binB;
        else             binB = "0" + binB;
    }
    // printf("A=%s\n", binA.c_str());
    // printf("B=%s\n", binB.c_str());
    
    // 5. 操作 BITWISE OR を取って出来る整数をカウント.
    // 5-1. 二進数 A, B が, 最初に異なる桁.
    int r = -1;
    rep(i, MAX){
        if(binA[i] != binB[i]){
            r = MAX - i;
            break;
        }
    }
    assert(r != -1);
    // printf("r=%d\n", r);
    
    // 5-2. r桁より大きい部分(A, B の 共通部分)を計算し, A を 更新.
    LL extra = 0;
    rep(i, MAX - r) if(binA[i] == '1') extra += vPow2[MAX - 1 - i];
    A -= extra;
    
    // 6. 各パターンを集計.
    // 6-1. A ～ 2 の (r - 1)乗未満 の 整数 を カウント(パターン①).
    LL ans = vPow2[r - 1] - A;
    if(r == 1 && A == 0) ans = 0; // 12.txt, 24.txt で, WA版 だったため, ロジック変更.
    
    // 6-2. 最上位が 1 の 整数のみ使う場合(パターン②).
    int k = -1;
    repx(i, MAX - r + 1, MAX){
        if(binB[i] == '1'){
            k = MAX - i;
            break;
        }
    }
    // printf("k=%d\n", k);
    // 15.txt, 16.txt, 18.txt, 53.txt で WA版だったため, maxP2 = -1 から maxP2 = 0 に 変更.
    // -> B が 1000 の ような形で, k = -1 となったパターンについて考慮が必要とのこと.
    LL minP2 = -1, maxP2 = 0;
    if(k != -1){
        minP2 = vPow2[r - 1];
        maxP2 = vPow2[r - 1] + vPow2[k];
    }
    
    // 6-3. 最上位が 0, 1 の 整数を使う場合(パターン③).
    LL minP3 = vPow2[r - 1] + A;
    LL maxP3 = vPow2[r];
    
    // 6-4. パターン②, ③ を 統合.
    if(maxP2 && maxP2 >= minP3) ans += maxP3 - minP2;
    else                        ans += maxP2 - minP2, ans += maxP3 - minP3;
    
    // 7. 出力.
    printf("%lld\n", ans);
    return 0;
    
}

Measured memory_bytes: 3792
n = int(input())
sp = [[i for i in input().split()] for i in range(n)]

dic = {}
for x,p in sp:
    if x in dic:
        dic[x].append(int(p))
    else:
        dic[x] = [int(p)]

res_l = []
for x,p in sp:
    res = 0
    flg = False
    for k in sorted(dic):
        if x != k:
            res+=len(dic[k])
        else:
            l = sorted(dic[k], reverse=True)
            #print(l)
            for i in l:
                res += 1
                if int(i) == int(p):
                    flg == True
                    res_l.append(res)
                    break

        if flg:
            break

xx = [0]*n
for i,x in enumerate(res_l):
    xx[x-1] = i+1

for x in xx:
    print(x)

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

bool cmp(int x1,int x2){
	return x1>x2;
}

int a[100005],b[100005];

int main(){
	int n,h,ans=0;
	cin >> n >> h;
	for(int i=0;i<n;i++){
		cin >> a[i] >> b[i];
	}
	sort(a,a+n,cmp);
	sort(b,b+n,cmp);
	int l=0,r=0;
	while(h>0){
		if(b[r]>a[l]){
			h -= b[r];
			ans++;
			r++;
		}
		else if(a[l]>=b[r]){
			if(h%a[l]==0){
				ans += h/a[l];
				break;
			}
			else{
				ans += h/a[l];
				ans++;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;

#define INF 1e9
#define MOD 1000000007
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (a); i > (b); i--)
#define each(x, v) for (auto& x: (v))
#define all(x) (x).begin(), (x).end()
#define print(x) cout << (x) << endl

void solve();
void in(){} template<class T, class... U> void in(T &t, U &...u){ cin >> t; in(u...); }
int main() { cin.tie(0); ios::sync_with_stdio(0); solve(); }

void solve() {
  ll L, R;
  in(L, R);
  int ans = 2019;
  for (ll i = L; i <= min(R, L + 2019); ++i) {
    for (ll j = i + 1; j <= min(R, L + 2019); ++j) {
      ans = min(ans, (int)((i % 2019) * (j % 2019) % 2019));
    }
  }
  print(ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <climits>
#include <map>
using namespace std;


int main() {
  int A, B;
  cin >> A >> B;
  
  int ans = 0;
  if(A >= 13) {
    ans = B;
  } else if (A >= 6) {
    ans = B/2;
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        while (true)
        {
            string input = Console.ReadLine();
            if (input == "0")
            {
                break;
            }
            int[] e = input.ToCharArray().Select(x => int.Parse(x.ToString())).ToArray();
            int a = 0;
            for (int i = 0; i < e.Length; i++)
            {
                a += e[i];
            }
            Console.WriteLine(a);
        }
    }
}



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

#pragma warning(disable : 4996)

typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endl
#endif

using namespace std;
//#define int long long;

double dist(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
ll idist(ll x1, ll y1, ll x2, ll y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
using namespace std;

signed main() {
  ll N;
  cin >> N;
  ll tmp;
  ll old = 0;
  ll c = 0;
  rep(i, N) {
    cin >> tmp;
    if (tmp > old) {
      old = tmp;
    } else {
      c += old-tmp;
    }
    //cout << old << endl;
  }
  cout << c;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define ll long long
#define INF INT_MAX 
#define mod 1000000007
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> primes;
    vector<bool> isPrime(100000,true);
    isPrime[0] = false; isPrime[1] = false;
    for(int p=2;p*p <= 100000;p++){
        if(isPrime[p]) for(int i=p*2 ;i<=100000;i+=p) isPrime[i] = false;
    }
    for(int p=2;p<=100000;p++) if(isPrime[p]) primes.push_back(p);
    
    vector<int> ans;
    for(int i=0;i<primes.size();i++){
        if(primes[i]%5==1){
            ans.push_back(primes[i]);
            N--;
            if(N==0)break;
        }   
    }
    for(int i=0;i<ans.size();i++){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 384
/*
 *
 * Author: r3gz3n
 * 3b 13 12 9 56 4e
 * 6 56 a a 5f f
 * 6 56 47 18 56 d
 * 13 46 14 1f 13 27
 * 52 52 a 5a 47 1
 * 1d 13 b 1b 49 17
 *
 */


#include <utility>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <random>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;


#define rep(i, a, b, k) for(__typeof(a) i = a;i < b;i += k)


class Solution {
public:
	const int static MAX = 1e5 + 5;
	int A[MAX] = {0};
    void solve(std::istream& in, std::ostream& out) {
		int n, x = 0, d = 0, a;
		in >> n;
		rep(i, 0, n, 1) {
			in >> a;
			A[a]++;
		}
		rep(i, 0, MAX, 1) {
			if (A[i] == 0) continue;
			A[i] %= 2;
			if (A[i] == 0) A[i] = 2, x++;
			d++;
		}
		if (x % 2) d--;
		out << d << endl;
    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}


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


    istream& in = cin;


    ostream& out = cout;

    solve(in, out);
    return 0;
}




Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
typedef struct rest {
    int id;
    string name;
    int rating;
} rest;
 
bool comp(rest r1, rest r2) {
    if(r1.name == r2.name) return r1.rating > r2.rating;
    return r1.name < r2.name;
}
 
int main() {
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif
 
    int n;
    cin>>n;
    rest a[n];
    for(int i = 0;i < n;i++) {
        string name;
        int rating;
        cin>>name>>rating;
        a[i] = {i+1, name, rating};
    }
 
    sort(a,a+n, comp);
 
    for(int i = 0;i < n;i++) cout<<a[i].id<<endl;
    
}


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

#define INF 1000000007
#define LINF 1000000000000000007

using namespace std;

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

Int gcd(Int x, Int y){
	if(y == 0)
		return x;
	return gcd(y, x % y);
}

Int lcm(Int x, Int y){
	return x * y / gcd(x, y);
}

bool sosuu(int x){
	bool b = 1;
	if(x == 1) b = 0;
	for(int i = 2; i * i <= x; i++){
		if(x % i == 0) {
			b = 0;
			break;
		}
	}
	return b;
}

Int n;

int main(){
	cin >> n;
	bool b = 0;
	for(int i = 0; i < n; i++){
		char c;
		cin >> c;
		if(c == 'Y') b = 1;
	}
	
	if(b) cout << "Four" << endl;
	else cout << "Three" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

int main()
{
   int n[100];
   static int e[100][10][10];
   int i,j,k;
   int cnt=1;
   static char m1,m2,m3;
   int m4;
   for(k=0;;k++) {
      scanf("%d",&n[k]);
      if(n[k]==0) {
         m4 = k;
         break;
      }
      cnt=1;
      i=0;j=0;
      m1=1;
      e[k][0][0] = 1;
      for(;;) {
         if(m1) {
            e[k][i][++j] = ++cnt;
            for(;j>0;)
               e[k][++i][--j] = ++cnt;
            m1=0;
            if(i+2>n[k])
               break;
         }
         else {
            e[k][++i][j] = ++cnt;        
            for(;i>0;)
               e[k][--i][++j] = ++cnt;
            m1=1;
            if(j+2>n[k])
               break;
         }
      }

      for(;;) {
         if(m1) {
            e[k][++i][j] = ++cnt;
            for(;i<n[k]-1;)
               e[k][++i][--j] = ++cnt;
            if(j+2>n[k])
               break;
            m1=0;
         }
         else {
            e[k][i][++j] = ++cnt;        
            for(;j<n[k]-1;)
               e[k][--i][++j] = ++cnt;
            if(i+2>n[k])
               break;
            m1=1;
         }
      }
   }
   for(k=0;k<m4;k++) {
      printf("Case %d:\n",k+1);
      for(i=0;i<n[k];i++) {
         for(j=0;j<n[k];j++) 
            printf("%3d",e[k][i][j]);
         printf("\n");
      }
   }
   return 0;
}

Measured memory_bytes: 1204
while True:
    a,op,b = input().split()
    
    if op =="?":
        break
    
    a = int(a)
    b=  int(b)

    if op == "+":
        print("%d"%(a+b))
    elif op == "-":
        print("%d"%(a-b))
    elif op == "*":
        print("%d"%(a*b))
    elif op == "/":
        print("%d"%(a/b))



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

int main() {
  string s;
  cin >> s;
  int a[26] = {};
  for(int i = 0;i < s.size();i++){
    a[s[i] - 'a']++;
  }

  bool flag = true;
  for(int i = 0;i < 26;i++){
    if(a[i] == 0){
      cout << (char)(i + 'a') << endl;
      flag = false;
      break;
    }
  }
  if(flag){
    cout << "None" << endl;
  }
}


Measured memory_bytes: 512
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>
#include <cstdint>
#include <tuple>
#include <regex>
#include <numeric>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define MOD 998244353
#define SQ(x) ((x)*(x))

const int N = 200005;
char str[N];
int cnt[N][2];
bool dead[N];

int main() {
	int n, m;
	cin >> n >> m >> str;
	VVI g(n);
	REP(i, m) {
		int x, y;
		scanf("%d%d", &x, &y);
		x--, y--;
		g[x].PB(y);
		g[y].PB(x);
		cnt[y][str[x] - 'A']++;
		cnt[x][str[y] - 'A']++;
	}
	queue<int> q;
	REP(i, n) if (cnt[i][0] == 0 || cnt[i][1] == 0)q.push(i);
	int live = n;
	while (!q.empty()) {
		auto tmp = q.front();
		q.pop();
		if (dead[tmp])continue;
		for (auto to : g[tmp]) {
			if (dead[to])continue;
			cnt[to][str[tmp] - 'A']--;
			if (cnt[to][0] == 0 || cnt[to][1] == 0)q.push(to);
		}
		dead[tmp] = true;
		live--;
	}
	if (live)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 12416
#include<stdio.h>

int main()
{
  int w,h,x,y,r;
  scanf("%d%d%d%d%d",&w,&h,&x,&y,&r);
  
  if(w >= r && h >= r){
    if(x >= r && x <= (w-r) && y >= r && y <= (h-r)){
      printf("Yes\n");
    }
    else printf("No\n");
  }
  else printf("No\n");
  
  return 0;
}

Measured memory_bytes: 1716
#include <bits/stdc++.h>
using namespace std;
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20);
#define int long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) _overload(__VA_ARGS__, repi, _rep)(__VA_ARGS__)
#define _rev(i, n) revi(i, n, 0)
#define revi(i, a, b) for(int i = (int)(a - 1); i >= (int)(b); i--)
#define rev(...) _overload(__VA_ARGS__, revi, _rev)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
void in(){}
template<typename F, typename... R>
bool in(F& f, R&... r){
    if(cin >> f){in(r...);return true;}
    else return false;
}
#define out(x) cout << (x)
#define space() cout << " "
#define indent() cout << '\n'
void print(){}
template<typename F, typename... R>
void print(F f, R... r){out(f), indent(), print(r...);}
#define debughead(x) cerr << "Line " << __LINE__ << ": " << #x << ": "
#define debugout(x) cerr << (x) << " "
#define debugindent() cerr << '\n'
#define debug(x) debughead(x), debugout(x), debugindent()
const int INF = 1e18, MOD = 1e9 + 7;
template<typename T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<typename T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}

main(){
    INCANT;
    int n, a, res = 0;
    in(n);
    int place[n + 1];
    set<int> s;
    rep(i, 1, n + 1){
        in(a);
        place[a] = i;
    }
    s.insert(0);
    s.insert(n + 1);
    rep(i, 1, n + 1){
        auto iter = s.upper_bound(place[i]);
        res += i * (*iter - place[i]) * (place[i] - *--iter);
        s.insert(place[i]);
    }
    print(res);
}


Measured memory_bytes: 11264
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=(1LL<<60);
const ld pi=acosl((ld)1);
const ll mod = 1000000007;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"


bool check(string s){

  return true;
}
bool solve(){  
  ld l;cin>>l;
  ld ans=powl((l)/3,3);
  cout<<ans<<endl;
  return false;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout<<fixed;
	cout<<setprecision(30);
	return solve();
}


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

#define TASKNAME ""

using namespace std;

const int INF = 1e9 + 7;
const int MAXN = 1e6 + 7;
const double EPS = 1e-8;

int main() {
    #ifdef MY
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen(TASKNAME".in", "r", stdin);
        //freopen(TASKNAME".out", "w", stdout);
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
    #endif // MY
    int n;
    cin >> n;
    string s;
    cin >> s;
    int res = INF;
    int cnt = 0;
    for (int i = 1; i < n; i++) {
        if (s[i] == 'E') {
            cnt++;
        }
    }
    res = min(res, cnt);
    for (int i = 1; i < n; i++) {
        if (s[i - 1] == 'W') {
            cnt++;
        }
        if (s[i] == 'E') {
            cnt--;
        }
        res = min(res, cnt);
    }
    cout << res;
}


Measured memory_bytes: 720
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

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

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int K = scan.nextInt();
        if (10 <= N) {
            System.out.println(K);
        } else {
            System.out.println(K + 100 * (10 - N));
        }

    }
}


Measured memory_bytes: 21844
#include<stdio.h>
int longth[110][110];
int main()
{
    int a,b,c,n,m,cou;
    while(scanf("%d%d",&n,&m),n + m)
    {
        for(int i = 0; i < n + 1; i++)
        {
            for(int j = 0; j < n + 1; j++)
            {
                longth[j][i] = -1;
            }
        }
        for(int i = 0; i < m; i++)
        {
            scanf("%d%d%d",&a,&b,&c);
            if(a == 0)printf("%d\n",longth[b][c]);
            else
            {
                scanf("%d",&a);
                if(longth[b][c] > a || longth[b][c] == -1)
                {
                    longth[b][c] = a;longth[c][b] = a;
                    cou = 1;
                    while(cou != 0)
                    {
                        cou = 0;
                        for(int j = 0; j < n; j++)
                        {
                            if(longth[j][b] != -1)
                            {
                                for(int k = j + 1; k < n + 1; k++)
                                {
                                    if(longth[k][b] != -1 && (longth[j][k] == -1 || longth[j][b] + longth[k][b] < longth[j][k]))
                                    {
                                        longth[j][k] = longth[j][b] + longth[k][b];
                                        longth[k][j] = longth[j][k];
                                        cou = 1;
                                    }
                                }
                            }
                        }
                        for(int j = 0; j < n; j++)
                        {
                            if(longth[j][c] != -1)
                            {
                                for(int k = j + 1; k < n + 1; k++)
                                {
                                    if(longth[k][c] != -1 && (longth[j][k] == -1 || longth[j][c] + longth[k][c] < longth[j][k]))
                                    {
                                        longth[j][k] = longth[j][c] + longth[k][c];
                                        longth[k][j] = longth[j][k];
                                        cou = 1;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    return 0;
}

Measured memory_bytes: 2608
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

#define getcode(i,j) (((i)>>(j))&1)
const int mod=1e9+7;

int n,m,k,must[24][24];

int t1[1<<19],t2[1<<19],nxt[1<<19][19];
int main()
{
	memset(must,-1,sizeof(must));
	get3(n,m,k);n--;
	for(int i=1,a,b,c;i<=k;i++)
	{
		get3(a,b,c);
		must[a][b-1]=c;
	}
	
	for(int i=0;i<(1<<n);i++)for(int j=0;j<n;j++)if(!getcode(i,j))
	{
		nxt[i][j]=(i&((1<<j)-1))^(1<<j);
		bool ok=0;
		for(int k=j+1;k<n;k++)
		{
			if(ok)nxt[i][j]|=(i&(1<<k));
			if(getcode(i,k))ok=1;
		}
	}
	int*dp=t1,*ndp=t2;
	dp[0]=1;
	for(int i=1;i<=m;i++)for(int j=0;j<n;j++)
	{
		for(int k=0;k<(1<<n);k++)ndp[k]=0;
		for(int msk=0;msk<(1<<n);msk++)
		{
			int v=getcode(msk,j);
			if(must[i][j]!=1&&!v)//go left
			{
				ndp[msk]+=dp[msk];
				if(ndp[msk]>=mod)ndp[msk]-=mod;
			}
			if(must[i][j]!=0)//go right
			{
				if(v)
				{
					ndp[msk]+=dp[msk];
					if(ndp[msk]>=mod)ndp[msk]-=mod;
				}
				else
				{
					ndp[nxt[msk][j]]+=dp[msk];
					if(ndp[nxt[msk][j]]>=mod)ndp[nxt[msk][j]]-=mod;
				}
			}
		}
		swap(dp,ndp);
	}
	int ans=0;
	for(int i=0;i<(1<<n);i++)
	{
		ans+=dp[i];
		if(ans>=mod)ans-=mod;
	}
	printendl(ans);
	return 0;
}

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

#define space ' '
#define enter "\n"
#define fi first
#define se second
#define INF 2000000007
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef set <int> si;
typedef map <int, int> mii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <pii> vii;

template <typename T>
T sqr (T x)
{
    return x * x;
}

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

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

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


template <class P, class Q>
ostream & operator << (ostream &os, const pair <P, Q> &p)
{
    return os << '(' << p.fi << ", " << p.se << ')';
}


template <class T>
ostream & operator << (ostream &os, const vector <T> &v)
{
    os << '{';
    bool was = false;
    for (const T & x : v)
    {
        if (was)
            os << ", ";
        was = true;
        os << x;
    }
    os << '}';
    return os;
}

template <class T>
ostream & operator << (ostream &os, const set <T> &v)
{
    os << '[';
    bool was = false;
    for (const T & x : v)
    {
        if (was)
            os << ", ";
        was = true;
        os << x;
    }
    os << ']';
    return os;
}

template <class P, class Q>
ostream & operator << (ostream &os, const map <P, Q> &m)
{
    os << '<';
    bool was = false;
    for (const auto &x : m)
    {
        if (was)
            os << ", ";
        was = true;
        os << x;
    }
    os << '>';
    return os;
}

ll a, b;

int main ()
{
    //freopen("", "r", stdin); freopen("", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin >> a >> b;
    if (a <= 0 && 0 <= b)
    {
        cout << "Zero";
        return 0;
    }
    ll cntp = 0, cntn = 0;
    if (a < 0)
    {
        cntn = abs(a);
        if (b < 0)
            cntn -= abs(b + 1);
        else
            cntp += b;
    }
    if (a > 0)
    {
        cntp = abs(b - a + 1);
    }
    if (cntn % 2 == 0)
    {
        cout << "Positive";
        return 0;
    }
    cout << "Negative";
}


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

typedef long long LL;
typedef long double LD;
typedef string ST;

LL N;
LL X0, X1, X2;
vector<LL> A;
vector<LL> L;
LL mp_min = LLONG_MAX;
LL solve() {
  LL x0 = 0;
  LL x1 = 0;
  LL x2 = 0;

  LL mp = 0;
  for (LL i = 0; i < N; ++i) {
    if (A[i] == 0) {
      if (x0 > 0) {
        mp += 10;
      }
      x0 += L[i];
    }
    else if (A[i] == 1) {
      if (x1 > 0) {
        mp += 10;
      }
      x1 += L[i];
    }
    else if (A[i] == 2) {
      if (x2 > 0) {
        mp += 10;
      }
      x2 += L[i];
    }
  }
  if (x0 == 0 || x1 == 0 || x2 == 0) {
    return LLONG_MAX;
  }
  /*
  cerr << X0 << " " << x0 << endl;;
  cerr << X1 << " " << x1 << endl;;
  cerr << X2 << " " << x2 << endl;;
  cerr << mp <<  endl;;
  */
  mp += abs(X0 - x0);
  mp += abs(X1 - x1);
  mp += abs(X2 - x2);

  return mp;
}

void recusive(LL i) {
  
  if (i >= N) {
    LL mp = solve();
    /*
    if (mp < mp_min) 
    {
      for (auto a : A) {
        cerr << a << " ";
      }
      cerr << mp << endl;
    }
    */
    mp_min = min(mp_min, mp);
    return;
  }
  A[i] = 0;
  recusive(i + 1);
  A[i] = 1;
  recusive(i + 1);
  A[i] = 2;
  recusive(i + 1);
  A[i] = 3;
  recusive(i + 1);

}



void func()
{
  cin >> N >> X0 >> X1 >> X2;

  A.resize(N);
  L.resize(N);
  for (LL i = 0; i < N; ++i) {
    cin >> L[i];
  }
  recusive(0);
  cout << mp_min;
}


#ifdef CALC_TIME 
#include <windows.h>
int main()
{
  LARGE_INTEGER freq;
  QueryPerformanceFrequency(&freq);
  LARGE_INTEGER start, end;
  QueryPerformanceCounter(&start);
  // 何かの処理
  func();
  QueryPerformanceCounter(&end);
  double time = static_cast<double>(end.QuadPart - start.QuadPart) * 1000.0 / freq.QuadPart;
  fprintf(stderr, "%lf[ms]\n", time);
  return 0;
}
#else 
int main()
{
  func();
  return 0;
}
#endif





Measured memory_bytes: 256
#import re
import sys
input = sys.stdin.readline
#import heapq
#import bisect
from collections import deque
#import math

def main():
    n, m = map(int, input().split())
    AL = [[] for i in range(n+1)]
    check = [0 for i in range(n+1)]
    for i in range(m):
        s, e = map(int, input().split())
        AL[s].append(e)
        AL[e].append(s)
    que = deque()
    pb = 1, 1
    que.append(pb)
    ANS = [0 for i in range(n+1)]
    while(que):
        pb = que.popleft()
        p = pb[0]
        b = pb[1]
        if check[p] == 1:
            continue
        elif check[p] == 0:
            ANS[p] = b
            check[p] = 1
            for num in AL[p]:
                que.append((num, p))
    print("Yes")
    for i in range(n+1):
        if i in [0, 1]:
            continue
        else:
            print(ANS[i])

    
if __name__ == '__main__':
    main()


Measured memory_bytes: 53300
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (int i = 0; i < sz(v); i++) {
        os << v[i];
        if (i < sz(v) - 1) os << " ";
    }
    return os;
}
int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    vector<int> cnt(1001001, 0);
    rep(i, n) cin >> a[i], cnt[a[i]]++;
    int ans = 0;
    for (ll x : a) {
        if (cnt[x] >= 2) continue;
        if (x == 1) {
            ans++;
            continue;
        }
        bool ok = 1;
        for (ll d = 1; d * d <= x; d++) {
            if (x % d > 0) continue;
            if (d < x && cnt[d] > 0) ok = 0;
            if (x / d < x && cnt[x / d] > 0) ok = 0;
        }
        if (ok) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 8740
n,l=map(int,input().split())
ans=0
for i in range(1,n+1):
  ans+=l+i-1
if l<0 and 0<l+n-1:
  print(ans)
elif abs(l+n-1)<abs(l):
  print(ans-l-n+1)
else:
  print(ans-l)

Measured memory_bytes: 3060
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

func parseProblem() int {
	n := scanInt(sc)
	as := nextIntSlice(sc, n)
	max := 0
	for i := 0; i < len(as); i++ {
		max += as[i] - 1
	}
	return max
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	a, _ := strconv.Atoi(sc.Text())
	return int(a)
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func nextIntSlice(sc *bufio.Scanner, n int) (a []int) {

	a = make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt(sc)
	}
	return a
}

func resolve(n int) int {
	return n
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF (1LL << 25) // 33554432
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int t[90000];
signed main(void) {
  while (true) {
    int n;
    string s[10010], f[10010];
    cin >> n;
    if (n == 0)
      break;
    REP(i, 86401) t[i] = 0;
    REP(i, n) {
      cin >> s[i] >> f[i];
      int sh = stoi(s[i].substr(0, 2)), sm = stoi(s[i].substr(3, 2)),
          ss = stoi(s[i].substr(6, 2)), fh = stoi(f[i].substr(0, 2)),
          fm = stoi(f[i].substr(3, 2)), fs = stoi(f[i].substr(6, 2));
      t[sh * 60 * 60 + sm * 60 + ss]++;
      t[fh * 60 * 60 + fm * 60 + fs]--;
      // cout << sh*60*60+sm*60+ss << " " << fh*60*60+fm*60+fs << endl;
    }

    FOR(i, 1, 86401) { t[i] += t[i - 1]; }

    int ret = 0;
    REP(i, 86401) { ret = max(ret, t[i]); }
    cout << ret << endl;
  }

  return 0;
}

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

int main() {
	int n,g;
	cin >> n;
	cin >> g;
	for(int i = 1,x; i < n; ++i) {
		cin >> x;
		g = __gcd(x, g);
	}
	cout << g << '\n';
	return 0;
}

Measured memory_bytes: 3592
//#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
//using namespace atcoder;
#define int long long
   template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
    const int MAX =3001;
const int MOD =998244353;


  
signed main(){
  int n,x,m;
  cin>>n>>x>>m;
  int k=1,s[m];fill(s,s+m,MOD*MOD);
  while(s[x]==MOD*MOD){
    s[x]=k;
    k++;
    x=x*x%m;
  }
  int ans=0;
  
  for(int i=0;i<m;i++)if(s[i]<=n)ans+=i*(1+(s[x]<=s[i])*(n-s[i])/(k-s[x]));
cout<<ans<<endl;

}


Measured memory_bytes: 4368
n = int(input())
t = list(map(int,input().split()))
a = list(map(int,input().split()))
ans = 1
mod = 10**9+7
if (not a[0] == t[n-1]):
    print(0)
    exit()

for i in range(1,n-1):
    if ((not t[i] == t[i-1]) and t[i] > a[i]) or ((not a[i] == a[i+1]) and a[i] > t[i]):
        print(0)
        exit()
    elif t[i] == t[i-1] and a[i] == a[i+1]:
        ans = (ans*min(t[i],a[i]))%mod

print(ans)


Measured memory_bytes: 24732
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;


int main()
{
	double L;
	double result;

	cin >> L;

	result = (L/3)*(L/3)*(L/3);

	cout << fixed << setprecision(10) << result;

	return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;

import org.xml.sax.HandlerBase;

public class Main {

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

	public void execute() {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		ArrayList<Integer> sides = new ArrayList<>();
		HashSet<Integer> bar = new HashSet<>();

		for (int i = 0; i < N; i++) {
			int ai = sc.nextInt();
			if (bar.contains(ai)) {
				sides.add(ai);
				bar.remove(ai);
			} else {
				bar.add(ai);
			}
		}

		Collections.sort(sides);

		int sz = sides.size();
		if (sz < 2) {
			System.out.println(0);
		} else {
			System.out.println((long) sides.get(sz - 1) * (long) sides.get(sz - 2));
		}

		sc.close();
	}
}

Measured memory_bytes: 62908
import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      int n = sc.nextInt();
      int k = sc.nextInt();
      long[] h = new long[n];
      for (int i = 0; i < n; i++) h[i] = sc.nextLong();

      Arrays.sort(h);
      long ans = 0;
      for (int i = 0; i < n - k; i++) ans += h[i];
      System.out.println(ans);
    } finally {
      sc.close();
    }
  }
}

Measured memory_bytes: 61384
#! /bin/ruby

n, q  = gets.chomp.split(" ").map(&:to_i)
chars = gets.chomp
t = [0]
(n-1).times do |i|
  if (chars[i] + chars[i+1]) == "AC"
    t[i+1] = t[i] + 1
  else
    t[i+1] = t[i]
  end
end

q.times do |j|
  l, r = gets.chomp.split(" ").map(&:to_i)
  puts t[r-1] - t[l-1]
end


Measured memory_bytes: 3452
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

int c[1000006];
vector<int> V;
set<int> S;
multiset<int> T;

int N, A[200005];

int dp[200005];

int num[1000006];

int main(void) {
	cin >> N;
	int Am = 0;
	for (int i = 1; i <= N; i++) {
		cin >> A[i];
		V.push_back(A[i]);
		S.insert(A[i]);
		T.insert(A[i]);
		Am = max(Am, A[i]);
		num[A[i]]++;
	}

	//sort(V.begin(), V.end());

	

	for(auto y: V){
		if (c[y] >= 1) { c[y] = 2; }
		else if (c[y] >= 0) { c[y]++;
		for (long long int j = y*2; j <= Am; j+=y) {
			c[(int) j] = -1;
		}
		}
	}

	int ans = 0;

	for (int i = 1; i <= N;i++) {
		int u = A[i];
		if (T.count(u) >= 2) {  }
		//else  if (c[u] == 1) { ans++; } 
	}

	
	
	for (int i = 1; i <= N; i++) {
		//if (T.count(A[i]) >= 2) { continue; }
		if (c[A[i]] == 1) { ans++; }
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 30332
import bisect

N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A)
#print(B)
#print(C)

ans = 0

for i in B:
  a_num = bisect.bisect_left(A,i)
  c_num = bisect.bisect(C,i)
  ans += a_num*(N-c_num)


print(ans)

Measured memory_bytes: 29448
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}

template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int a,b,c,d;
	cin >> a>>b>>c>>d;
	int ret=max({a*c,a*d,b*c,b*d});
	print(ret);
}
	

Measured memory_bytes: 3632
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

var digit []int = []int{1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9}

func readFloat() (int, int) {
	s := next()
	if strings.Contains(s, ".") {
		ss := strings.Split(s, ".")
		a, _ := strconv.Atoi(ss[0])
		b, _ := strconv.Atoi(ss[1])
		base := 9 - len(ss[1])
		return a*digit[9-base] + b, base
	} else {
		a, _ := strconv.Atoi(s)
		return a, 9
	}
}

func count2_5(a int) (int, int) {
	c2, c5 := 0, 0
	for a%2 == 0 {
		a /= 2
		c2++
	}
	for a%5 == 0 {
		a /= 5
		c5++
	}
	return c2, c5
}

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

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

const NEED int = 18

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)

	N := nextInt()

	A := make([][]int, NEED+1)
	for k := 0; k < NEED+1; k++ {
		A[k] = make([]int, NEED+1)
	}

	for i := 0; i < N; i++ {
		a, base := readFloat()
		c2, c5 := count2_5(a)
		A[min(NEED, c2+base)][min(NEED, c5+base)]++
		// fmt.Println(min(NEED, c2+base), min(NEED, c5+base))
	}

	total := 0

	// different cell combination
	for i := 0; i <= NEED; i++ {
		for j := 0; j <= NEED; j++ {
			a := A[i][j]
			b := 0
			for x := max(i, NEED-i); x <= NEED; x++ {
				for y := NEED - j; y <= NEED; y++ {
					if x == i && y <= j {
						continue
					}
					b += A[x][y]
				}
			}
			total += a * b
			// if a*b > 0 {
			// 	fmt.Println(i, j, a, b)
			// }
		}
	}

	// same cell combination
	for i := NEED / 2; i <= NEED; i++ {
		for j := NEED / 2; j <= NEED; j++ {
			a := A[i][j]
			total += a * (a - 1) / 2
			// if a > 0 {
			// 	fmt.Println(i, j, a)
			// }
		}
	}

	fmt.Println(total)
}


Measured memory_bytes: 6276