akhauriyash/Code-Regression huggingface dataset:
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
#include <numeric>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef vector<pair<int, int> > VPII;
typedef vector<string> VS;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define INF 999999999999999997;
#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORL(i,a,b) for(LL i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
#define O(s) cout<<s<<endl;

#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}

template<class T>T IN() { T d; cin >> d; return d; }

LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; } // 最大公約数（Greatest Common Divisor）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; } // 最小公倍数（Least Common Multiple）
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); } // うるう年判定

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int dxx[8] = { 0,1,1,1,0,-1,-1,-1 };
int dyy[8] = { 1,1,0,-1,-1,-1,0,1 };

// vector注意
// vec[i][j]の形に入力を入れるとき、vecは初期化してある必要がある.

// ------------------- include, typedef, define END. -------------------

int main() {
	FAST_IO;
	bool dbgF = true; // for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;

	int a, b, c, d;
	cin >> a >> b >> c >> d;
	O((a + b > c + d ? "Left" : a + b < c + d ? "Right" : "Balanced"));

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int prime(int num);
int main(void)
{
	int num[10001]={0},i,count=0,N;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",&num[i]);
	}
	for(i=0;i<N;i++){
		if(prime(num[i])==1) count++;
	}
	printf("%d\n",count);
	return 0;
}

int prime(int num){
	int count=0,i=3;
	if(num==2) return 1;		//1のとき素数
	if(num<2 || num%2==0) return 0;
	for(i=3;i*i<=num;i+=2){
		if(num%i==0) return 0;
	}
	return 1;
}

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

int main() {
  int x;
  cin >> x;
  if(x<=599) cout << 8 << endl;
  else if(x<=799) cout << 7 << endl;
  else if(x<=999) cout << 6 << endl;
  else if(x<=1199) cout << 5 << endl;
  else if(x<=1399) cout << 4 << endl;
  else if(x<=1599) cout << 3 << endl;
  else if(x<=1799) cout << 2 << endl;
  else if(x<=1999) cout << 1 << endl;
}

Measured memory_bytes: 3632
#pragma region

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++)
#define _irep3(i, begin, end) for (register int i = (end)-1, i##_begin = (begin); i >= i##_begin; i--)
#define _rep2(i, n) _rep3(i, 0, n)
#define _irep2(i, n) _irep3(i, 0, n)
#define _overload3(_1, _2, _3, name, ...) name
#define rep(...) _overload3(__VA_ARGS__, _rep3, _rep2, )(__VA_ARGS__)
#define irep(...) _overload3(__VA_ARGS__, _irep3, _irep2, )(__VA_ARGS__)
#define out(x) cout << (x) << '\n';
#define debug(x) cerr << #x << " = " << (x) << " (line: " << __LINE__ << ") " << endl;

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
using vvb = vector<vector<bool>>;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &pair) {
  cin >> pair.first >> pair.second;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[ ";
  rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i];
  os << " ]";
  return os;
}

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

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

void init() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(16) << boolalpha;
}

#pragma endregion

#define MOD 1000000007
#define INF 2147483647

int main() {
  init();

  string S;
  int Q;
  cin >> S >> Q;
  bool b = false;
  string end = "";
  rep(i, Q) {
    int q;
    cin >> q;
    if (q == 1) {
      b = !b;
    } else {
      int f;
      char C;
      cin >> f >> C;
      if (b ^ (f - 1)) {
        S += C;
      } else {
        end += C;
      }
    }
  }
  if (b) {
    irep(i, S.length()) cout << S[i];
    rep(i, end.length()) cout << end[i];
  } else {
    irep(i, end.length()) cout << end[i];
    rep(i, S.length()) cout << S[i];
  }
  cout << endl;
}


Measured memory_bytes: 980
#include<iostream>
#include<algorithm>
#include<string>
#include<functional>
#include<utility>
#include<stack>
#include<queue>
#include<cmath>
#include<list>
#include<cstdint>
#include<vector>
#include<map>
#define rep(i,rept)	for(ll i = 0; i<rept;i++)
typedef long long ll;
using namespace std;

unsigned long long int a = 0, b = 0, c = 1, x = 0, y = 0, z = 0, maxy = -1, mini = 9999, counter = 0, startp = 0, endp = 0, checker = 0;
std::vector <char> vec{}, vecsec{}, vecth{};
int iremono[100001];
std::vector<long long int>kinds{}, ans{}, kaku{};
char moji, moji2;
bool okada = false, okada2 = false;
std::string output, output2, input, one, two;
char rev[100001];
unsigned long long int kakunou2[101][101] = {};
unsigned long long int M, A, R, C, H;

int ctoi(const char c) {
	if ('0' <= c && c <= '9') return (c - '0');
	return -1;
}
unsigned long long int LCM(unsigned long long int a, unsigned long long int b) {
	unsigned long long int i, j;
	i = a; j = b;
	while (true) {

		c = i % j;
		i = j;
		if (c != 0) {

			j = c;

		}
		else {
			break;
		}
	}
	return j * (a / j) * (b / j);
}
int main()
{

	cin >> a;
	rep(i, a) {
		cin >> moji;
		vec.push_back(moji);
	}
	std::sort(vec.begin(),vec.end());
	vec.push_back('3');
	counter = 1;
	for (int i = 1; i <= a; i++) {
		if (vec[i - 1] == vec[i]) {
			counter++;
		}
		else {
			kaku.push_back(counter);
			counter = 1;
		}
    }
	rep(i, kaku.size()) {
		c *= kaku[i]+1;
		c %= 1000000007;
	}
	cout << c - 1 << endl;

	
}


Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

vector<vector<pair<Int,Int>>> graph;
vector<Int> color;

void dfs(Int v, Int col, Int dis) {
	color[v] = col;

	for (auto next_v:graph[v]) {
		if (color[next_v.first] != -1)continue;

	    if (next_v.second % 2) {
			dfs(next_v.first, 1 - col, next_v.second);
	    }
		else {
			dfs(next_v.first, col, next_v.second);
		}
	}

}

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N;
	cin >> N;

	graph.resize(N,vector<pair<Int,Int>>());
	Int a, b, c;
	for (Int i = 0; i < N-1; i++) {
		cin >> a >> b >> c;
		graph[a - 1].push_back(make_pair(b - 1,c));
		graph[b - 1].push_back(make_pair(a - 1,c));
	}

	color.resize(N,-1);//-1未読、0白、1黒
	dfs(0, 0, 0);

    for (Int i = 0; i < N; i++) {
		printf("%lld\n", color[i]);
    }
}

Measured memory_bytes: 9984
import math
import itertools

class Pos():
    def __init__(self, x, y):
        self.x = x
        self.y = y
    
def distance(a,b):
    return math.sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y))

points = []

num = int(input())
for i in range(num):
    x,y = input().split()
    points.append(Pos(int(x), int(y)))
    
total = 0
pattern = len(list(itertools.permutations(points)))

for l in itertools.permutations(points):
    n = len(l)
    for i in range(n-1):
        total = total + distance(l[i], l[i+1])
        
avg = total / pattern
print(avg)

Measured memory_bytes: 8052
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll=long long;
//#define int long long  ←保留
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279; //円周率
/*---------------------便利な関数--------------------------------------*/
int fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
 
int gcd(int a, int b) {        //最大公約数
    if (b == 0) return a;
    return gcd(b, a % b);
}
 
int lcm(int a, int b) {      //最小公倍数
    return a * b / gcd(a, b);
}
 
int keta(int n) {        //桁数を求める
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
 
int ketasum(int n) {    //各桁の和
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
 
/*-------------ここまで---------------------------------------------*/
 
//C++(GCC9.2.1)
 
/*signed*/int main(void) {
  int n;
  cin>>n;
  cout<<n*800-(n/15)*200<<endl;
  return 0;
}

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

void maxUpdate(int& a, int b) {
	a = max(a, b);
}

int n, d, x, p[11], dp[100010];

int main() {
	cin >> n >> d >> x;
	for_(i,0,n) cin >> p[i];
	
	for_(i,0,d-1) {
		memset(dp, 0, sizeof(dp));
		
		for_(j,0,n) {
			int np; cin >> np;
			for_(k,0,x+1) if (k >= p[j]) maxUpdate(dp[k], dp[k - p[j]] + np - p[j]);
			p[j] = np;
		}
		
		x += dp[x];
	}
	
	cout << x << endl;
}

Measured memory_bytes: 1560
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Linq;

namespace c
{
    class Program
    {
        public static readonly long INF = 999999999999;
        public static readonly long MOD = 1000000007;

        static void Main(string[] args)
        {
            var s = Console.ReadLine();

            if (s == "Sunny") Console.WriteLine("Cloudy");
            else if (s == "Cloudy") Console.WriteLine("Rainy");
            else Console.WriteLine("Sunny");
        }
    }

    public class Scanner
    {
        public static string[] Scan() => Console.ReadLine().Split(' ');
        public static int[] IntScan() => Array.ConvertAll(Scan(), int.Parse);
        public static long[] LongScan() => Array.ConvertAll(Scan(), long.Parse);
        public static string[] Scan(int n) => Enumerable.Repeat(0, n).Select(_ => Scan()[0]).ToArray();
        public static int[] IntScan(int n) => Enumerable.Repeat(0, n).Select(_ => IntScan()[0]).ToArray();
        public static long[] LongScan(int n) => Enumerable.Repeat(0, n).Select(_ => LongScan()[0]).ToArray();

    }

    public class Ex
    {
        public static bool Chmin(ref int a, int b) { if (a > b) { a = b; return true; } return false; }
        public static bool Chmin(ref long a, long b) { if (a > b) { a = b; return true; } return false; }
        public static bool Chmax(ref int a, int b) { if (a < b) { a = b; return true; } return false; }
        public static bool Chmax(ref long a, long b) { if (a < b) { a = b; return true; } return false; }
        public static int[] SubArr(int[] arr, int begin, int n) { int[] a = new int[arr.Length]; Array.Copy(arr, begin, a, 0, n); return a; }
    }
}


Measured memory_bytes: 13140
n,W=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
dp=[[0]*n for i in range(W+1)] #dp[w][i]
for i in range(n):
  for w in range(W+1):
    if i==0:
      dp[w][i]=a[0][0] if w>=a[0][1] else 0
    if w<a[i][1]:
      dp[w][i]=dp[w][i-1]
    else:
      dp[w][i]=max(dp[w][i-1],dp[w-a[i][1]][i-1]+a[i][0])
print(dp[W][n-1])


Measured memory_bytes: 26312
#include <stdio.h>
int main(){
  int a,b,c,judge=1;
  scanf("%d%d",&a,&b);
  if (b<10){
    c=a*10+b;
  }
  if (9<b && b<100){
    c=a*100+b;
  }
  if (b==100){
    c=1000*a+b;
  }
  for (int i=1;i<317;i++){
    if (i*i==c){
      judge=0;
      printf("Yes\n");
      break;
    }
  }
  if (judge){
    printf("No\n");
  }
  return 0;
}


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

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

int main()
{
	vi a(3);
	cin >> a[0] >> a[1] >> a[2];
	sort(a.begin(), a.end());
	cout << a[2]*10 + a[1]+a[0] << endl;

	return 0;
}

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

using namespace std;

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

    int n;
    cin >> n;
    vector<int> arr;

    for(int i = 1; i <= n; ++i)
    {
        int a;
        cin >> a;

        arr.push_back(a);

    }

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

    vector<int>::iterator it = unique(arr.begin(), arr.end());
    arr.erase(it, arr.end());

    cout << arr.size() << '\n';
}


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

int main() {

  string s;
  cin >> s;

  if(s == "Sunny") {
    cout << "Cloudy" << endl;
  }
  else if (s == "Cloudy") {
    cout << "Rainy" << endl;
  }
  else {
    cout << "Sunny" << endl;
  }
}

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

using namespace std;

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

#define X first
#define Y second


const int N=1e5+10;
const double eps=1e-12;
const int inf=2e8+10;

int n;
struct line{
    ll a,b,c;
    line (ll _a=0,ll _b=0,ll _c=0){
        a=_a;b=_b;c=_c;
    }
}a[N];



struct BIT{
    int b[N];
    void add(int x,int v){
        while (x<N){
            b[x]+=v;
            x+=x&-x;
        }
    }
    int get(int x){
        int ans=0;
        while (x){
            ans+=b[x];
            x-=x&-x;
        }
        return ans;
    }
}mbit;

double b[N],p[N];
ll check(double pos){
    for(int i=1;i<=n;i++) b[i]=(a[i].c-a[i].a*pos)/a[i].b;
    for(int i=1;i<=n;i++) p[i]=b[i];
    sort(p+1,p+n+1);
    int n1=0;
    for(int i=1;i<=n;){
        p[++n1]=p[i];
        while (i<=n&&abs(p[i]-p[n1])<=eps) i++;
    }

//    cout<<"*"<<pos<<" "<<n1<<'\n';
//    for(int i=1;i<=n1;i++) cout<<p[i]<<" \n"[i==n1];

    ll ans=0;
    memset(mbit.b,0,sizeof(mbit.b));
    for(int i=n;i>=1;i--){
        int L=1,R=n1;
//        cout<<"?"<<i<<" "<<b[i]<<'\n';
        while (L<=R){
            int mid=(L+R)/2;
            if (b[i]>=p[mid]+eps) L=mid+1;
            else R=mid-1;
        }
//        cout<<">"<<i<<" "<<R<<'\n';
        ans+=mbit.get(L);
        mbit.add(L,1);
    }
//    cout<<pos<<" "<<ans<<'\n';
    return ans;
}

double solve(){
    double L=-inf,R=inf;
    ll half=(1LL*n*(n-1)/2+1)/2;

//    cout<<n<<"+"<<half<<'\n';
    for(int te=1;te<=200;te++){
        double mid=(L+R)/2;
        if (check(mid)>=half) R=mid;
        else L=mid;
//        cout<<L<<" "<<R<<'\n';
    }
    return L;
}


double re[N];
bool comp(line p1,line p2){
    pll resp1=pll(p1.c+p1.a*inf,p1.b);
    pll resp2=pll(p2.c+p2.a*inf,p2.b);
    if (resp1.Y<0) resp1.X*=-1,resp1.Y*=-1;
    if (resp2.Y<0) resp2.X*=-1,resp2.Y*=-1;
    return resp1.X*resp2.Y<=resp2.X*resp1.Y;
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        int x,y,z;
        scanf("%d%d%d",&x,&y,&z);
        a[i]=line(x,y,z);
    }

    for(int di=1;di<=2;di++){
        for(int i=1;i<=n;i++) re[i]=(a[i].c+a[i].a*inf+.0)/a[i].b;
        sort(a+1,a+n+1,comp);
//        for(int i=1;i<=n;i++) cout<<a[i].a<<" "<<a[i].b<<" "<<a[i].c<<'\n';
        printf("%.9f ",solve());
        for(int i=1;i<=n;i++) swap(a[i].a,a[i].b);
    }
}


Measured memory_bytes: 4988
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
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 Z = scan.nextInt();
        int W = scan.nextInt();
        int[] a = new int[N];
        for (int i = 0; i < N; i++) {
            a[i] = scan.nextInt();
        }
        if (N == 1) {
            System.out.println(Math.abs(a[N-1]-W));
            return;
        }
        long answer = Math.max(Math.abs(a[N-1]-W),Math.abs(a[N-1]-a[N-2]));
        System.out.println(answer);
    }
}


Measured memory_bytes: 25556
using System;

class Program
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        string[] inputvalue = Console.ReadLine().Split(' ');
        int[] a = new int[N];
        int[] b = new int[N];
        for(int i = 0; i<N; i++)
        {
            a[i] = int.Parse(inputvalue[i]);
            b[i] = int.Parse(inputvalue[i]);
        }
        
        Array.Sort(a);
        
        int counter = 0;
        for(int i = 0; i<N; i++)
        {
            if(b[i] != a[i])
            {
                counter++;
            }

            if(counter > 2)
            {
                Console.WriteLine("NO");
                break;
            }
        }

        if(counter == 0 | counter == 2)
        {
            Console.WriteLine("YES");
        }
    }
}



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

int main() {
  string s;
  while (!cin.eof()) {
    cin >> s;
    if (s == "-") return 0;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      int n2;
      cin >> n2;
      s = s.substr(n2) + s.substr(0, n2);
    }
    cout << s << endl;
  }
}



Measured memory_bytes: 3180
#include <iostream>
#include <set>

using namespace std;

int main(int argc, char const *argv[])
{
    int n, d, c=0;
    set<int> s;
    cin >> n;
    for(int i=0;i<n;++i) {
        cin >> d;
        if(s.find(d)==s.end()) {
            s.insert(d);
            ++c;
        }
    }
    cout << c << endl;
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n - 1);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> c[i];
  }
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    ans += b[a[i]];
    if (a[i] == n - 1) {
      continue;
    }
    if (a[i] + 1 == a[i + 1]) {
      ans += c[a[i]];
    }
  }
  ans += b[a[n - 1]];
  cout << ans << endl;
  return 0;
}

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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
#define l_l pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>

using namespace std;

const ll MOD = 1000000007LL;
const ll INF = (1LL << 60LL);

int main() {
  // std::cout << std::fixed << std::setprecision(10);
  ll ans = -INF;

  ll K;
  scanf("%lld", &K);

  ll on = (K + 1) / 2;
  ll en = K / 2;

  cout << (on * en) << endl;
}


Measured memory_bytes: 3748
h,w = gets.chomp.split(" ").map(&:to_i)

arr = [Array.new(w+2, -1)]
tmp_keys = []
count = 0
result = 0
(1..h).each do |h_i|
  tmp_arr = [-1]
  a = gets.chomp
  (1..w).each do |w_i|
    if a[w_i - 1] == "#" then
      tmp_arr << 1
      tmp_keys << [h_i, w_i]
      count += 1
    else
      tmp_arr << 0
    end
  end
  tmp_arr << -1
  arr << tmp_arr
end
arr << Array.new(w+2, -1)

keys = [tmp_keys]
total = h * w
while count < total do
  result += 1
  keys[result] = []
  keys[result-1].each do |(h_i, w_i)|
    if arr[h_i - 1][w_i] == 0 then
      keys[result] << [h_i - 1, w_i]
      arr[h_i - 1][w_i] = 1
      count += 1
    end
    if arr[h_i + 1][w_i] == 0 then
      keys[result] << [h_i + 1, w_i]
      arr[h_i + 1][w_i] = 1
      count += 1
    end
    if arr[h_i][w_i - 1] == 0 then
      keys[result] << [h_i, w_i - 1]
      arr[h_i][w_i - 1] = 1
      count += 1
    end
    if arr[h_i][w_i + 1] == 0 then
      keys[result] << [h_i, w_i + 1]
      arr[h_i][w_i + 1] = 1
      count += 1
    end
  end
end

puts result


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

#define REP(i,n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> pint;
template <class T> inline void chmax(T &a, const T b) { a = max(a, b); }
template <class T> inline void chmin(T &a, const T b) { a = min(a, b); }
template <class T> void pp(T v, int n) { REP(i,n) cout<<v[i]<< ' '; cout << endl; }

void inline TorF(bool tf, const string &trueMessage, const string &falseMessage) { 
  cout << (tf ? trueMessage : falseMessage) << endl;
}
void inline YESNO(bool tf) { TorF(tf, "YES", "NO"); }
void inline YesNo(bool tf) { TorF(tf, "Yes", "No"); }

const int SIZE = 2048;

int cnt[4][SIZE][SIZE];

int main() {
  int H, W; cin>>H>>W;
  vector<string> S(H);
  REP(h,H) cin>>S[h];
  int tmp = 0;
  REP(w,W) {
    tmp = 0;
    REP(h,H) {
      if(S[h][w] == '#') tmp = 0;
      else tmp++;
      cnt[0][h][w] = tmp;
    }
    tmp = 0;
    for(int h = H-1; h >= 0; h--) {
      if(S[h][w] == '#') tmp = 0;
      else tmp++;
      cnt[1][h][w] = tmp;
    }
  }
  REP(h,H) {
    tmp = 0;
    REP(w,W) {
      if(S[h][w] == '#') tmp = 0;
      else tmp++;
      cnt[2][h][w] = tmp;
    }
    tmp = 0;
    for(int w = W-1; w >= 0; w--) {
      if(S[h][w] == '#') tmp = 0;
      else tmp++;
      cnt[3][h][w] = tmp;
    }
  }

  int ans = 0;
  REP(h,H) {
    REP(w,W) {
      int work = 1;
      REP(d,4) work += (cnt[d][h][w]-1);
      //      cout << cnt[0][h][w] << " ";
      chmax(ans, work);
    }
    //    cout << endl;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 69888
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>

#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

vector<int> game(vector<int> t, vector<int> h, int n){
	
	int turn = 1; //1=taro 0=hana
	int field = 0, f; 
	vector<int> res;

	sort(t.begin(),t.end());
	sort(h.begin(),h.end());
	
	while(1){
		
		f = 1;
	
		if(turn){	
			rep(i,t.size()){
				if(field < t[i]){
					
//					cout << "taro -> " << t[i] << endl;
					
					field = t[i];
					t.erase(remove(t.begin(), t.end(), t[i]), t.end()); 
					f = 0;
					break;
				}
			}
			turn = 0;
		}
		else{
			rep(i, h.size()){
				if(field < h[i]){

//					cout << "hana -> " << h[i] << endl;

					field = h[i];
					h.erase(remove(h.begin(), h.end(), h[i]), h.end()); 
					f = 0;
					break;
				}
			}
			turn = 1;
		}
		
		if(f) field = 0;

		if(t.empty() || h.empty()) break;
	}		
	
	res.push_back(h.size());
	res.push_back(t.size());

	return res;
}

int main(){
	int n;
	
	while(cin >> n, n){
	
	vector<int> taro,hana,res;
	int m;
	
	rep(i,n*2) hana.push_back(i+1);
	

	rep(i,n){
		cin >> m;
		taro.push_back(m);
		hana.erase(remove(hana.begin(), hana.end(), m), hana.end());
	}
	//rep(i,n) cout << taro[i] << "\n";
	//rep(i,n) cout << hana[i] << "\n";

	res = game(taro,hana,n);

	rep(i,2) cout << res[i] << "\n";
	
	}
	return 0;
}

Measured memory_bytes: 1220
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
#include <chrono>
#include "atcoder/all"
using namespace std;
using namespace atcoder;
#define     loop(n,i,a)     for(ll i=a;i<n;i++)
#define     loopR(n,i,a)    for(ll i=a-1;i>=n;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pii>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
template<typename T>void max_self(T &a,T b){a=max(a,b);}
template<typename T>void min_self(T &a,T b){a=min(a,b);}
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightI[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightJ[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=3e5+10,oo=0x3f3f3f3f,MOD=998244353;
const long double PI = acos(-1),eps=1.0e-14;

void solve(){
    int t;
    cin>>t;
    while(t--){
       ll n,m,a,b;
       cin>>n>>m>>a>>b;
       cout<<floor_sum(n,m,a,b)<<Endl;
    }
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();

}


Measured memory_bytes: 3568
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
	int n,k,ans=0;
	string s;
	cin>>n;
	while(n){
	    if(n%10==7)ans=1;
	    n/=10;
	}
	if(ans)cout<<"Yes";
	else cout<<"No";
	return 0;
}


Measured memory_bytes: 3588
import math
N,M=map(float,input().split())


a=math.factorial(N)*math.factorial(M)
if abs(N-M)>1:
    print(0)
elif N>M or M>N:
    print(int(a%(1000000000+7)))
elif M==N:
    print(int(a*2%(1000000000+7)))
    


Measured memory_bytes: 5176
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>
#include <locale>
#include <random>
#include <type_traits>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

using LL = long long;

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

int main() {

    int N;
    cin >> N;

    string S;
    cin >> S;

    int cnt = 0;

    for (int i = 0, j = 0; j < N; i = j) {
        while (j < N && S[i] == S[j]) {
            j++;
        }
        cnt++;
    }

    cout << cnt << endl;

    return 0;
}





















































Measured memory_bytes: 512
#include <stdio.h>
 
int main()
{
int A,B;
scanf("%d\n%d",&A,&B);
if(A==1&&B==2){ printf("3\n");}
else if(A==2&&B==1){ printf("3\n");}
else if(A==2&&B==3){ printf("1\n");}
else if(A==3&&B==2){ printf("1\n");}
else if(A==1&&B==3){ printf("2\n");}
else if(A==3&&B==1){ printf("2\n");}
return 0;
}

Measured memory_bytes: 1624
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>

using namespace std;
using ll = long long;

#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (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;}
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
/*----------------------------------------------------------------------------------*/


int main() {
    int n; cin >> n;
    using P = pair<int, int>;
    vector<P> x(n);
    // rep(i,n) {
    //     int a, b; cin >> a >> b;
    //     x[i] = P(a, b);
    // }
    // sort(x.begin(), x.end());
    rep(i,n) {
        int a, b; cin >> a >> b;
        x[i] = P(a+b, a-b);
    }
    sort(x.begin(), x.end());

    // vector<int> s(100010);
    // rep(i,n) {
    //     s[x[i]-l[i]]++;
    //     s[x[i]+l[i]+1]--;
    // }
    int ans = 1;
    int pos = x[0].first;
    for (int i = 1; i < n; i++) {
        if (x[i].second < pos) {
            // cout << i << endl;
            continue;
        }
        ans++;
        pos = x[i].first;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
import java.util.Stack

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map(String::toInt)
    val weights = readLine()!!.split(" ").map(String::toLong)
    val mutableGraph = Array(n, { mutableListOf<Int>() })
    for (i in 0 until m) {
        val (x, y) = readLine()!!.split(" ").map(String::toInt)
        mutableGraph[x].add(y)
        mutableGraph[y].add(x)
    }
    val graph = mutableGraph.map { it.toList() }
    val cc = getCC(graph)
    // println(cc)

    val numCC = cc.max()!! + 1
    if (n < 2 * numCC - 2) {
        println("Impossible")
        return
    }
    if (numCC == 1) {
        println(0)
        return
    }

    val mutableCCIdToWeights = Array(numCC, { mutableListOf<Long>() })
    for (v in 0 until n) {
        mutableCCIdToWeights[cc[v]].add(weights[v])
    }
    mutableCCIdToWeights.forEach { it.sort() }

    var total = 0L
    val remainings = mutableListOf<Long>()
    for (ccWeights in mutableCCIdToWeights) {
        total += ccWeights[0]
        remainings.addAll(ccWeights.subList(1, ccWeights.size))
    }
    remainings.sort()
    total += remainings.subList(0, numCC - 2).sum()
    println(total)
}

fun getCC(graph: List<List<Int>>): List<Int> {
    val n = graph.size
    val cc = IntArray(n, { -1 })

    var currentId = 0
    for (k in 0 until n) {
        if (cc[k] >= 0) continue
        cc[k] = currentId
        val stack = Stack<Int>()
        stack.push(k)
        while (stack.isNotEmpty()) {
            val v = stack.pop()
            for (w in graph[v]) {
                if (cc[w] < 0) {
                    cc[w] = currentId
                    stack.push(w)
                }
            }
        }
        currentId++
    }
    return cc.asList()
}

Measured memory_bytes: 103724
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll; 
typedef long double ld;
typedef pair<ll, ll> pll;

const ll N = 2e5 + 30, Mod = 1e9 + 7;
const ll SQ = 330;

int main () {
    ios::sync_with_stdio(0), cin.tie(0);
    ll a, b, c;
    cin >> a >> b >> c;
    swap(a, b);
    swap(a, c);
    cout << a << ' ' << b << ' ' << c;
    return (0);
}

Measured memory_bytes: 256
def solve():
    n, m = map(int, input().split())
    f = [0] * (m+1)
    for _ in range(n):
        k, *a = map(int, input().split())
        for i in a:
            f[i] += 1
    print(f.count(n))


if __name__ == '__main__':
    solve()


Measured memory_bytes: 9036
import collections
def get_ans(strings, n):
    ans = 0
    for i in range(n):
        counter = collections.defaultdict(int)
        for k in strings:
            counter[k[i]] += 1
        ans += len(strings) - max(counter.values())
    return ans

if __name__ == '__main__':
    n = int(input())
    strings = []
    for _ in range(3):
        strings.append(input())
    print(get_ans(strings, n))


Measured memory_bytes: 3316
package main

import (
    "fmt"
    "os"
    "bufio"
    "strconv"
    // "sort"
)
var sc = bufio.NewScanner(os.Stdin)


func main() {
    sc.Split(bufio.ScanWords)
    // code goes here
    n := nextInt()
    for n/100 != (n/10)%10 || n/100 != n%10 {
        n += 1
    }
    fmt.Println(n)
}



func nextInt() int {
    sc.Scan()
    v, e := strconv.Atoi(sc.Text())
    if e != nil { panic(e) }
    return v
}
func nextInt64() int64 {
    sc.Scan()
    v, e := strconv.ParseInt(sc.Text(), 10, 64)
    if e != nil { panic(e) }
    return v
}
func nextString() string {
    sc.Scan()
    return sc.Text()
}
func nextFloat() float64 {
    sc.Scan()
    v, e := strconv.ParseFloat(sc.Text(), 64)
    if e != nil { panic(e) }
    return v
}
func Max(x, y int) int { if x > y { return x }; return y }
func Min(x, y int) int { if x < y { return x }; return y }
func Abs(x int) int { if x > 0 { return x }; return -x }



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

public class Main {
	static long digits(long n) {
		long sum = 0; 
		while(n != 0) {
			sum += n%10;
			n /= 10; 
			 
		}
		return sum ; 
	}
	public static void main(String[] args) throws IOException {
		InputReader in = new InputReader(System.in);
		long n = in.readLong();  
		long sum = digits(n);
		System.out.println(n % sum == 0 ? "Yes":"No"); 
	}
}
class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public long readLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9') {
				throw new InputMismatchException();
			}
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	
	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public String next() {
		return readString();
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}


Measured memory_bytes: 21204
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int main() {

	int a, b;
	cin >> a >> b;

	if (a <= 5)
		cout << 0;
	else if (a <= 12)
		cout << b / 2;
	else
		cout << b;

	cout << endl;


	return 0;
}


Measured memory_bytes: 256
N = int(input());
A = list(map(int,input().split()))

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in a:
        x = (x * i) // gcd(x, i)
    return x

l = lcm(A)
ans = 0
for i in A:
	ans += l//i

MOD = 10**9+7
print(ans%MOD)

Measured memory_bytes: 5616
#include <iostream>
#include <vector>

struct Freq {
	Freq():vector(10, 0) {};
	Freq operator+(const int &i) const {
		Freq res(*this);
		++res.vector.at(i);
		return res;
	}
	Freq &operator+=(const int &i) {
		++vector.at(i);
		return (*this);
	}
	bool operator&(const int &i) const {
		return (vector.at(i) > 1);
	}
	std::vector<char> vector;
};
static const std::vector<std::pair<int, int>> square{ std::make_pair<int, int>(0, 0), std::make_pair<int, int>(1, 0), std::make_pair<int, int>(2, 0), std::make_pair<int, int>(0, 1), std::make_pair<int, int>(1, 1), std::make_pair<int, int>(2, 1), std::make_pair<int, int>(0, 2), std::make_pair<int, int>(1, 2), std::make_pair<int, int>(2, 2) };
std::vector<std::vector<char>> check(const std::vector<std::vector<int>> &map) {
	std::vector<Freq> row(9), clum(9), sq(9);
	for (auto i = 0; i < 9; ++i) {
		int sx{ (i / 3) * 3 }, sy{ (i % 3) * 3 };
		for (auto j = 0; j < 9; ++j) {
			row.at(i) += map.at(j).at(i);
			clum.at(i) += map.at(i).at(j);
			sq.at(i) += map.at(sy + square.at(j).second).at(sx + square.at(j).first);
		}
	}
	std::vector<std::vector<char>> res(9, std::vector<char>(9, ' '));
	for (auto x = 0; x < 9; ++x) {
		for (auto y = 0; y < 9; ++y) {
			if ((row.at(x) & map.at(y).at(x)) || (clum.at(y) & map.at(y).at(x)) || (sq.at((x / 3) * 3 + (y / 3)) & map.at(y).at(x))) {
				res.at(y).at(x) = '*';
			}
		}
	}
	return res;
}
int main() {
	int n;
	std::cin >> n;
	for (auto i = 0; i < n; ++i) {
		if (i != 0) {
			std::cout << std::endl;
		}
		std::vector<std::vector<int>> map(9, std::vector<int>(9));
		for (auto &clum : map) {
			for (auto &cell : clum) {
				std::cin >> cell;
			}
		}
		auto res = check(map);
		for (auto y = 0; y < 9; ++y) {
			for (auto x = 0; x < 9; ++x) {
				std::cout << res.at(y).at(x) << map.at(y).at(x);
			}
			std::cout << '\n';
		}
	}
}

Measured memory_bytes: 3128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine() ?? throw new InvalidOperationException());
            var result = n % 1000;
            if (result == 0)
            {
                result = 1000;
            }
            Console.WriteLine(1000-result);
            
        }
    }
}


Measured memory_bytes: 27352
#include<bits/stdc++.h>
using namespace std;
#define ms(x,y) memset(x, y, sizeof(x))
#define lowbit(x) ((x)&(-x))
#define sqr(x) ((x)*(x))
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;


void run_case() {
    int n, d, a;
    cin >> n >> d >> a;
    vector<pii> m(n);
    for(auto &x: m) cin >> x.first >> x.second;
    sort(m.begin(), m.end());
    vector<LL> c(n+1);
    LL ans = 0;
    for(int i = 0, j = 0; i < n; ++i) {
        while(j < n && m[j].first <= m[i].first + 2*d) j++;
        LL need = max((m[i].second - c[i]*a+a-1) / a, 0LL);
        c[i] += need;
        c[j] -= need;
        c[i+1] += c[i];
        ans += need;
    }
    cout << ans;
}


int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    cout.flags(ios::fixed);cout.precision(9);
    //int t; cin >> t;
    //while(t--)
    run_case();
    cout.flush();
    return 0;
}


Measured memory_bytes: 3328
#include<iostream>
using namespace std;
int main()
{
	int num[4]={1,7,9,4};
	int inin[4];
	for(int i=0;i<4;i++)
	{
		cin>>inin[i];
		for(int k=0;k<4;k++)
		{
			if(inin[i]==num[k])
			{
				num[k]=11;
				break;
			}
		}
	}
	int eval=0;
	for(int i=0;i<4;i++)
	{
		if(num[i]==11){
			eval++;
		}else{
		}
	}
	if(eval==4){
		cout<<"YES";
	}else{
		cout<<"NO";
	}

}

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

string reversed(string s){
  string ss = s;
  reverse(ss.begin(), ss.end());
  return ss;
}

int main() {
  string s;
  cin >> s;
  string s1 = s.substr(0, (s.size() - 1) / 2);
  string s2 = s.substr((s.size() + 3) / 2 - 1);
  bool flag = false;

  if(reversed(s) == s) {
    if(reversed(s1) == s1) {
      if(reversed(s2) == s2) flag = true;
    }
  }

  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  
}



Measured memory_bytes: 256
/**
 *   author: master3214
 *   created: Sep-15-2020
**/

#include <bits/stdc++.h>

using namespace std;

int main(){
	long long a,b,c,d;
	cin >> a >> b >> c >> d;
	long long x = max(a*c, a*d);
	long long  y = max(b*c, b*d);
	cout << max(x,y);
}


Measured memory_bytes: 3644
n = gets.to_i
p = gets.chomp.split.map(&:to_i)
q = gets.chomp.split.map(&:to_i)
h = []
for i in 1..n
  h << i
end
s = h.permutation(n).to_a
puts (s.find_index(p) - s.find_index(q)).abs


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

#define int long long
//#define uint __int128_t

#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define low(a,b) lower_bound(all(a),(b))-(a).begin()
#define upp(a,b) upper_bound(all(a),(b))-(a).begin()
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<vint> vvint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;

int N;
int H,W;

signed main() {
    IOS();
    //(1ll<<N)シフト演算のオーバーフローに気をつける
    //MOD同士の引き算に注意
    cin>>N>>H>>W;
    cout<<(N-H+1)*(N-W+1)<<endl;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

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

#define rep(i, n) for(int i = 0; i < n;i++)

int main()
{
  int N, M;
  cin >> N >> M;
  int keta[N];
  if(M == 0)
  {
    if(N == 1)
    {
      cout << 0 << endl;
      return 0;
    }
    else
    {
      cout << 1;
    }
    rep(i, N-1)
    {
      cout << 0;
    }
    cout << endl;
    return 0;
  }
  rep(i, N)
  {
    keta[i] = -1;
  }
  vector<pair<int, int>> sc(M);
  rep(i, M)
  {
    int s, c;
    cin >> s >> c;
    sc.at(i) = make_pair(s, c);
  }
  sort(sc.begin(), sc.end());

  rep(i, M)
  {
    int s = sc.at(i).first;
    int c = sc.at(i).second;
    if(keta[s - 1] != -1 && keta[s - 1] != c)
    {
      cout << -1 << endl;
      return 0;
    }
    else
    {
      keta[s - 1] = c;
    }
  }

  if(keta[0] == 0)
  {
    if(N == 1)
    {
      cout << 0 << endl;
    }
    else
    {
      cout << -1 << endl;
    }
    return 0;
  }
  else if(keta[0] == -1)
  {
    if(N == 1)
    {
      cout << 0 << endl;
      return 0;
    }
    else
    {
      keta[0] = 1;
    }
  }

  cout << keta[0];
  for (int i = 1; i < N;i++)
  {
    if(keta[i] == -1)
    {
      keta[i] = 0;
    }
    cout << keta[i];
  }
  cout << endl;
}

Measured memory_bytes: 256
a,b,k = map(int, input().split())
limit = a+k
if a+k >= b:
    limit = b + 1
f = list(range(a,limit))
limit = b-k
if b-k <= a:
    limit = b -1
l = list(range(b,limit,-1))
ll = f+l
ll.sort()
li_uniq = []
for i in ll:
    if i not in li_uniq:
        li_uniq.append(i)
        print(i)


Measured memory_bytes: 3064
import std.stdio;

void main() {
    int l, r, d;
    readf("%d %d %d\n", &l, &r, &d);
    int ans = 0;
    for(int i = l; i <= r; i++)
        if(i%d == 0)
            ans += 1;
    ans.writeln;
}


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

#define rep(i,a,b)                for(ll i=a;i<b;i++)
#define re(i,b)                for(ll i=0;i<b;i++)
#define repr(i,n)                for(ll i=n-1;i>=0;i--)
#define ll long long
#define ld long double
#define pll std::pair<ll, ll> 
#define ppll std::pair<ll, pll>
#define vll std::vector<ll> 
#define vpll std::vector<pll> 
#define vppll std::vector<ppll> 
#define mll std::unordered_map<ll, ll> 
#define mpll std::unordered_map<pll, ll>
#define mppll std::unordered_map<ppll, ll>
#define sll std::set<ll>
#define ff first
#define ss second
#define msll std::multiset<ll>
#define all(c) c.begin(), c.end()
#define allr(c) c.rbegin(), c.rend()
#define srt(x) sort(all(x))
#define rsrt(x) sort(allr(x))
#define eb emplace_back
#define pb push_back
#define s(yy) ll yy;cin>>yy
#define len length()
#define sz size()
const ll mod = 1e9 + 7;
const ll INF = 0x7FFFFFFFFFFFFFFF>>1;

/*#################################################### 
#                                                    #
#                     @author                        #
#                  Parth Lathiya                     #
#      https://www.cse.iitb.ac.in/~parthiitb/        #
#                                                    #
####################################################*/

ll fun(ll a,ll b,ll c)
{
	if(c&1)
		return a-b;
	return a+b;
}

int main()
{

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	#ifdef PARTH_LATHIYA_HOME

		freopen("C_in.txt","r",stdin);
	
		ll ttt,bkkk;
		cin>>ttt;
		bkkk=ttt;
		while(ttt--) {
			cout<<"Testcase - "<<bkkk-ttt<<"\n";
	#endif

//--------------------------------------------------------------------------------------
	s(n);
	int a, b,c,d;
	d=n%10;
	c=(n/10)%10;
	b=(n/100)%10;
	a=(n/1000)%10;
	
	re(i,2)
		re(j,2)
			re(k,2)
				if(fun(fun(fun(a,b,i),c,j),d,k)==7){
					char aa=(i==0)?'+':'-';
					char bb=(j==0)?'+':'-';
					char cc=(k==0)?'+':'-';
					cout<<a<<aa<<b<<bb<<c<<cc<<d<<"=7";
					return 0;
				}

//--------------------------------------------------------------------------------------
	
	#ifdef PARTH_LATHIYA_HOME
		cout<<"\n"; }
	#endif

	return 0;
}

Measured memory_bytes: 256
s=input()
l=len(s)
cnt=s[0]
ans=l
i=1
while i<l:
  if i==l-1 and cnt==s[i]:
    ans-=1
    break
  if cnt==s[i]:
    ans-=1
    cnt=s[i:i+2]
    i+=2
    continue
  cnt=s[i]
  i+=1
print(ans)

Measured memory_bytes: 41180
#include<bits/stdc++.h>
using namespace std;
#define int long long
bool func(int a){
	int s=0;
	while(a!=0){
		s+=a%10;
		a/=10;
	}
	if(s==10)
	return true;
	return false;
}
int32_t main()
{
   int a,b,c;
   cin>>a>>b>>c;
   int tp=max(a,b);
   c+=tp-1;
   cout<<c/tp;
   return 0;
}


Measured memory_bytes: 256