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

using ll = long long;
// #define int long long

#define LOG(variable) cout << #variable":\t" << (variable) << endl
#define LOGCON(i, container) for(int (i) = 0; (i) < (container).size(); ++(i)) cout << (i) << ":\t" << (container)[(i)] << endl
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).rbegin(), e = (obj).rend(); itr != e; ++itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
/***** MAIN *****/
signed main() {
  string s;
  int k;
  cin >> s;
  cin >> k;
  vector<string> v;
  REP(start_i,s.length()) {
    REPS(end_i,start_i,s.length()) {
      int length = end_i-start_i+1;
      if(length > k) continue;
      v.PB(s.substr(start_i, end_i-start_i+1));
    }
  }
  SORT(v);
  v.erase(unique(ALL(v)), v.end());
  cout << v[k-1];
  cout << "\n";
  return 0;
}
/***** MAIN *****/


Measured memory_bytes: 1660
#!/usr/bin/env python
# coding: utf-8

# In[42]:


N = int(input())
a = list(map(int, input().split()))


# In[43]:


count = 0
num = 1
for i in range(N):
    if a[i] == num:
        count += 1
        num += 1
if count == 0:
    print(-1)
else:
    print(N-count)


# In[ ]:






Measured memory_bytes: 32172
#import sys
n = int(input())
a = list(map(int,input().split()))

# 偶数番目を正とする
a_even = a[:]
a_even_sum = 0
curr = 0
for i in range(0,n):
	if i % 2 == 0:
		if a_even_sum + a_even[i] < 0:
			curr += abs(1 - (a_even_sum + a_even[i]))
			a_even[i] = abs(1 - a_even_sum)
		elif a_even_sum + a_even[i] == 0:
			curr += 1
			a_even[i] = 1
	else: # if i % 2 != 0
		if a_even_sum + a_even[i] > 0:
			curr += abs(-1 - (a_even_sum + a_even[i]))
			a_even[i] = -abs(-1 - a_even_sum)
		elif a_even_sum + a_even[i] == 0:
			curr += 1
			a_even[i] = -1
	a_even_sum += a_even[i]

#print(a_even,"curr:", curr, file=sys.stderr)

res = curr
# 奇数番目を正とする
a_odd = a[:]
a_odd_sum = 0
curr = 0
for i in range(0,n):
	if i % 2 == 0:
		if a_odd_sum + a_odd[i] > 0:
			curr += abs(-1 - (a_odd_sum + a_odd[i]))
			a_odd[i] = -abs(-1 - a_odd_sum)
		elif a_odd_sum + a_odd[i] == 0:
			curr += 1
			a_odd[i] = -1
	else: # if i % 2 != 0
		if a_odd_sum + a_odd[i] < 0:
			curr += abs(1 - (a_odd_sum + a_odd[i]))
			a_odd[i] = abs(1 - a_odd_sum)
		elif a_odd_sum + a_odd[i] == 0:
			curr += 1
			a_odd[i] = 1
	a_odd_sum += a_odd[i]

#print(a_odd, "curr:", curr, file=sys.stderr)

res = min(res, curr)
print(res)


Measured memory_bytes: 14332
#include<iostream>
using namespace std;
int main() {
	int a, b;
	cin >> a >> b;
	if (a > b) {
		cout << "a > b" << endl;
	}
	else if (a == b) {
		cout << "a == b" << endl;
	}
	else{
		cout << "a < b" << endl;
	}
}


Measured memory_bytes: 3084
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        long n = long.Parse(Read.Str());
        long until = 0;
        List<long> ans = new List<long> { };
        for (long i = 1; i <= n; i++)
        {
            ans.Add(i);
          if(ans.Sum() > n) { ans.Remove(ans.Sum()-n); break; }
        }
        foreach (long i in ans)
        {
            Console.WriteLine(i);
        }
        Console.ReadLine();
    }
    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b) { return a / gcd(a, b) * b; }
    public static string Reverse(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static bool IsPrime(int num)
    {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

        double sqrtNum = Math.Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2)
        {
            if (num % i == 0)
            {
                // 素数ではない
                return false;
            }
        }

        // 素数である
        return true;
    }
}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long() { return long.Parse(Console.ReadLine()); }
    public static long[] longs() { return Console.ReadLine().Split().Select(long.Parse).ToArray(); }
    public static int Int() { return int.Parse(Console.ReadLine()); }
    public static int[] ints() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

Measured memory_bytes: 13268
# let
N = int(input())

# var
ans = 0

def judge(n):
	# var
	i = 1
	dic = set()

	while i ** 2 <= n:
		if n % i == 0:
			dic.add(i)
			dic.add(n // i)
		i += 1
	return len(dic) == 8

for i in range(1, N + 1, 2):
	ans += judge(i)

print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ll N;
    cin >> N;
    ll ans_num = 0;
    for (int i = 2; i * (i + 1) <= 200000; i++){
        if (i * (i + 1) == 2 * N){
            ans_num = i;
        }
    }
    if (N == 1){
        cout << "Yes" << endl;
        cout << 2 << endl;
        cout << "1 1" << endl;
        cout << "1 1" << endl;
    }
    else if (ans_num == 0){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
        vector<vector<ll> > ans(ans_num + 1, vector<ll> (0));
        ll ans_copy = ans_num;
        ll state = 0;
        ll sum = 1;
        while(ans_copy > 0){
            for (ll i = 1; i <= ans_copy; i++){
                ans[state].push_back(sum);
                sum++;
            }
            state++;
            ans_copy--;
        }
        ans_copy = ans_num;
        state = 1;
        sum = 1;
        while(ans_copy > 0){
            for (ll i = 1; i <= ans_copy; i++){
                ans[state + i - 1].push_back(sum);
                sum++;
            }
            state++;
            ans_copy--;
        }
        cout << ans_num + 1 << endl;
        rep(i,ans_num + 1){
            cout << ans_num << " ";
            rep(j,ans_num){
                cout << ans[i][j] << " ";
            }
            cout << endl;
        }
    }
}


Measured memory_bytes: 5012
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<climits>
#include<map>
#define ll long long
using namespace std;
int main() {
	ll n,p=1;
	cin >> n;
	for (ll i = 1; i <= n; i++) {
		p *= i;
		p = p % (1000000000 + 7);
	}
	cout << p << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,m,ans,a[100005];
multiset <long long> s;
int main(){
    cin>>n>>m;
    for(int k=1;k<=n;k++){
        cin>>a[k];
        s.insert(a[k]);
    }
    if(n==1){
       while(m>0){
            a[1]/=2;
            m--;
       }
       cout<<a[1];
       return 0;
    }
  while(m>0){
   multiset <long long>::iterator it=s.end(),it1=s.end();
   it--;
   it1--;
   it1--;
  long long a=*it,b=*it1;
   s.erase(it);
   while(a>=b && m>0){
    a/=2;
    m--;
   }
   s.insert(a);
  }
  for(auto i : s){
    ans+=i;
  }
  cout<<ans;
return 0;
}


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

int main() {
  int a,b,c;
  cin >> a >> b;
  c = a * b;
  
  if ( c % 2 == 0 ) {
  	cout << "Even" << endl;
  } else {
  	cout << "Odd" << endl;
  }
}

Measured memory_bytes: 256
// SeeAlso: 

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define MAX 100000
#define NIL -1
#define MOD 1000000007

typedef int _loop_int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define debug(x) cout<<#x<<": "<<x<<endl
#define debig_vec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

// 最大公約数
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
// 最小公倍数
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

#define print2D(h, w, arr) rep(i, h) { rep(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}


int main() {
    int n;
    cin >> n;
    if(n<1000) {
        print("ABC");
    } else {
        print("ABD");
    }
    return 0;
}


Measured memory_bytes: 256
n = int(input())
dat = []
for i in range(n):
    t = []
    an = int(input())
    for i in range(an):
        x, y = map(int, input().split())
        x -= 1
        t.append([x,y])
    dat.append(t)

res = 0

bin_a = ["{:015b}".format(a) for a in range(0, 2**n)]
bin_a = list(map(lambda x: [int(y) for y in list(x)], bin_a))
#print(dat)

for x in bin_a:
    x.reverse()
    #print("pattttttttttttttttt", x)
    r = 0
    f = True
    tmp = [-1] * n
    for i in range(n):
        if x[i] == 1:
            #print("i", i)
            for y in dat[i]:
                #print("y", y)
                if y[1] == 0 and x[y[0]] == 0:
                    if tmp[y[0]] != 1:
                        tmp[y[0]] = 0
                        continue
                    f = False
                if y[1] == 1 and x[y[0]] == 1:
                    if tmp[y[0]] != 0:
                        tmp[y[0]] = 1
                        continue
                    f = False
                f = False
    if f:
        res = max(res, sum(x))
print(res)


Measured memory_bytes: 56796
import java.util.Scanner;

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

    Scanner sc = new Scanner(System.in);

    int i = 0;

        while (true) {
          int  x = sc.nextInt();
          if (x == 0) {
            break;
          }
            System.out.println("Case " + (++i) + ": " + x );
        }
  }
}



Measured memory_bytes: 41340
///AtCoder Beginner Contest 141
#include<bits/stdc++.h>
using namespace std;
#define ll long long

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

  string value[3]={"Sunny","Cloudy","Rainy"};


  string str;
  cin>>str;

  for(int i=0;i<3;i++)
  {
      if(str==value[i])
      {
          cout<<value[(i+1)%3]<<"\n";
      }
  }


  return 0;
}



Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

//ConvReiwa ..
func ConvReiwa(sd []string) []string {
	var ne []string
	yr, _ := strconv.Atoi(sd[1])
	mn, _ := strconv.Atoi(sd[2])

	switch {
	case yr < 31:
		return sd
	case yr == 31 && mn < 5:
		return sd
	default:
		ne = append(ne, "?")
		ne = append(ne, strconv.Itoa(yr-30))
		ne = append(ne, sd[2])
		ne = append(ne, sd[3])
		return ne
	}
}

func main() {

	for sc.Scan() {

		str := sc.Text()

		if str == "#" {
			break
		}

		sdt := strings.Split(str, " ")
		ans := ConvReiwa(sdt)

		fmt.Printf("%s %s %s %s\n", ans[0], ans[1], ans[2], ans[3])
	}

}



Measured memory_bytes: 1080
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int INF = (int)1e9 + 7;
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 dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};

int main() {
    int n;
    while (cin >> n, n) {
        vector<int> x(n, 0), y(n, 0);
        for (int i = 1; i < n; i++) {
            int id, d; cin >> id >> d;
            x[i] = x[id] + dx[d];
            y[i] = y[id] + dy[d];
        }
        int l = INF, r = 0, b = INF, u = 0;
        for (int i = 0; i < n; i++) {
            chmin(l, x[i]); chmax(r, x[i]);
            chmin(b, y[i]); chmax(u, y[i]);
        }
        cout << r - l + 1 << " " << u - b + 1 << endl;
    }
    return 0;
}


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

public class Main{
 public static void main(String[] args){
   Scanner s = new Scanner(System.in);
   int n = s.nextInt();
   int[] v = new int[n];
   
   int profit =0;
   for(int i=0; i<n; i++){
    v[i] = s.nextInt(); 
   }
   
   for(int j=0; j<n; j++){
    profit = profit + Math.max(0,v[j] - s.nextInt());
   }
   
   System.out.print(profit);
 }
}

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

int main()
{
    int A[3], K;
    cin >> A[0] >> A[1] >> A[2] >> K;
    sort(A, A + 3);
    for(int i = 0; i < K; ++i) A[2] *= 2;
    cout << A[0] + A[1] + A[2] << endl;
    return 0;
}

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

int main() {
    long long n, sum = 0;
    std::cin >> n;
    std::vector<long long> a(n);
    for (int i = 0ll; i < n; i++) {
        std::cin >> a[i];
        sum += a[i];
    }

    long long half = sum / 2 + (sum % 2);
    std::bitset<4000001> dp(1);
    for (int i = 0; i < n; i++) {
        dp = dp | (dp << a[i]);
    }

    for (auto i = half; ; i++) {
        if (dp[i]) {
            std::cout << i << std::endl;
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 2304
#include"bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
int r[100006];
int t[100005], a[100005];
signed main() {
	int x, k; cin >> x >> k;
	rep(i, k)cin >> r[i+1];
	int q; cin >> q;
	rep(i, q)cin >> t[i] >> a[i];
	t[q] = 1145141919;
	r[k + 1] = 1145141919;
	int u = 0, d = x, ux = 0, dx = x;
	int now = 0;
	rep(i, k+1) {
		while (t[now] < r[i+1]) {
			int ft = a[now];
			if (ft < u)ft = u;
			else if (d < ft)ft = d;
			int D = t[now] - r[i];
			if (i & 1) {
				ft += D + ux - u;
				ft = min(ft, x);
				cout << ft << endl;
			}
			else {
				ft -= D; ft += ux - u;
				ft = max(0ll, ft);
				cout << ft << endl;
			}
			now++;
		}
		int D = r[i + 1] - r[i];
		if (i & 1) {
			ux += D; dx += D;
			if (dx > x) {
				d -= dx - x;
				dx = x;
			}
			if (ux > x) {
				u = d = x;
				ux = dx = x;
			}
		}
		else {
			ux -= D; dx -= D;
			if (ux < 0) {
				u += -ux;
				ux = 0;
			}
			if (dx < 0) {
				u = d = ux = dx = 0;
			}
		}
	}
}

Measured memory_bytes: 3584
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int x = sc.nextInt(), n = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			list.add(sc.nextInt()-x);
		}
		Collections.sort(list);
		int ww = -100;
		for(int i = -99; i < 100; i++) {
			if(!list.contains(i) && Math.abs(i) < Math.abs(ww)) {
				ww = i;
			}
		}
		System.out.println(x+ww);
	}

	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    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 int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    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: 32660
#include <bits/stdc++.h>
using namespace std;

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}

#define MAX 500000
int L[MAX/2 + 2], R[MAX/2 + 2];
int cnt;


signed main()
{   
    gearup;
    int n; cin >> n;
    vl a(n),b(n),c(n-1);
    rep(i,n) cin >> a[i];
    rep(i,n) cin >> b[i];
    rep(i,n-1) cin >> c[i];
    ll res = b[a[0]-1];
    ll pre = a[0] - 1;
    rep1(i,n){
        res += b[a[i]-1];
        if(pre+1 == a[i] -1) res+=c[pre];
        pre = a[i] -1;
    }
    cout << res << endl;
}

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

int main(){
    int n;
    cin>>n;
    vector<int> p(n);
    for(int i=0;i<n;i++) cin>>p[i];
    cout<<accumulate(p.begin(),p.end(),0)-*max_element(p.begin(),p.end())/2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define debug(var) std::cout << #var << " : " << var << std::endl;
using ll = long long;
using ull = unsigned long long;
ll mod = 1e9 + 7;

int main(){


	int H, W; std::cin >> H >> W;
	std::vector<std::string> C(H);
	rep(i, H)std::cin >> C[i];
	rep(i, H){
		rep(j, 2){
			std::cout << C[i] << std::endl;
		}
	}

	
	return 0;
}

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

int main(){
  ll n;
  cin >> n;
  
  for(int i=1; i<=3500; i++){
   for(int j=1; j<=3500; j++){
     if((4*i*j-n*i-n*j)==0)continue;
     if(n*i*j%(4*i*j-n*i-n*j)==0 && n*i*j/(4*i*j-n*i-n*j)>0){
      cout << i << " " << j << " " <<  n*i*j/(4*i*j-n*i-n*j) << endl;
      return 0;
     }
   }
  }
  
}

Measured memory_bytes: 256
#include <iostream>
//#include <stdlib.h>
using namespace std;
int main(void)
{
    int N;
    string A, B, C;
    cin >> N;
    cin >> A;
    cin >> B;
    cin >> C;
    int answer = 0;
    for (int i = 0; i < N; i++)
    {
        if (A[i] != B[i] && B[i] != C[i] && C[i] != A[i])
            answer += 2;
        else if (A[i] == B[i] && B[i] == C[i] && C[i] == A[i])
            continue;
        else
            answer += 1;
    }
    cout << answer << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define uii             unordered_map<int,int>
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
void S_K_S()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}


int32_t main()
{
	S_K_S();
	int d,t,s;
	cin>>d>>t>>s;
	double at=((double)d/s);
	if(at>t)
	 cout<<"No";
	else
	 cout<<"Yes";
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using Weight = int;
using Capacity = int;
struct Edge {
    int src, dst;
    Weight weight;
    Edge() : src(0), dst(0), weight(0) {}
    Edge(int s, int d, Weight w) : src(s), dst(d), weight(w) {}
};
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;
using Array = std::vector<Weight>;
using Matrix = std::vector<Array>;

void add_edge(Graph &g, int a, int b, Weight w = 1) {
    g[a].emplace_back(a, b, w);
    g[b].emplace_back(b, a, w);
}
void add_arc(Graph &g, int a, int b, Weight w = 1) { g[a].emplace_back(a, b, w); }

Edge double_sweep(const Graph &g, int s = 0) {
    static const Weight INF = std::numeric_limits<Weight>::max() / 8;
    static const auto bfs = [](const Graph &g, int s, std::queue<int> &q, std::vector<int> &dist) {
        while(q.size()) q.pop();
        q.push(s);
        int n = g.size();
        dist.assign(n, INF);
        dist[s] = 0;
        while(q.size()){
            int u = q.front();
            q.pop();
            for(auto &e : g[u]){
                int v = e.dst;
                if(dist[v] == INF){
                    dist[v] = dist[u] + e.weight;
                    q.push(v);
                }
            }
        }
        return dist;
    };
    std::vector<Weight> dist;
    std::queue<int> q;
    bfs(g, s, q, dist);
    int n = g.size(), u = -1, v = -1;
    for (int i = 0; i < n; i++)
        if (dist[i] != INF && (u == -1 || dist[i] > dist[u])) u = i;
    bfs(g, u, q, dist);
    for (int i = 0; i < n; i++)
        if (dist[i] != INF && (v == -1 || dist[i] > dist[v])) v = i;
    Weight d = dist[v];
    if (u > v) std::swap(u, v);
    return Edge(u, v, d);
}

int main(){
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.tie(0);
    int n;
    std::cin >> n;
    Graph g(n);
    for(int i = 0; i < n - 1; ++i){
        int a, b, c;
        std::cin >> a >> b >> c;
        add_edge(g, a, b, c);
    }
    std::cout << double_sweep(g).weight << std::endl;
}

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

using namespace std;
const long long MOD = 998244353;

///mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 200100;
int a[N];

void solve() {
        int n;

        cin >> n;
        long long sum = 0;

        for (int i = 1; i <= n; i++) {
                cin >> a[i];
                long long z = max(a[i], a[i - 1]);
                sum += z - a[i];
                a[i] = z;
        }
        cout << sum << endl;

}


int main() {
#ifdef QWERTY
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
#endif
        ios_base::sync_with_stdio(false);


        int t = 1;
//        cin >> t;

        for (int i = 1; i <= t; i++) {
//                cout << "Case #" << i << ": ";
                solve();
        }

        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
        return 0;
}

Measured memory_bytes: 4416
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")


N = list(_S())
ans = 'No'

for s in N:
    if s == '7':
        ans = 'Yes'
        break

print(ans)

Measured memory_bytes: 9096
#include <iostream>
#include <string>
#include <map>

using namespace std;

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

Measured memory_bytes: 3148
n=int(input())
li = list(map(int,input().split()))
if(li[0]>li[1]):
    max=li[0]
    min=li[1]
else:
    max=li[1]
    min=li[0]
for i in range(2,n):
    if(li[i]>max):
        max=li[i]
    if(min>li[i]):
        min=li[i]
print(max-min)

Measured memory_bytes: 3064
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int r = getInt(sc);
		System.out.println(3 * r * r);

	}

	/**
	 * *汎用メソッド<br>
	 * 入力した配列に対する順列を取得
	 *
	 * @param numArray
	 * @return
	 */
	private static List<Integer[]> getPermutation(int[] numArray) {
		List<Integer[]> permutation = new ArrayList<>();
		Integer[] ans = new Integer[numArray.length];
		boolean[] used = new boolean[numArray.length];

		return buildPermutaion(permutation, numArray, ans, used, 0);
	}

	/**
	 * *汎用メソッド(内部)<br>
	 * 入力した配列に対する順列を作成
	 *
	 * @param list
	 * @param numArray
	 * @param ans
	 * @param used
	 * @param depth
	 * @return
	 */
	private static List<Integer[]> buildPermutaion(List<Integer[]> list, int[] numArray, Integer[] ans, boolean[] used,
			int depth) {

		// 全部使い切った時=>できた順列を返す
		if (depth == numArray.length) {
			list.add(ans.clone());
			return list;
		}
		// 使い切っていない場合

		for (int i = 0; i < numArray.length; i++) {
			if (used[i]) {
				continue;
			}
			ans[depth] = numArray[i];
			used[i] = true;
			list = buildPermutaion(list, numArray, ans, used, depth + 1);

			used[i] = false;
		}

		return list;
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をintで返却
	 *
	 * @return
	 */
	public static int getInt(Scanner sc) {

		return Integer.parseInt(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をStringで返却
	 *
	 * @return
	 */
	public static String getString(Scanner sc) {

		return sc.next();
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をint配列で返却
	 *
	 * @return
	 */
	public static int[] getIntArray(Scanner sc) {
		String line = "";
		// 直前にnext()を実行していると改行コードだけ取ってしまうのでその対策
		while (line.equals("")) {
			line = sc.nextLine();
		}

		String[] strArray = line.split(" ");
		int[] intArray = new int[strArray.length];
		for (int i = 0; i < strArray.length; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}

}


Measured memory_bytes: 35580
program test
implicit none
integer(8) :: mondai_max,mondai,point,ii,i,j,k,m,n,d,g,p(100),c(100),comp(10) = 0,needs
read(*,*) d,g
do i=1,d
	read(*,*) p(i),c(i)
enddo

mondai_max = 10**9

do ii = 1,2**d
	
	mondai = 0
	point = 0
	
	do i=1,d
	if(comp(i) == 1) then
		mondai = mondai + p(i)
		point = point + 100*i*p(i) + c(i)
	endif
	enddo
	if(point >= g) then
	mondai_max = min(mondai_max,mondai)
	goto 10
	endif

	do i=d,1,-1
		if (comp(i) == 1) then
			continue
		else if(point+(p(i)-1)*100*i>=g) then
			needs = ceiling((g - point) / (100. * i))
			mondai = mondai + needs
			
			mondai_max = min(mondai_max,mondai)
			goto 10
		else
			mondai = mondai + p(i)-1
			point = point + 100*i*(p(i)-1)
		endif
	enddo

10 continue

	comp(1) = comp(1) + 1
	do i=1,d-1
	if(comp(i) == 2) then
		comp(i) = 0
		comp(i+1) = comp(i+1) + 1
	endif
	enddo

enddo

write(*,*) mondai_max

end program

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef pair<P,T> PT;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  int dx[4]={1,0,-1,0};
  int dy[4]={0,1,0,-1};
  int h,w,k;
  cin>>h>>w>>k;
  int x1,y1,x2,y2;
  cin>>x1>>y1>>x2>>y2;
  char c[h][w];
  rep(i,0,h){
    rep(j,0,w){
      cin>>c[i][j];
    }
  }
  P dp[h][w][4];
  rep(i,0,h){
    rep(j,0,w){
      rep(l,0,4){
        dp[i][j][l]=P(1e9,1e9);
      }
    }
  }
  rep(i,0,4){
    dp[x1-1][y1-1][i]=P(1,0);
  }
  priority_queue<PT,vector<PT>,greater<PT>> q;
  rep(i,0,4){
    q.push(PT(P(1,0),T(x1-1,y1-1,i)));
  }
  while(q.size()){
    PT pt=q.top();
    q.pop();
    int x;
    int y;
    int d;
    tie(x,y,d)=pt.second;
    if(dp[x][y][d]<pt.first) continue;
    rep(i,0,4){
      if(i==d){
        P p=pt.first;
        p.second++;
        if(p.second>k){
          p.first++;
          p.second=1;
        }
        if(0<=x+dx[i] && x+dx[i]<h && 0<=y+dy[i] && y+dy[i]<w && c[x+dx[i]][y+dy[i]]=='.' && dp[x+dx[i]][y+dy[i]][i]>p){
          dp[x+dx[i]][y+dy[i]][i]=p;
          q.push(PT(dp[x+dx[i]][y+dy[i]][i],T(x+dx[i],y+dy[i],i)));
        }
      }
      else{
        if(0<=x+dx[i] && x+dx[i]<h && 0<=y+dy[i] && y+dy[i]<w && c[x+dx[i]][y+dy[i]]=='.' && dp[x+dx[i]][y+dy[i]][i]>P(pt.first.first+1,1)){
          dp[x+dx[i]][y+dy[i]][i]=P(pt.first.first+1,1);
          q.push(PT(dp[x+dx[i]][y+dy[i]][i],T(x+dx[i],y+dy[i],i)));
        }
      }
    }
  }
  P ans=P(1e9,1e9);
  rep(i,0,4){
    ans=min(ans,dp[x2-1][y2-1][i]);
  }
  if(ans==P(1e9,1e9)){
    cout<<-1<<endl;
  }
  else{
    cout<<ans.first<<endl;
  }
  /*rep(i,0,h){
    rep(j,0,w){
      P ans=P(1e9,1e9);
      rep(l,0,4){
        ans=min(ans,dp[i][j][l]);
      }
      cout<<ans.first<<ans.second;
    }
    cout<<endl;
  }*/
}

Measured memory_bytes: 40596
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;

#define MOD 998244353

int main(){
    ll n,m,x,y;
    cin >> n >> m >> x >> y;
    ll xx[n],yy[m];
    for (ll i=0;i<n;i++)cin >> xx[i];
    for (ll i=0;i<m;i++)cin >> yy[i];
    sort(xx,xx+n);
    sort(yy,yy+m);
    if (max(xx[n-1],x)<min(y,yy[0]))cout << "No War" << endl;
    else cout << "War" << endl;
    return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
    string S;
    cin>>S;
    ll sum=0,x=0;
    for(int i=0; i<S.size(); i++){
        if(S[i]=='W')sum+=x;
        else x++;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <numeric>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
typedef pair<string, int> P;
#define mod 1e9 + 7;
ll gcd(ll x, ll y)
{
	ll r;
	while ((r = x % y) != 0)
	{
		x = y;
		y = r;
	}
	return y;
}
ll lcm(ll x, ll y)
{
	x /= gcd(x, y);
	y /= gcd(x, y);
	return (x * y);
}


int main()
{
	ios_base::sync_with_stdio(false);
	int n;
	string s, ret;
	cin >> n >> s;
	ret = s;
	int sum=0;
	bool x = true;
	rep(i,n){
		if (s[i] == ')') sum--;
		else if (s[i] == '(') sum++;
		if (sum < 0) {
			ret = '(' + ret;
			sum++;
		}
	}
	while (sum) {
		ret += ')';
		sum--;
	}
	cout << ret << endl;
	return 0;
}


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

#define LL long long
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VL vector<LL>
#define VVL vector<vector<LL>>
#define VVVL vector<vector<vector<LL>>>
#define VB vector<bool>
#define FOR(i,a,b) for(int i= (a); i<((int)b); ++i)
#define RFOR(i,a) for(int i=(a); i >= 0; --i)
#define FOE(i,a) for(auto i : a)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v,x) (std::find(v.begin(), v.end(), x) != v.end())
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define EPS 1e-14

template<class T> T ceil(T a, T b) { return (a + b - 1) / b; }
template<class T> void print(T x) { std::cout << x << std::endl; }

const std::string YES = "YES", Yes = "Yes", NO = "NO", No = "No";
const std::vector<int> dy = { 0, -1, 0, 1 }, dx = { 1, 0, -1, 0 };    // 4近傍（右, 下, 左, 上）

using namespace std;


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

    while (true) {
        int N;
        cin >> N;
        if (N == 0) { break; }

        VVI day_human(31);
        FOR(i, 0, N) {
            VI v;
            int x;
            cin >> x;
            FOR(j, 0, x) {
                int day;
                cin >> day;
                day_human[day].emplace_back(i);
            }
        }

        vector<set<int>> dp(N);
        FOR(i, 0, N) {
            dp[i] = {i};
        }

        int ans = -1;
        FOR(day, 0, day_human.size()) {
            FOE(h1, day_human[day]) {
                FOE(h2, day_human[day]) {
                    FOE(item, dp[h2]) {
                        dp[h1].insert(item);
                    }
                }
                if (dp[h1].size() == N) {
                    ans = day;
                }
            }
            if (ans != -1) {
                break;
            }
        }
        print(ans);
    }

    return 0;
}


Measured memory_bytes: 3276
#include <iostream>
#include <complex>
#include <cmath>
#include <iomanip>
using namespace std;
typedef complex<double> xy;
double eps = 1e-9;
double dot_product(xy a,xy b) {return (conj(a)*b).real();}
double cross_product(xy a,xy b) {return (conj(a)*b).imag();}
xy projection(xy p,xy b) {return b*dot_product(p,b)/norm(b);}
xy projection2(xy p1,xy p2,xy p){
    p -= p1; p2 -= p1;
    xy proj = projection(p,p2);
    return p1+proj;
}

bool is_online(xy a1,xy a2,xy p){
    return abs(a1-p)+abs(a2-p)<=abs(a1-a2)+eps;    
}

bool is_intersected(xy a1, xy a2, xy b1, xy b2){
    if(is_online(a1,a2,b1) || is_online(a1,a2,b2)) return true;
    if(is_online(b1,b2,a1) || is_online(b1,b2,a2)) return true;
    return (cross_product(a2-a1,b1-a1)*cross_product(a2-a1,b2-a1)<-eps) && 
    (cross_product(b2-b1,a1-b1)*cross_product(b2-b1,a2-b1))<-eps;
}

int Q;
double X[5],Y[5];
int main(){
    cin >> Q;
    for(int i=0;i<Q;i++){
        for(int j=1;j<=4;j++){
            cin >> X[j] >> Y[j];
        }
        cout << (is_intersected(xy(X[1],Y[1]),xy(X[2],Y[2]),xy(X[3],Y[3]),xy(X[4],Y[4]))? 1:0) << endl;       
    }
}


Measured memory_bytes: 3276
N = int(input())
global cnt
cnt = 0

def dfs(x, use):
    global cnt
    if x > N:
        return
    if use == 7:
        cnt += 1
    dfs(x*10+3, use|0b001)
    dfs(x*10+5, use|0b010)
    dfs(x*10+7, use|0b100)


dfs(0, 0)
print(cnt)

Measured memory_bytes: 3188
// author: tarang 
#include<bits/stdc++.h>
#define ll long long
#define endl  '\n'
#define fastio  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const int MOD=1000000007;
#define PI acos(-1)
using namespace std;
int vis[1000000+7];
int gcd(int x, int y)
{                     
        return (x==0)? y : gcd(y % x, x);
}
int main(){
    int n ; cin >> n ;
    int a[n] ; cin >> a[0];
    int ans = a[0] ;
    for(int i = 1 ; i < n  ; i++){
    	  cin >> a[i];
    	  ans = gcd(ans,a[i]);
	}
	for(int i = 0 ; i < n ; i++){
		  int x = a[i];
		  for(int j = 2 ; j*j <= x ; j++){
		  	  if(x%j==0){
		  	  	while(x%j==0){
		  	  		   x/=j;
					}
					vis[j]++;
				}
		  }
		  if(x > 1){
		  	vis[x]++;
		  }
	}
	bool flag = 0;
	for(int i = 2 ; i <= 1000000 ; i++){
		 if(vis[i] > 1){
		 	flag = 1;
		 	break;
		 }
	}
	if( ans == 1){
		if(flag != 0){ 
		   cout << "setwise coprime " << endl;
		}
		else cout << "pairwise coprime " << endl;
	}
	else cout << "not coprime" << endl;
}



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

#define sd(mark) scanf("%d",&mark)
#define s2d(mark,marx) scanf("%d%d",&mark,&marx)
#define s3d(mark,marx,marz) scanf("%d%d%d",&mark,&marx,&marz)
#define sf(mark) scanf("%f",&mark)
#define slf(mark) scanf("%lf",&mark)
#define sst(mark) scanf("%s",&mark)
#define sld(mark) scanf("%lld",&mark)
#define s2ld(mark,marx) scanf("%lld%lld",&mark,&marx)
#define s3ld(mark,marx,marz) scanf("%lld%lld%lld",&mark,&marx,&marz)
#define sline(mline) scanf("%[^\n]%*c",&mline)

#define pi(n) printf("%d\n",n)
#define pf(n) printf("%f\n",n)
#define plf(n) printf("%lf\n",n)
#define pst(n) printf("%s\n",n)
#define pl(n) printf("%lld\n",n)

#define pis(n) printf("%d ",n)
#define pfs(n) printf("%f ",n)
#define plfs(n) printf("%lf ",n)
#define pss(n) printf("%s ",n)
#define pls(n) printf("%lld ",n)

#define sff fflush(stdout)
#define decimal(n) cout.precision(n)
#define fix cout<<fixed
#define debug(mark) printf("check%d\n",mark)
#define in(a) cin>>a
#define out(a) cout<<a<<'\n'
#define clr(mark) memset(mark,0,sizeof(mark))
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long int
#define mod 1000000007ll
#define llu unsigned long long int
#define endl '\n'
#define INF 1123456789
#define eps 1e-9
#define fo(i,a,b) for(int i=a;i<b;++i)
#define foll(i,a,b) for(ll i=a;i<b;++i)
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)

#define UL 100000		//5
#define MAXN 1000000	//6
#define MAXL 10000000	//7

typedef vector< vector<int> > vvi;
typedef vector< vector<ll> > vvl;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< pair<ll,ll> > vll;
typedef pair<char,char> pcc;
typedef vector< pair<int, int> > vii;


// bool mark[MAXN+5];

// int sieve()
// {
// 	int ULL = MAXN;
// 	for(int i=0;i<=ULL;i++) mark[i]=true;
// 	for(int i=2;i*i<=ULL;i++) if(mark[i]) for(int j=i*i;j<=ULL;j+=i) mark[j]=false;
// 	for(int i=2;i<=ULL;i++) if(mark[i]) p.pb(i);
// 	return p.size();
// }


ll gcd(ll a, ll b) {if(!b) return a; return gcd(b,a%b);}

ll modexp(ll a,ll b)
{
	if(b==0) return 1;
	if(b==1) return a;
	ll temp = modexp(a,(b>>1));
	temp = (temp*temp);
	return (temp*modexp(a,b&1));
}

ll modexp(ll a,ll b, ll m)
{
	if(b==0) return 1;
	if(b==1) return a%m;
	ll temp = modexp(a,(b>>1),m);
	temp = (temp*temp)%m;
	return (temp*modexp(a,b&1,m))%m;
}

ll modinv(ll a, ll p)
{
	return modexp(a,p-2,p);
}

int main()
{
	int x1,y1,x2,y2;
	s2d(x1,y1);
	s2d(x2,y2);
	int wx = y1-y2,wy = x2-x1;
	int x3p = x2 + wx;
	int y3p = y2 + wy;
	int x4p = x1 + wx;
	int y4p = y1 + wy;
	int x3m = x2 - wx;
	int y3m = y2 - wy;
	int x4m = x1 - wx;
	int y4m = y1 - wy;
	int num = (y3p-y1)*(x2-x1) - (y2-y1)*(x3p-x1);
	int den = (x3p-x1)*(x2-x1) + (y3p-y1)*(y2-y1);
	if(num==den) cout<<x3p<<" "<<y3p<<" "<<x4p<<" "<<y4p<<"\n";
	else cout<<x3m<<" "<<y3m<<" "<<x4m<<" "<<y4m<<"\n";
}

Measured memory_bytes: 256
#全然わからず完コピ
H,W=map(int,input().split())
a=[list(input()) for _ in range(H)]
h=[]
for i in range(H):
  if a[i]==['.']*W:
    h.append(i)

w=[]
for i in range(W):
  flag=0
  for j in range(H):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)
  
ans=[]
for i in range(H):
  if i not in h:
    r=[]
    for j in range(W):
      if j not in w:
        r.append(a[i][j])
    ans.append(r)

for i in range(len(ans)):
  print("".join(ans[i]))


Measured memory_bytes: 9232
a=[]
N = int(input())
for i in range(N):
    a.append(int(input()))
a=sorted(a)

if(len(a)==2):
    print(abs(a[0]-a[1]))
elif(len(a)==3):
    print(max(a[2] - a[1] + a[2] - a[0], a[1]-a[0] + a[2]-a[0]))
else:
    #----------------------------------------------------------------------
    def append2big(id1, id2):
        global bBeg
        global bEnd
        global s
        if (a[id1] - bBeg + a[id2] - bEnd < a[id2] - bBeg + a[id1] - bEnd):
            id1, id2 = id2, id1
        s+=a[id1] - bBeg + a[id2] - bEnd
        bBeg = a[id1]
        bEnd = a[id2]
    def append2small(id1, id2):
        global bBeg
        global bEnd
        global s
        if (bBeg - a[id1] + bEnd - a[id2] < bBeg - a[id2] + bEnd - a[id1]):
            id1, id2 = id2, id1
        s+=bBeg - a[id1] + bEnd - a[id2]
        bBeg = a[id1]
        bEnd = a[id2]
    def append1small(id):
        global bBeg
        global bEnd
        global s
        if (bBeg - a[id] > bEnd - a[id]):
            s+=bBeg-a[id]
            bBeg = a[id]
        else:
            s+=bEnd-a[id]
            bEnd = a[id]
    def append1big(id):
        global bBeg
        global bEnd
        global s
        if (a[id] - bBeg > a[id] - bEnd):
            s+=a[id]-bBeg
            bBeg = a[id]
        else:
            s+=a[id]-bEnd
            bEnd = a[id]
    # ----------------------------------------------------------------------
    s = a[N-2]-a[0] + a[N-1] - a[0]
    bBeg = a[N-2]
    bEnd = a[N-1]
    l = 0
    r = N-2
    cur = 0
    while(l<r-1):
        if(cur==0):
            if(l+2<r):
                append2small(l+1, l+2)
                l+=2
            elif(l+1<r):
                append1small(l+1)
                l+=1
            cur = 1-cur
        else:
            if(r-2>l):
                append2big(r-1, r-2)
                r-=2
            elif(r-1>l):
                append1big(r-1)
                r-=1
            cur = 1- cur
    r1 = s
    #-----case 2------
    s = a[N - 1] - a[0] + a[N - 1] - a[1]
    bBeg = a[0]
    bEnd = a[1]
    l = 1
    r = N - 1
    cur = 1
    while (l < r - 1):
        if (cur == 0):
            if (l + 2 < r):
                append2small(l + 1, l + 2)
                l += 2
            elif (l + 1 < r):
                append1small(l + 1)
                l += 1
            cur = 1 - cur
        else:
            if (r - 2 > l):
                append2big(r - 1, r - 2)
                r -= 2
            elif (r - 1 > l):
                append1big(r - 1)
                r -= 1
            cur = 1 - cur
    r2 = s

    print(max(r1, r2))

Measured memory_bytes: 8340
import java.util.HashSet;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashSet<Integer> map = new HashSet<Integer>();
		for(int i = 0; i < N; i++) {
			int A = sc.nextInt();
			if(map.contains(A)) map.remove(A);
			else map.add(A);
		}
		System.out.println(map.size());
	}
}

Measured memory_bytes: 60892
/*ANKON GHOSH
  KUET,ECE 2K16*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define MAX 4003
#define mod 1000000007
#define sf(a) scanf("%lld",&a)
#define sff(a,b) scanf("%lld %lld",&a,&b)
#define sfff(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define Case(i) cout<<"Case #"<<i<<": "
#define pf(a) printf("%lld\n",a)
#define pfsn printf("NO\n")
#define pfs  printf("YES\n")
#define pff(a,b) printf("%lld %lld\n",a,b)
#define pfff(a,b,c) printf("%lld %lld %lld\n",a,b,c)
#define pffff(a,b,c,d) printf("%lld %lld %lld %lld\n",a,b,c,d)
#define FOR(i,n) for(ll i=0;i<n;i++)
#define FOR1(i,n) for(ll i=1;i<=n;i++)
#define LOOP(x,y) for(ll r=x;r<=y;r++)
#define RFOR(i,n) for(ll i=n-1;i>=0;i--)
#define RFOR1(i,n) for(ll i=n;i>0;i--)
#define RLOOP(x,y) for(ll i=y;i>=x;i--)
#define m_p(a,b) make_pair(a,b)
#define p_b(a) push_back(a)
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
map<ll,ll>mp1,mp;
vector<pair<ll,pair<ll,ll> > >vpp,vpp1;
vector<pair<ll,ll> >vp,fin;
vector<ll>v,v1,v2,dummy;
map<pair<ll,ll>,bool>mbb;
map<ll,bool>mb;
ll n,k,a,b,c,d,ta,sum=0,cnt=0,m,l,req,sz,maxi;
bool sortbysec(const pair<pair<ll,ll>,ll> &a,const pair<pair<ll,ll>,ll> &b)
{
    return (a.second < b.second);
}
vector<ll>power;
void calc(ll n,ll k)
{
    ll sum=0;
    ll ans=0;
    for(ll i=n;i>=0;i--)
    {
        sum+=i;
        v.p_b(sum);
    }
    ll x=v.size();
    for(ll i=k;i<=n+1;i++)
    {
        ll x=((((i-1)*(i))/2)+mod)%mod;
        ll y=((v[i-1])+mod)%mod;
        ll rem=(((y-x)+1)+mod)%mod;
        ///cout<<x<<" "<<y<<endl;
        ans=(ans+rem)%mod;
    }
    ///cout<<ans2<<endl;
    cout<<ans<<endl;
}
int main()
{
    ll q;
    ll x;
    cin>>n>>k;
    calc(n,k);
    return 0;
}


Measured memory_bytes: 5340
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
//#define MOD 1000000007 //S.size()
using namespace std;
typedef unsigned long long ll;
const long long mod = 1e9 + 7;
int main(void){
	int N;
	cin >> N;
	long long ans = 1;
	for(long long i = 1; i <= N; i++){
		ans *= i;
		ans %= mod;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

int main(){
  int a, b;
  
  cin >> a >> b;
  
  if(a % 2 && b % 2){
    cout << "Odd" << endl;
  }
  else{
    cout << "Even" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	k, s := "", ""
	fmt.Scanf("%s", &k)
	fmt.Scanf("%s", &s)

	if k==s[:len(s)-1] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

Measured memory_bytes: 1816
import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    if (args.length > 0 && args(0) == "TEST") {
      println(test())
    } else {
      val input = io.Source.stdin.getLines().mkString("\n")
      println(solve(input).trim())
    }
  }

  def solve(input: String): String = {
    val sc: Scanner = new Scanner(input)
    val n,t,a = sc.nextInt
    val h = List.fill(n)(sc.nextInt)
    h.map(i => Math.abs(a - (t - i * 0.006))).zip(Stream from 1).minBy(_._1)._2.toString
  }

  val tests = List(
    """2
      |12 5
      |1000 2000""".stripMargin -> """1""",
    """3
      |21 -11
      |81234 94124 52141""".stripMargin -> """3"""
  )

  def test(): String = tests.map { case (i, o) => (i.trim(), o.trim()) }
    .zipWithIndex.map {
    case ((input, outputExpect), i) =>
      val output = solve(input).trim()
      val tnum = i + 1
      s"test$tnum:" + (
        if (output == outputExpect) "Passed"
        else s"Failed\nexpect:\n$outputExpect\noutput:\n$output")
  }
    .mkString("\n")
}

Measured memory_bytes: 27960
#include<stdio.h>
       
int main(void){
       
int a,b;
int d,r;
double f;
scanf("%d %d",&a,&b);

d=a/b;
r=a%b;
f=a*1.0/b;

printf("%d %d %.6lf",d,r,f);
  
return 0;
}


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

long long dp[100][100001];

long long maxValue(int w,int index,long long arr[][2]){
    if (index<0)
       return 0;
    else if (dp[index][w])
       return dp[index][w];
    else if (w-arr[index][0]<0)
       dp[index][w]=maxValue(w,index-1,arr);
    else{
        long long temp1=arr[index][1]+maxValue(w-arr[index][0],index-1,arr),temp2=maxValue(w,index-1,arr); 
        dp[index][w] = max(temp1,temp2);
    }
    return dp[index][w];
}

int main() {
    int n=0,w=0;
    cin>>n>>w;
    long long arr[n][2];
    memset(arr,0,sizeof(arr));
    for(int i=0;i<n;i++) cin>>arr[i][0]>>arr[i][1];
    vector<vector<long long>> dp(n,vector<long long>(w+1,0));
    cout<<maxValue(w,n-1,arr);
}


Measured memory_bytes: 152620