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

long long table[1001][1001];

int main(){
	int r,c,a1,a2,b1,b2;
	cin >> r >> c >> a1 >> a2 >> b1 >> b2;
	
	long long times = 1;	
	int al = abs(a1-b1);
	if(al == r-al) times *= 2;
	al = min(al,r-al);
	int bl = abs(a2-b2);
	if(bl == c-bl) times *= 2;
	bl = min(bl,c-bl);

	for(int i = 0; i <= al; i++){
		table[i][0] = 1;
	}
	for(int i = 0; i <= bl; i++){
		table[0][i] = 1;
	}
	for(int i = 1; i <= al; i++){
		for(int j = 1; j <= bl; j++){
			table[i][j] = (table[i-1][j] + table[i][j-1]) % 100000007;
		}
	}
//	cout << al << " " << bl << " " << times << endl;
	cout << ((table[al][bl] * times) % 100000007) << endl;

	return 0;
}



Measured memory_bytes: 7000
import java.util.*;
public class Main {
    public static void main(String[] args ) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        if (s[2] == s[3] && s[4] == s[5]) {
            System.out.println("Yes");
        }
        else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 23124
#include <algorithm>
#include <iostream>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

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

    string s;
    cin >> s;

    int maxi = 0;
    int count = 0;
    REP(i, s.size()) {
        if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
            count++;
        else
            count = 0;
        maxi = max(maxi, count);
    }

    cout << maxi << '\n';
    return 0;
}

Measured memory_bytes: 256
Imports System.Collections.Generic
Imports System.Console

Module Program
    ReadOnly dic As New Dictionary(Of String, Integer)

    Sub Main()
        Dim N As Integer = NextInt()
        Dim D As Integer = NextInt()
        Dim X As Integer = NextInt()

        For i As Integer = 0 To N - 1
            Dim A As Integer = NextInt()
            X += 1 + (D - 1) \ A
        Next

        WriteLine(X)
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module


Measured memory_bytes: 22224
#include <stdio.h>
int main()
{
    int n,i,point=0;
    scanf("%d",&n);
    int A[n+1], B[n+1];
    int C[n];
    for(i=1;i<=n;i++)scanf("%d",&A[i]);
    for(i=1;i<=n;i++)scanf("%d",&B[i]);
    for(i=1;i<n;i++) scanf("%d",&C[i]);
    point=B[A[1]];
    for(i=2;i<=n;i++)
    {
        point+=B[A[i]];
        if(A[i]-A[i-1]==1)point+=C[A[i-1]];
    }
    printf("%d",point);
    return 0;
}

Measured memory_bytes: 128
/*
    Author: Alam Khan
    AUST CSE 40th Batch

*/

#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef deque<ll> dl;
typedef stack<ll> stl;
typedef set<ll> sl;
typedef map<string, ll> msl;
typedef map<ll,ll> mll;
typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
#define sf(n)     scanf("%lld",&n)
#define sff(n,m)     scanf("%lld %lld",&n,&m)
#define sfff(n,m,r)     scanf("%lld %lld %lld",&n,&m,&r)
#define sfs(n)     scanf("%s",n)
#define pf(n)     printf("%lld\n",n)
#define pff(n,m)     printf("%lld %lld\n",n,m)
#define pfff(n,m,r)     printf("%lld %lld %lld\n",n,m,r)
#define pfs(n)     printf("%s\n",n)
#define pfcs(i,n)     printf("Case %lld: %lld\n",i,n)
#define pb     push_back
#define prf     printf
#define inf     2e18
#define low     -1000000000000
#define PI        acos(-1.0)
#define rep1(i,n) for(i=1;i<n;i++)
#define rep0(i,n) for(i=0;i<n;i++)
#define rep(i,a,n) for(i=a;i<n;i++)
#define repe1(i,n) for(i=1;i<=n;i++)
#define repe0(i,n) for(i=0;i<=n;i++)
#define repe(i,a,n) for(i=a;i<=n;i++)
#define endl  "\n"
#define FAST  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr freopen("input.txt","r",stdin)
#define fw freopen("output.txt","w",stdout)
map<ll,ll> ma;
map<ll,ll> :: iterator it;
void fact(ll n)
{
    ma[1]++;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            ma[i]++;
            while(n%i==0)
            {
                n = n/i;
            }
        }
    }
    if(n>1)
        ma[n]++;
}
int main()
{
    ll i,n,t,k,j,x=0,y=0,m;
    FAST
    cin>>n>>m;
    fact(n);
    fact(m);
    for(it=ma.begin();it!=ma.end();it++)
    {
        if(it->second==2)
            x++;
    }
    cout<<x<<endl;
    return 0;
}



Measured memory_bytes: 3592
#include <sys/time.h>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <utility>
#include <cctype>

using namespace std;

using ll = long long;
using P = pair<double, double>;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)

const double time_limit = 1.9;
double start;

unsigned rando() {
	static unsigned y = 2463534242;
    y ^= y << 13;y ^= y >> 17;y ^= y << 5;
    return y;
}


double sec() {
	struct timeval tv;
    gettimeofday(&tv, NULL);
    return tv.tv_sec + tv.tv_usec * 1e-6;
}

double pastTime() {
	return sec() - start;
}

int d;

int c[26];
int s[365][26];

int score(vector<int>& t) {
	int score = 0;
	vector<int> last(26,0);
	rep(i, d) {
		score += s[i][t[i]];
		last[t[i]] = (i + 1);

		rep(j,26) {
			score -= ((i + 1) - last[j]) * c[j];
		}
		//cout  << score << endl;

	} 


	return score;

}

void output(vector<int>& t) {
	rep(i, d) {
		cout << t[i] + 1 << endl;
	}
}


int main() {
	


	cin >> d;
	rep(i, 26) {
		cin >> c[i];
	} 
	rep(i, d) {
		rep(j,26) {
			cin >> s[i][j];
		}
	}
	start = sec();
	vector<int> t(d);

	rep(i, d) {
		t[i] = rando() % 26;
	}

	int cur = score(t);


	while(true) {
		double cur_time = pastTime();
		if (cur_time > time_limit) {
			break;
		}
		//vector<int> nt = t;

		for (int loop = 0; loop < 100; loop++) {
			stack<P> cd;


			//int size = (int) (cur_time / time_limit * 5.0) + 1;
			int size = 2;
			rep(i ,size) {
				int cur_d = rando() % d;
				int cur_c = rando() % 26;
				cd.push(mkp(cur_d, t[cur_d]));

				t[cur_d] = cur_c;
			}
			int next = score(t);
			if (cur < next) {
				//t = nt;
				cur = next;
			} else {
				while(!cd.empty()) {
					auto cur = cd.top();
					t[cur.first] = cur.second;
					cd.pop();
				}

			}
		}
	}

	output(t);

	//cout << "score:" <<  << endl;

	return 0;
}


Measured memory_bytes: 3200
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int llint;
int main(){
	int a, b;
	cin >> a >> b;
	if (a == 1){
		a = 14;
	}
	if (b == 1){
		b = 14;
	}
	if (a < b){
		cout << "Bob" << endl;
	}
	if (a == b){
		cout << "Draw" << endl;
	}
	if (a>b){
		cout << "Alice" << endl;
	}
	return 0;
}

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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

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

int N;
vec<int> prime;

void init() {
   for (int i = 2; i <= 55555; i++) {
      int ok = true;
      for (int j = 2; j*j < i; j++) {
         if (i % j == 0) {
            ok = false;
            break;
         }
      }
      if (ok) {
         prime.push_back(i);
      }
   }
}

signed main() {
   cin >> N;
   init();

   vec<int> ans;

   rep (i, prime.size()) {
      if (to_string(prime[i]).back() == '3') {
         ans.push_back(prime[i]);
      }
      if (ans.size() >= N) break;
   }

   rep (i, ans.size()-1) {
      cout << ans[i] << " ";
   }
   cout << ans.back() << endl;

   return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const array<pair<int,int>,4> fd{make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 


int main(){
  int sx,sy,tx,ty;cin>>sx>>sy>>tx>>ty;
  rep(i,ty-sy){
    cout << 'U';
  }
  rep(i,tx-sx){
    cout << 'R';
  }
  rep(i,ty-sy){
    cout << 'D';
  }
  rep(i,tx-sx){
    cout << 'L';
  }
  cout << 'L';
  rep(i,ty-sy+1){
    cout << 'U';
  }
  rep(i,tx-sx+1){
    cout << 'R';
  }
  cout << 'D';
  cout << 'R';
  rep(i,ty-sy+1){
    cout << 'D';
  }
  rep(i,tx-sx+1){
    cout << 'L';
  }
  cout << 'U' << endl;
}


Measured memory_bytes: 256
a = int(input())
b = list(map(int,input().split()))
c = [1]
j = 0
su = 0
for i in range(1,a):
	if b[i] == b[i-1]:
		c[j] += 1
	else:
		c.append(1)
		j += 1

for i in c:
	su += i //2

print(su)


Measured memory_bytes: 38384
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

func main() {
	N, X, M := ReadInt(), ReadInt(), ReadInt()
	K := 1 + int(math.Log2(float64(N)))
	next := make([][]int, K)
	nextSum := make([][]int, K)
	for k := 0; k < K; k++ {
		next[k] = make([]int, M)
		nextSum[k] = make([]int, M)
	}
	for i := 1; i < M; i++ {
		next[0][i] = i * i % M
		nextSum[0][i] = i
	}
	for k := 0; k < K-1; k++ {
		for i := 0; i < M; i++ {
			next[k+1][i] = next[k][next[k][i]]
			nextSum[k+1][i] = nextSum[k][i] + nextSum[k][next[k][i]]
		}
	}
	ans := 0
	now := X
	for k := 0; k < K; k++ {
		if N>>k&1 == 1 {
			ans += nextSum[k][now]
			now = next[k][now]
		}
	}
	fmt.Println(ans)
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) (a []int) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt())
	}
	return
}


Measured memory_bytes: 57092
#include<bits/stdc++.h>
using namespace std;
int k,i= -1;
vector<long long> vec = {};
void dfs(long long x,int a){
    vec.push_back(x);
    if(x > 100000000000) return;
    if(x == 0){
        for (int j = 1; j < 10; j++)
        {
            dfs(j,j);
        }
    }
    else{
        if(a != 0 && a!= 9){
            dfs(10*x + a-1,a-1);
            dfs(10*x + a,a);
            dfs(10*x + a+1,a+1);
        }
        if(a == 0) {
            dfs(10*x + 0,0);
            dfs(10*x + 1,1);
        }
        if(a == 9) {
            dfs(10*x + 8,8);
            dfs(10*x + 9,9);
        }
    }
}

int main(){
    cin >> k;
    dfs(0,0);
    sort(vec.begin(),vec.end());
    cout << vec[k] << endl;
}


Measured memory_bytes: 19728
(defun card-game-for-two (n a)
  (let ((alice 0)
        (bob 0))
    (setf a (sort a #'>))
    (dotimes (i n)
      (if (zerop (rem i 2))
          (setf alice (+ alice (aref a i)))
          (setf bob (+ bob (aref a i)))))
    (- alice bob)))

(defun create-data ()
  (let* ((n (read))
         (a (make-array `(,n))))
    (dotimes (i n)
      (setf (aref a i) (read)))
    (values n a)))

(multiple-value-bind (n a) (create-data)
  (format t "~A~%" (card-game-for-two n a)))

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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            Console.WriteLine(Math.Ceiling(N / 2.0));
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <cmath>
int GetCombination(int n)
{
    int Result = 0;
    for(int a = 0; a <= 9; ++a){
        for(int b = 0; b <= 9; ++b){
            for(int c = 0; c <= 9; ++c){
                for(int d = 0; d <= 9; ++d){
                    if(a+b+c+d == n) ++Result;
                }
            }
        }
    }
    return Result;
}

int main()
{
    while(true){
        int n;
        std::cin >> n;
        if(std::cin.eof()) break;
        std::cout << GetCombination(n) << std::endl;
    }
    return 0;
}

Measured memory_bytes: 3012
import math
a, b, h, m = list(map(int, input().split()))
theta = 2 * math.pi * ((h + m / 60) / 12 - m / 60)
if theta > math.pi:
    theta = 2 * math.pi - theta
print(math.sqrt((a ** 2) + (b ** 2) - 2 * a * b * math.cos(theta)))

Measured memory_bytes: 62464
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define mp make_pair
#define pb push_back
#define EB emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

double add(double a,double b){
    if(abs(a+b) < eps * (abs(a) + abs(b))) return 0;
    return a+b;
}

struct P{
    double x,y;
    P(){}
    P(double x,double y) : x(x),y(y){}
    P operator + (P p){
        return P(add(x,p.x),add(y,p.y));
    }
    P operator - (P p){
        return P(add(x,-p.x),add(y,-p.y));
    }
    P operator * (double d){
        return P(x*d,y*d);
    }
};

double dot(P a,P b){
    return add(a.x*b.x,a.y*b.y);
}

double cross(P a,P b){
    return add(a.x * b.y,-a.y * b.x);
}

P intersection(P p1,P p2,P q1,P q2){
    return p1 + (p2-p1) * (cross(q2-q1,q1-p1)/cross(q2-q1,p2-p1));
}

bool on_seg(P p1,P p2,P q){
    return cross(p1-q,p2-q) == 0 && dot(p1-q,p2-q) <= 0;
}

void solve(){
    int n;
    P s,t;
    cin >> s.x >> s.y >> t.x >> t.y;
    cin >> n;
    vector<P> p(n),q(n);
    vector<int> o(n),l(n);

    rep(i,n){
        cin >> p[i].x >> p[i].y >> q[i].x >> q[i].y >> o[i] >> l[i];
    }

    vector<pair<P,int>> c;
    for(int i=0;i<n;i++){
        // ???????????´???????¨?????????????
        if(cross(s-t,p[i]-q[i])==0) continue;

        P r = intersection(s,t,p[i],q[i]);
        if(!on_seg(p[i],q[i],r) || !on_seg(s,t,r)){     // ???????????????????????????
            continue;
        }

        if(o[i] == 0){
            if(l[i]==0) c.pb(make_pair(r,1));
            if(l[i]==1) c.pb(make_pair(r,0));
        }else{
            if(l[i]==0) c.pb(make_pair(r,0));
            if(l[i]==1) c.pb(make_pair(r,1));
        }
    }

    vector<pair<double,int>> cc;
    for(int i=0;i<sz(c);i++){
        cc.pb(make_pair(c[i].first.x,c[i].second));
    }
    sort(all(cc));

    int ans=0;
    for(int i=0;i<sz(cc)-1;i++){
        int cur = cc[i].second;
        int nxt = cc[i+1].second;
        if(cur!=nxt) ans++;
    }
    cout << ans << endl;
}

int main(){
    int t;
    cin >> t;
    rep(i,t){
        solve();
    }
}

Measured memory_bytes: 3188
S = input()
a = int(S[:2])
b = int(S[2:])
if (a > 12 or a < 1) and (b > 12 or b < 1):
    print('NA')
elif a > 12 or a < 1:
    print('YYMM')
elif b > 12 or b < 1:
    print('MMYY')
else:
    print('AMBIGUOUS')

Measured memory_bytes: 38384
// In The Name Of God
#include <bits/stdc++.h>

#define sqr(A) ((A) * (A))
#define F first
#define S second
#define MP make_pair
#define bsz  __builtin_popcount
#define all(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
const int MOD2 = 1e9 + 9;
const int PR = 727;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

int n, ans = INF;

int f(int x) {
	int res = 0;
	while (x) {
		res += x % 10;
		x /= 10;
	}
	return res;
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 1; i < n; i++)
		if (ans > f(i) + f(n - i))
			ans = f(i) + f(n - i);
	cout << ans << endl;
}



Measured memory_bytes: 256
if __name__ == "__main__":
    A, B, C, K = map(int, input().split())
    cnt = 0
    if K >= A:
        cnt += A * 1
        K -= A
        if K >= B:
            K -= B
            if K >= C:
                cnt += C * -1 
            else:
                cnt += K * -1
        else:
            K -= K
    else:
        cnt += K * 1
        K -= K        
    print(cnt)


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

constexpr long MAX_ANS = 7368800;
bool saku[MAX_ANS];

void solve(long m, long n) {
  for (int i = 0; i < MAX_ANS; i++) saku[i] = 0;
  long i = m - 1;
  while (1) {
    i++;
    if (saku[i]) {
      continue;
    }
    if (n == 0) {
      cout << i << endl;
      return;
    }
    for (int j = 1; j * i < MAX_ANS; j++) {
      saku[j * i] = 1;
    }
    n--;
  }
}

int main() {
  long m, n;
  while (1) {
    cin >> m >> n;
    if (m + n == 0) return 0;
    solve(m, n);
  }
}



Measured memory_bytes: 10212
#include<stdio.h>

int main(void){
 int A, B, C, D;
 scanf("%d %d %d %d", &A, &B, &C, &D);
 for(int i=0; i < 100; i++){
   C -= B;
   if(C <= 0){
     printf("Yes\n");
     return(0);
   }
   A -= D;
   if(A <= 0){
     printf("No\n");
     return(0);
   }
 }

}

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

int main()
{
    string a;
  	string b;
  	string c;
  
  	cin >> a >> b >> c;
  
  	if(a[a.size() -1] == b[0] && b[b.size() -1] == c[0]){
    	cout << "YES" << endl;
    }else{
    	cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
// AOJ 2162: Galaxy Wide Web Service
// 2017.12.13 bal4u@uu

#include <stdio.h>
#include <string.h>

#define MAX1 55440
#define MAX2 96577

int a[MAX1+1], b[MAX2+1];
int p1, p2;
int q[25][25];
char f[25], chk[25];
char buf[205], *p;

int getint(void)
{
	int n = 0;
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	p++;
	return n;
}

int gcd(int a, int b)
{
	int r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

int lcm(int a, int b)
{
	return a/gcd(a, b)*b;
}

int main()
{
	int n, i, j, jj, k, d, t, ans1, ans2;

	chk[13] = chk[17] = chk[19] = chk[23] = 1;

	while (fgets(p=buf, 10, stdin) && *p != '0') {
		n = getint();

		memset(q, 0, sizeof(q));
		memset(f, 1, sizeof(f));

		for (i = 0; i < n; i++) {
			fgets(p=buf, 205, stdin);
			d = getint(), t = getint(); f[d] = 0;
			jj = 0; if (t > 0) jj = d-t; 			
			j = d; while (j--) {
				q[d][jj] += getint();
				if (++jj == d) jj = 0;
			}
		}

		p1 = p2 = 1;
		for (d = 1; d <= 24; d++) {
			if (f[d]) continue;
			if (chk[d]) p2 *= d;
			else p1 = lcm(p1, d);
		}

		memset(a, 0, sizeof(int)*p1);
		memset(b, 0, sizeof(int)*p2);

		for (d = 1; d <= 24; d++) {
			if (f[d]) continue;
			if (chk[d]) {
				for (i = 0; i < d; i++) {
					k = q[d][i];
					for (j = i; j < p2; j += d) b[j] += k;
				}
			} else {
				for (i = 0; i < d; i++) {
					k = q[d][i];
					for (j = i; j < p1; j += d) a[j] += k;
				}
			}
		}

		ans1 = 0; for (i = 0; i < p1; i++) if (a[i] > ans1) ans1 = a[i];
		ans2 = 0; for (i = 0; i < p2; i++) if (b[i] > ans2) ans2 = b[i];
		printf("%d\n", ans1+ans2);
	}
	return 0;
}

Measured memory_bytes: 2288
n, k = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse=True, key=lambda x:abs(x))
cnt = 0
im = -1
ip = -1
cp = 0
mod = 10 ** 9 + 7
nm = 0
np = 0

for i, ai in enumerate(a):
    if i < k:
        if ai < 0:
            im = i
            cnt += 1
        if ai > 0:
            ip = i
    else:
        if ai < 0 and nm == 0:
            nm = ai
        if ai > 0 and np == 0:
            np = ai
    if ai > 0:
        cp += 1

ans = 1
f = 0

# print(a)
if cnt % 2 and k < n:
    if cp == 0:
        a.sort(reverse=True)
        for i, ai in enumerate(a):
            if i == k:
                break
            ans *= ai
            ans %= mod
        print(ans) # ok
    else:
        cnt = 0
        f1 = 0
        f2 = 0
        for i, ai in enumerate(a):
            if f1 + f2 + cnt == k:
                break 
            if i == im:
                f1 = 1
                continue
            if i == ip:
                f2 = 1
                continue
            if f1 and ai <= 0:
                continue
            if f2 and ai >= 0:
                continue
            ans *= ai
            ans %= mod
            cnt += 1
        if ip == -1:
            ans *= np
        else:
            ans *= max(a[ip] * np, a[im] * nm)
        ans %= mod
        print(ans) # ng
        # - + - - / + -
else:
    for i, ai in enumerate(a):
        if i == k:
            break
        ans *= ai
        ans %= mod
    print(ans) # ok



Measured memory_bytes: 105284
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define BUFSIZE 10000000
typedef long long ll;
#define WDSIZE 10000
#define man 10000
#define gosen 5000
#define sen 1000


int a,b,rem;
int N,Y;


int mai_give_first(int sum,int frag){
  a = sum - frag;
  b = sum - a;
  return 0;
}





int cal(int man_mai ,int gosen_mai, int sen_mai){
  if(man_mai < 0 || gosen_mai < 0 || sen_mai < 0){
      return 0;
  }
  if(man*man_mai + gosen*gosen_mai + sen*sen_mai == Y){
    printf("%d %d %d",man_mai,gosen_mai,sen_mai);
    exit(0);
  }
  return 0;
}




int main(void){
  scanf("%d %d",&N,&Y);
for(int j = 0;j <= N;j++){
  for(int i = 0;i <= N;i++){
    mai_give_first(N,j);
    rem = a;
    mai_give_first(b,i);
    cal(rem,a,b);
    }
  }

  printf("-1 -1 -1");

  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "Yes" << endl;
#define POK cout << "OK" << endl;
#define PNO cout << "No" << endl;
#define PNG cout << "NG" << endl;

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

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;
}

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
//  ba;
signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  ll n, k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  sort(ALL(a));
  if (k >= n) {
    cout << 0 << endl;
    return 0;
  }
  cout << accumulate(a.begin(), a.end() - k, 0LL) << endl;
  return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long 
#define mod 1000000007
#define endl "\n"
#define pb push_back
#define mp make_pair
 
vector<int> a[500005] ;
ll v[500005]={0};
ll dp[500005]={0};
int n,ans=0;
int cou[500005]={0};
void dfs(int x)
{
	v[x]=ans;
	cou[ans]++;
	for(int i=0;i<a[x].size();i++)
	{
		if(v[a[x][i]]==0)
		{
			dfs(a[x][i]);
			
		}
		//cou[a[x][i]]=cou[ans];
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  int n;
  cin>>n;
  int h[n];
  for(int i=0;i<n;i++)
  {
    cin>>h[i];
  }
  dp[0]=0;
  dp[1]=abs(h[1]-h[0]);
  for(int i=2;i<n;i++)
  {
    dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
  }
  cout<<dp[n-1];
  return 0;
}

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

const int mx = 2005;
int lft[mx][mx] , rght[mx][mx] , up[mx][mx] , dwn[mx][mx];

int main(){
   int n , w;
   cin >> n >> w;
   char arr[n+5][w+5];
   
   for(int i = 1; i <= n; i++){
      for(int j = 1; j <= w; j++){
         cin >> arr[i][j];
      }
   }
   
   for(int i = 1; i <= n; i++){
      int cnt = 0;
       for(int j = 1; j <= w; j++){
          cnt++;
          if(arr[i][j]=='#'){
              cnt = 0;
          }
          lft[i][j] = cnt;
       }
   }
   for(int i = 1; i <= n; i++){
      int cnt = 0;
       for(int j = w; j >= 1; j--){
          cnt++;
          if(arr[i][j]=='#'){
              cnt = 0;
          }
          rght[i][j] = cnt;
       }
   }
   
   for(int j = 1; j <= w; j++){
	 int cnt = 0;
       for(int i = 1; i <= n; i++){
         cnt++;
          if(arr[i][j]=='#'){
              cnt = 0;
          }
          up[i][j] = cnt;
       }
   }

   for(int j = 1; j <= w; j++){
	   int cnt = 0;
       for(int i = n; i >= 1; i--){
          cnt++;
          if(arr[i][j]=='#'){
              cnt = 0;
          }
          dwn[i][j] = cnt;
       }
   }

   int ans = 0;
   for(int i = 1; i <= n; i++){
      for(int j = 1; j <= w; j++){
           if(arr[i][j]!='#'){
	       int temp = up[i-1][j] + dwn[i+1][j] + rght[i][j+1] + lft[i][j-1] + 1;
	       ans = max(temp , ans);
	   }
      }
   }

   cout << ans << '\n';

}

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

using namespace std;

int main() {
	
	int n, sum=0;
	cin>>n;
	int nn=n;
	while (nn) {
		sum+=nn%10;
		nn/=10;
	}
	if (n%sum==0) {
		cout<<"Yes";
	}
	else cout<<"No";
	
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    bool p=false;
    while(n>0)
    {
        if(n%10==7)
        {
            p=true;
            break;
        }
        n/=10;
    }
    if(p)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    return 0;
}



Measured memory_bytes: 3636
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

X, Y = map(int, input().split())

if (X + Y) % 3 != 0:
    print(0)
    sys.exit()

N = (X + Y) // 3
M = X - N

if X < N or Y < N:
    print(0)
    sys.exit()

# C,Pを求める前処理
m = 10**6
mod = 10**9 + 7


fact = [0]*(m+5)
fact_inv = [0]*(m+5)
inv = [0]*(m+5)

fact[0] = fact[1] = 1
fact_inv[0] = fact_inv[1] = 1
inv[1] = 1

for i in range(2,m+5):
    fact[i] = fact[i-1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    fact_inv[i] = fact_inv[i-1] * inv[i] % mod

# nCkをmod（素数）で割った余りを求める．ただしn<10**7
# 前処理はm=n+5まで
def cmb(n,k,mod):
    return fact[n] * (fact_inv[k] * fact_inv[n-k] % mod) % mod

print(cmb(N,M,mod))



Measured memory_bytes: 101132
#include<iostream>
#include<string>
using namespace std;


int main(){
    string S;
    cin >> S;
    int cnt = 0;
    long long ans = 0;
    for(int i = 0; i < S.length(); i++){
        if(S[i] == 'W'){
            ans += (i - cnt);
            cnt++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
s = str(input())
number_list = []
count = 0
for number in s:
    number_list.append(number)
for i in range(3):
    if number_list[i] == number_list[i+1]:
        count += 1
    else:
        pass
if count == 0:
    print('Good')
else:
    print('Bad')


Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <deque>
#include <iomanip>
#include <cstdio>
#include <stack>

using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf  1000000007
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
ll a[401];
ll s[402];
ll dp[401][401];

int main(){
    int n;
    cin >> n;
    Fill(dp,1LL<<60);
    rep(i,n){
        cin >> a[i];
        dp[i][i] = 0;
    }
    rep(i,n){
        s[i+1] = s[i]+a[i];
    }
    for(int l=1;l<n;l++){
        rep(i,n-l){
            for(int k=i;k<i+l;k++){
                dp[i][i+l] = min(dp[i][k]+dp[k+1][i+l]+s[k+1]-s[i]+s[i+l+1]-s[k+1],dp[i][i+l]);
            }
        }
    }
    cout << dp[0][n-1] << endl;
    return 0;
}

Measured memory_bytes: 1536
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
long long a,b,n;
int main()
{
    scanf("%lld%lld%lld",&n,&a,&b);
    if(a*b<n||a+b-1>n){printf("-1\n");return 0;}
    while(n>0)
    {
        long long x=min(a,n-b+1);
        for(long long i=1;i<=x;i++)
        printf("%d ",n-x+i);
        n-=x;
        b--;
    }
}

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>  // Including tree_order_statistics_node_update

using namespace __gnu_pbds;
using namespace std;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define minei(x) min_element(x.begin(), x.end()) - (x).begin()
#define maxei(x) max_element(x.begin(), x.end()) - (x).begin()
#define LSOne(S) (S & (-S))

#define uns(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end())
#define acusum(x) accumulate(x.begin(), x.end(), 0)
#define acumul(x) accumulate(x.begin(), x.end(), 1, multiplies<int>());
#define bits(x) __builtin_popcount(x)
#define oo INT_MAX
#define inf 1000000000
#define MAXN 1000007
#define MOD 1000000007

const double pi = acos(-1.0);
const double eps = 1e-11;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

int main() {
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;
    if (a > b) swap(a, b);
    cout << ((a + v * t >= b + w * t) ? "YES" : "NO") << "\n";

    return 0;
}


Measured memory_bytes: 3652
fun main() {
    val mod = 1000000007L
    val (n, k) = readInts()
    val a = readInts().map { it.toLong() }
    val positives = a.filter { it > 0L }.sorted().reversed()
    val zeros = a.filter { it == 0L }
    var negatives = a.filter { it < 0L }.sorted()

    fun mapNumToMod(num: Long): Long {
        val times = kotlin.math.abs(num / mod) + 1
        return (times * mod + num) % mod
    }

    if (positives.isEmpty() && zeros.isEmpty()) {
        if (k % 2 == 1) negatives = negatives.reversed()
        val prod = negatives.subList(0, k).map {
            mapNumToMod(it)
        }.reduce { acc, num ->
            (acc * num) % mod
        }
        println(prod)
    } else if (positives.isEmpty() && k % 2 == 1) println(0)
    else if (n - zeros.size < k) println(0)
    else {
        negatives = negatives.map { kotlin.math.abs(it) }
        val combined = mutableListOf<Pair<Long, Boolean>>()
        var i = 0
        var j = 0
        while (combined.size < k) {
            if (i < positives.size && (j == negatives.size || positives[i] >= negatives[j])) {
                combined.add(Pair(positives[i], true))
                i++
            } else {
                combined.add(Pair(negatives[j], false))
                j++
            }
        }
        if (j % 2 == 1) {
            val lastNegative = combined.withIndex().last { (_, pair) -> !pair.second }
            if (i > 0 && j < negatives.size) {
                val lastPositive = combined.withIndex().last { (_, pair) -> pair.second }
                if (i == positives.size) combined[lastPositive.index] = Pair(negatives[j], false)
                else {
                    val posBenefit = positives[i] * lastPositive.value.first
                    val negBenefit = negatives[j] * lastNegative.value.first
                    if (posBenefit >= negBenefit) combined[lastNegative.index] = Pair(positives[i], true)
                    else combined[lastPositive.index] = Pair(negatives[j], false)
                }
            } else if (i < positives.size) combined[lastNegative.index] = Pair(positives[i], true)
            else if (zeros.isNotEmpty()) combined.add(Pair(0, false))
        }

        println(combined.map { (num, isPositive) -> mapNumToMod(num * (if (isPositive) 1 else -1)) }
                .reduce { acc, pair -> (acc * pair) % mod }
        )
    }

}

// Input Reader
private fun readLn() = readLine()!!

private fun readStrings() = readLn().trim().split(" ")
private fun readInts() = readStrings().map { it.toInt() }


Measured memory_bytes: 81732
import java.util.*
import kotlin.math.min

fun main() {
    val n = readLine()!!.trim().toInt()
    val counts = readLine()!!.trim().split(' ').map(String::toInt)
    var sum = counts.map{it.toLong()}.sum()
    var rest = 1L
    var result = 0L
    for (c in counts) {
        rest -= c
        if (rest < 0) {
            println(-1)
            return
        }
        sum -= c
        result += c
        result += min(rest, sum)
        rest = min(rest shl 1, sum)
    }
    println(result)
}

Measured memory_bytes: 59004
#include <bits/stdc++.h> 
using namespace std; 
  
// Function which returns the numbe of 
// unique subsequences of length K 
int solution(vector<int>A, int k) 
{ 
    // seiz of the vector 
    // which does is constant 
    int N = A.size(); 
  
    // bases cases 
    if (N < k || N < 1 || k < 1) 
        return 0; 
    if (N == k) 
        return 1; 
  
    
    vector<int> v1(N+10, 0); 
    vector<int> v2(N+10, 0); 
   	map<int,int> v3;
  
   
    v2[N - 1] = 1; 
    v3[A[N - 1] - 1] = 1; 
  
    for (int i = N - 2; i >= 0; i--) { 
  
       
        v2[i] = v2[i + 1]; 
  
        if (v3[A[i] - 1] == 0) { 
            v2[i]++; 
            v3[A[i] - 1] = 1; 
        } 
    } 
  
    // iterate for all possible values of K 
    for (int j = 1; j < k; j++) { 
  
        // fill the vectors with 0 
       v3.clear();
  
        // fill(v1.begin(), v1.end(), 0) 
        // the last must be 0 as from last no unique 
        // subarray can be formed 
        v1[N - 1] = 0; 
  
        // Iterate for all index from which unique 
        // subsequences can be formed 
        for (int i = N - 2; i >= 0; i--) { 
  
            // add the number of subsequence formed 
            // from the next index 
            v1[i] = v1[i + 1]; 
  
            // start with combinations on the 
            // next index 
            v1[i] = v1[i] + v2[i + 1]; 
  
            // Remove the elements which have 
            // already been counted 
            v1[i] = v1[i] - v3[A[i] - 1]; 
  
            // Update the number used 
            v3[A[i] - 1] = v2[i + 1]; 
        } 
  
        // prepare the next iteration 
        // by filling v2 in v1 
        v2 = v1; 
    } 
  
    // last answer is stored in v1 
    return v1[0]; 
} 
  
// Function to push the vector into an array 
// and print all the unique subarrays 

  
// Driver Code 
int main() 
{ 
  
  	int n;
  	cin>> n;
  	string s;
  	cin >> s;

    vector<int> a;
    for(int i = 0;i<n;i++) a.push_back((s[i]-'0'));
    int k = 3;
    	
    int ans = solution(a,k); 
  	cout << ans << endl;
    return 0; 
} 


Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;char n[100][100];int k[100][100],l[100][100],sum,H,W,i,j,m,s;
#define A(B,C) if(k[B][C]!=1){l[B][C]=1;}
main(){while(true){s=0;memset(l,0,sizeof(l));cin>>W>>H;if(W==0){break;}for(i=1;i<=H;i++){for(j=1;j<=W;j++){cin>>n[i][j];if(n[i][j]=='.'){k[i][j]=0;}else if(n[i][j]=='@'){k[i][j]=2;l[i][j]=1;}else{k[i][j]=1;}}}for(i=0;i<2500;i++){for(j=1;j<=H;j++){for(m=1;m<=W;m++){if(l[j][m]==1){A(j-1,m);A(j+1,m);A(j,m-1);A(j,m+1);}}}}for(j=1;j<=H;j++){for(m=1;m<=W;m++){if(l[j][m]==1){s++;}}}cout<<s<<endl;}}

Measured memory_bytes: 3096
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N=get_nsp
if N[-1]=="2" or N[-1]=="4" or N[-1]=="5" or N[-1]=="7" or N[-1]=="9"
    puts "hon"
elsif N[-1]=="0" or N[-1]=="1" or N[-1]=="6" or N[-1]=="8"
    puts "pon"
else
    puts "bon"
end

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

using namespace std;

typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;

int main()
{
  int W, a, b; scanf("%d %d %d", &W, &a, &b);
  int ans = 0;
  if (a > b) { swap(a, b); }
  if (a + W < b) { ans = b - (a + W); }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
S = list(input())
n = len(S)
c = 0
for i in range(n):
    if i % 2 == 0:
        if S[i] == "L":
            c = 1
            break
    else:
        if S[i] == "R":
            c = 1
            break
if c == 1:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 2940
/// 28-01-2018
/// MD:NUR ALAM
/// Eastern University of Bangladesh

#include "bits/stdc++.h"

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = (a); i < (b); ++i)
#define fo(i, a, b) for (int i = (a); i <=(b); ++i)
#define fors(i, s) for (int i = 0; s[i]; ++i)
#define rs(x) scanf("%s", (x))
#define mp make_pair
#define pb push_back
#define mso(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define len(X) strlen(x)

using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef long double lu;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpll;
typedef pair<int,int> Pll;
typedef map<string,int>msi;
typedef set<int>se;

template<class t> void _r(t &x) { cin >> x; }
void _r(int &x) { scanf("%d", &x); }
void _r(int64_t &x) { scanf("%lld", &x); }
void _r(double &x) { scanf("%lf", &x); }
void _r(char &x) { scanf(" %c", &x); }
void _r(char *x) { scanf("%s", x); }
void r() {}
template<class t, class... u> void r(t &head, u &... tail) { _r(head); r(tail...); }
template<class t> void _w(const t &x) { cout << x; }
void _w(const int &x) { printf("%d", x); }
void _w(const int64_t &x) { printf("%lld", x); }
void _w(const double &x) { printf("%.16f", x); }
void _w(const char &x) { putchar(x); }
void _w(const char *x) { printf("%s", x); }
template<class t,class u> void _w(const pair<t,u> &x) {_w(x.f); putchar(' '); _w(x.s);}
void w() {}
template<class t, class... u> void w(const t &head, const u &... tail) { _w(head); putchar(sizeof...(tail) ? ' ' : '\n'); w(tail...); }
template<class t, class... u> void debug(const t &head, const u &... tail) {
#ifdef HOME
#endif
}

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


int main()
{
   ll a,b,c,n,s=0,cnt=0;
   r(a,b,c,n);
   fo(i,0,a){
       fo(j,0,b){
           fo(k,0,c){
               s=(i*500)+(j*100)+(k*50);
               if(s==n)
                cnt++;
           }
       }
   }
  w(cnt);
}


Measured memory_bytes: 256
def solve():
  n = int(input())
  a = list(map(int, input().split()))
  g, z = 0, 0
  cut = 1
  for i in range(n-1):
    if a[i+1] > a[i]:
      g += 1
    elif a[i+1] < a[i]:
      z += 1
    if g != 0 and z != 0:
      cut += 1
      g, z = 0, 0
  print(cut)
  return 0
 
if __name__ == "__main__":
  solve()


Measured memory_bytes: 14252
//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*
        PEOPLE'S LIVES DON'T END WHEN THEY DIE.
        IT ENDS WHEN THEY LOSE FAITH
                                     -ITACHI UCHIHA
        EXPLAINATION BELOW->
        SAME AS EDITORIAL
       
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<pair<ll,ll>> vii;
typedef pair<ll,ll> pii;
typedef map<ll,ll> mii;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
#define sz(x) (ll)(x.size())
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
map<ll,ll>dp;
ll recursion(ll h)
{
    if(dp[h])return dp[h];
    else
    {
        dp[h]=1LL+recursion(h/2)+recursion(h/2);
    }
    return dp[h];
}
void solve()
{
  ll H;cin>>H;
  dp[1]=1;
  recursion(H);
  cout<<dp[H]<<"\n";
}
int main()
{
   fastio
   solve();
  return 0;
}


Measured memory_bytes: 256
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
      let mut iter = $s.split_whitespace();
      let mut next = || { iter.next().unwrap() };
      input_inner!{next, $($r)*}
  };
  ($($r:tt)*) => {
      let stdin = std::io::stdin();
      let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
      let mut next = move || -> String{
          bytes
              .by_ref()
              .map(|r|r.unwrap() as char)
              .skip_while(|c|c.is_whitespace())
              .take_while(|c|!c.is_whitespace())
              .collect()
      };
      input_inner!{next, $($r)*}
  };
}

macro_rules! input_inner {
  ($next:expr) => {};
  ($next:expr, ) => {};

  ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
      let $var = read_value!($next, $t);
      input_inner!{$next $($r)*}
  };
  ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
      let mut $var = read_value!($next, $t);
      input_inner!{$next $($r)*}
  };
}

macro_rules! read_value {
  ($next:expr, ( $($t:tt),* )) => {
      ( $(read_value!($next, $t)),* )
  };

  ($next:expr, [ $t:tt ; $len:expr ]) => {
      (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
  };

  ($next:expr, chars) => {
      read_value!($next, String).chars().collect::<Vec<char>>()
  };

  ($next:expr, usize1) => {
      read_value!($next, usize) - 1
  };

  ($next:expr, $t:ty) => {
      $next().parse::<$t>().expect("Parse error")
  };
}
use std::collections::{HashMap, HashSet};
use std::cmp::{max,min};
fn main(){
  input!{
    n:i64,
  }
  let mut v = HashSet::new();
  for i in 1..10 {
    for j in 1..10 {
      v.insert(i*j);
    }
  }
  let ans = match v.get(&n) {
    Some(_) => "Yes",
    None => "No",
  };
  println!("{}",ans);
}


fn is_prime(x:i64) -> bool {
  if x == 2 {return true;}
  if x < 2 || x % 2 == 0 {return false;}
  let mut j = 3;
  while j <= (x as f64).sqrt() as i64 {
      if x % j == 0 {
          return false;
      }
      j += 2;
  }
  true
}


Measured memory_bytes: 4352
// Problem : C - Rally
// Contest : AtCoder Beginner Contest 156
// URL : https://atcoder.jp/contests/abc156/tasks/abc156_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

#include<bits/stdc++.h>
#define pb emplace_back
#define int long long
#define vi vector<int>
#define pii pair<int,int>
#define mp(x,y) make_pair(x,y)
#define vp vector<pair<int,int>>
#define setbits(x) __builtin_popcountll(x)
#define f first
#define se second
#define iniz(n) memset(n,0,sizeof(n))
#define inin(n) memset(n,-1,sizeof(n))
#define inf LLONG_MAX
using namespace std;
template<typename T1,typename T2>istream &operator>>(istream &is, vector<pair<T1,T2>> &v) { for (pair<T1,T2> &t : v) is >> t.f>>t.se; return is; }
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }
double pi=acos(-1.0);
int md=1000000007;
int abst(int a)
{return a<0?-a:a;}
struct HASH{
  size_t operator()(const pii &x)const{
    return (size_t) x.first * 37U + (size_t) x.second;}};

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int Pow(int n,int x){int ans=1;
 while(x>0)
 {if(x&1)ans=(ans*n)%md;n=(n*n)%md;x=x>>1;}
 return ans;}

 vi fact,inv;
void inverse(int n)
{inv.resize(n+1);inv[0]=1;
for(int i=1;i<=n;i++)inv[i]=Pow(fact[i],md-2);}
void factorial(int n)
{fact.resize(n+1);fact[0]=1;
for(int i=1;i<=n;i++)fact[i]=(fact[i-1]*i)%md;}

int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;}

void solve()
{
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n;cin>>n;
vi v(n);cin>>v;
int ans=INT_MAX;
for(int i=1;i<=100;i++)
{
 int count=0;
	for(int j : v)
	count+=(j-i)*(j-i);
	ans=min(ans,count);
}
cout<<ans;
}

int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int t=1;
//cin>>t;
while(t--)
{
    solve();
}
}


Measured memory_bytes: 256