akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int[] a = new int[N];
		int[] list = new int[9];
		int min = 0;
		int max = 0;
		for(int i = 0; i < list.length; i++) {
			list[i] = 0;
		}
		for(int i = 0; i < N; i++) {
			a[i] = scan.nextInt();
			if(a[i] <= 399 && a[i] >= 1) {
				list[0]++;
			} else if(a[i] <= 799 && a[i] >= 400) {
				list[1]++;
			} else if(a[i] <= 1199 && a[i] >= 800) {
				list[2]++;
			} else if(a[i] <= 1599 && a[i] >= 1200) {
				list[3]++;
			} else if(a[i] <= 1999 && a[i] >= 1600) {
				list[4]++;
			} else if(a[i] <= 2399 && a[i] >= 2000) {
				list[5]++;
			} else if(a[i] <= 2799 && a[i] >= 2400) {
				list[6]++;
			} else if(a[i] <= 3199 && a[i] >= 2800) {
				list[7]++;
			} else if(a[i] >= 3200) {
				list[8]++;
			}
		}
		for(int i = 0; i < list.length - 1; i++) {
			if(list[i] > 0) {
				min++;
			}
		}
		max = min + list[8];
		if(min == 0 && list[8] >= 1) {
			min = 1;
		}
		System.out.println(min + " " + max);
		scan.close();

	}

}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    int a, b, c, d;
    cin >> N;
    a = N/1000;
    b = N/100 % 10;
    c = N/10 % 10;
    d = N % 10;

    if ((a == b && b == c) ||(b == c && c == d)) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<cstdio>
char a[50][51],b[50][51];
int main(){
    int m,n;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)scanf("%s",a[i]);
    for(int i=0;i<m;i++)scanf("%s",b[i]);
    for(int i=0;i<=n-m;i++){
        for(int j=0;j<=n-m;j++){
            bool flag=true;
            for(int k=0;k<m;k++){
                if(!flag)break;
                for(int l=0;l<m;l++){
                    if(!flag)break;
                    if(b[k][l]!=a[i+k][j+l])flag=false;
                }
            }
            if(flag){
                printf("Yes");
                return 0;
            }
        }
    }
    printf("No");
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll ZERO = 0;
const int INF = 1e9;
const ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

int main() {
    int N,K,S;
    cin >> N >> K >> S;
    int A;
    if(S == 1000000000) {
        A = S - 1;
    }
    else {
        A = S + 1;
    }
    for(int i = 0;i < N;i++) {
        if(i < K) {
            cout << S << " ";
        }
        else {
            cout << A << " ";
        }
    }
    cout << endl;
}

Measured memory_bytes: 1280
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;

using namespace std;

int main() {
    int n;
    cin >> n;
    
    if(n % 2 == 0) {
        cout << 0.5 << endl;
    }
    else {
        cout << setprecision(10) << ((double)((n / 2) + 1) / (double)n) << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
# PROXY

from collections import Counter
S = list(input())
T = list(input())
Tdup = sorted([e for e in set(T) if T.count(e) > 1], key=T.index)
Sdup = sorted([e for e in set(S) if S.count(e) > 1], key=S.index)
if len(T) == len(set(T)) and len(S) == len(set(S)):
    print("Yes")
elif len(S) != len(set(S)) and len(T) != len(set(T)) and len(Sdup) == len(Tdup):
    counter = 0
    while counter < len(Tdup):
        Tdupid = [i for i, x in enumerate(T) if x == Tdup[counter]]
        Sdupid = [i for i, x in enumerate(S) if x == Sdup[counter]]
        if Tdupid != Sdupid:
            print("No")
            break
        else:
            counter += 1
    else:
        print("Yes")
else:
    print("No")

Measured memory_bytes: 18812
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<math.h>
using namespace std;
int main(){
    int k,n;
    cin >> k >> n;
    int a[n];
    for(int i=0;i<n;i++) cin >> a[i];

    int dis=0;
    
    for(int i=1;i<n;i++){
        dis = max(dis,a[i]-a[i-1]);
    }
    dis=max(dis,k-a[n-1]+a[0]);

    cout << k-dis << endl;
}

Measured memory_bytes: 4408
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    //偶数か奇数か判断
    int a,b;
    
    cin >> a >> b;
    
    if((a % 2 != 0) && (b % 2 != 0)){
        cout << "Odd" << endl;
    }else{
        cout << "Even" << endl;
    }
     
     return 0;
}

Measured memory_bytes: 256
def gcd(a, b):  # a>b
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


N = int(input())
A = list(map(int, input().split()))
R = [0 for i in range(N - 1)]
L = [0 for i in range(N - 1)]
R[0] = A[0]
L[0] = A[-1]
for i in range(1, N - 1):
    R[i] = gcd(R[i - 1], A[i])
for j in range(1, N - 1):
    L[j] = gcd(L[j - 1], A[-1 - j])
    # print(L[j])
t = 0
for i in range(N - 2):
    # print(R[i], L[N - 3 - i])
    t = max(t, gcd(R[i], L[N - 3 - i]))
print(max(t, R[-1], L[-1]))


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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll LCM(ll a, ll b) { return a / GCD(a, b)* b; }

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

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  int n; cin>>n;
  vi a(n);
  rep(i,n) cin>>a[i];
  vi b(n);
  bool head=true;
  int h=0,t=n-1;
  for(int i=n-1; i>=0; i--){
    if(head){
      b[h]=a[i];
      h++;
    }else{
      b[t]=a[i];
      t--;
    }
    head=!head;
  }
  rep(i,n){
    cout<<b[i];
    if(i!=n-1)cout<<" ";
  }
  cout<<endl;
}

Measured memory_bytes: 3712
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		System.out.print(n + ":");

		int tmp = n;
		for (int i = 2; i * i <= n; i++) {
			while (tmp % i == 0) {
				System.out.print(" " + i);
				tmp /= i;
			}
		}
		if (tmp != 1) {
			System.out.print(" " + tmp);
		}

		System.out.println();

		sc.close();
	}
}

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

int main() {
	int n; cin >> n;
	string s[n];
	for(int i = 0; i < n; i++) {
		cin >> s[i];
		sort(s[i].begin(), s[i].end());
	}
	sort(s, s + n);
	long long res = 0;
	string pre = s[0];
	for (int i = 0; i < n; )
	{
		int j = i + 1;
		long long tmp = 1;
		while (pre == s[j] && j < n)
		{
			j++;
			tmp++;
		}
		res += tmp * (tmp - 1) / 2;
		if(j == n) break;
		pre = s[j];
		i = j;
	}
	cout << res << endl;
	return 0;
}


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

using ll = long long;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SIZE(a) ((int)(a).size())

int sum(ll n) {
	int result = 0;
	while (n > 0) {
		result += n % 10;
		n /= 10;
	}
	return result;
}

int len(ll n) {
	int cnt = 0;
	while (n > 0) {
		n /= 10;
		++cnt;
	}
	return cnt;
}

vector<int> digs(ll n) {
	vector<int> result;
	while (n > 0) {
		result.push_back(n % 10);
		n /= 10;
	}
	reverse(result.begin(), result.end());
	return result;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);	
	
	ll n;
	cin >> n;
	
	int result = sum(n);
	int l = len(n);
	result = max(result, 9*(l-1));
	auto d = digs(n);
	int now = 0;
	REP(i, l) {
		if (d[i] > 0) {
			result = max(result, now + (d[i]-1) + (l-i-1)*9);
		}
		now += d[i];
	}
	
	cout << result << '\n';
	
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits.h>
#include<functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <stack>

#define LL long long
#define pii pair<int,int>
#define pLL pair<LL,LL>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<LL>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<LL>
#define vecpii vector<pii>
#define vecpLL vector<pLL>
#define vecbL vector<bool>
#define endl "\n"
#define REP(e,v) for(auto e:v)
#define rep(i, a, n) for(LL i = a; i < n;i++)

using namespace std;

int inp(){
	int x;
	scanf("%d",&x);
	return x;
}
LL linp(){
	LL x;
	scanf("%lld",&x);
	return x;
}

void outp(int i){
	printf("%d",i);
}

void loutp(LL i){
	printf("%lld",i);
}

LL mod(LL i){
	return i % 1000000007;
}


int gcd(int i,int j){
	if(j != 0)
		return gcd(j, i % j);
	else
		return i;

}

int tNoEP(){
	LL N,M;

	cin >> N >> M;

	loutp((N*(N-1))/2+(M*(M-1)/2));

	return 0;
}
signed main() {

	tNoEP();
	return 0;
}



Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]C - Boxes and Candies
            var line = ReadLine();
            int n = line[0];
            int x = line[1];

            var a = ReadLine();
            long count = 0;

            for (int i = 1; i < n; i++)
            {
                int sum = a[i - 1] + a[i];

                if (sum > x)
                {
                    int diff = sum - x;

                    if (a[i] < diff)
                    {
                        a[i - 1] -= diff - a[i];
                        a[i] = 0;
                    }
                    else
                    {
                        a[i] -= sum - x;
                    }

                    count += diff;                    
                }
            }

            Console.WriteLine(count);
        }

        static int[] ReadLine()
        {
            var line = Console.ReadLine();
            var array = line.Split(' ');

            return array.Select(x => int.Parse(x)).ToArray();
        }
    }
}

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

using namespace std;
using i64 = int64_t;

i64 dp[1000][1000];
const i64 mod = 1000000007;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  i64 H, W;
  cin >> H >> W;
  for(int i=0;i<H;i++){
    string s;
    cin >> s;
    for(int j=0;j<W;j++){
      if(s[j] == '.'){
        dp[i][j] = 0;
      }else{
        dp[i][j] = -1; 
      }
    }
  }
  dp[0][0] = 1;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(dp[i][j] < 0)continue;
      if(i > 0)dp[i][j] += max(dp[i-1][j], i64(0));
      if(j > 0)dp[i][j] += max(dp[i][j-1], i64(0));
      dp[i][j] %= mod;
    }
  }
  cout << dp[H-1][W-1] << endl;
}

Measured memory_bytes: 8064
package main

import(
    "fmt"
    "sort"
    "strings"
)



func main() {
    var a,b string
    fmt.Scan(&a,&b)
    for i:=0;i<len(a)+len(b);i++{
        if i%2==0{
            fmt.Printf("%c",a[i/2])
        } else {
            fmt.Printf("%c",b[i/2])
        }
    }
    fmt.Printf("\n")
}





// Pairsort
type Pair struct {
    first,second int64
}

type By func(p1, p2 *Pair) bool

func (by By) Sort(pairs []Pair) {
    ps := &pairSorter{
            pairs : pairs,
            by: by,
    }
    sort.Sort(ps)
}

type pairSorter struct {
    pairs []Pair
    by func(p1, p2 *Pair) bool
}

func (s *pairSorter) Len() int {
    return len(s.pairs)
}

func (s *pairSorter) Swap(i, j int) {
    s.pairs[i], s.pairs[j] = s.pairs[j], s.pairs[i]
}

func (s *pairSorter) Less(i, j int) bool {
    return s.by(&s.pairs[i], &s.pairs[j])
}

func first (p1, p2 *Pair) bool {
        return p1.first < p2.first
}

func second (p1, p2 *Pair) bool {
        return p1.second < p2.second
}
// end



func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

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

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

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}

func scanNums(len int) (nums []int){
    var num int
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanNums64(len int) (nums []int64){
    var num int64
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanString(len int) (str []string){
    var s string
    for i:=0; i<len; i++{
        fmt.Scan(&s)
        str = append(str,s)
    }
    return
}

func makeTwoNums(n,m int) ([][]int){
    Nums := make([][]int, n)
    for i:=0; i<n; i++{
        Nums[i] = make([]int, m)
    }
    return Nums
}

func sortString(s string) string{
    t := strings.Split(s, "")
    sort.Strings(t)
    return strings.Join(t, "")
}

func reverseString(s string) string{
    t := []rune(s)
    for i,j := 0, len(s)-1 ; i < j ; i, j = i+1, j-1 {
        t[i], t[j] = t[j], t[i]
    }
    return string(t)
}

func inside(h,w,H,W int) bool{
    if h>=0 && h<H && w>=0 && w<W{
        return true
    }
    return false
}


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

using namespace std;

typedef long long ll;

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

	double ans = 0.0;

	int N;
	cin >> N;

	rep(i, N){
		double x;
		string u;

		cin >> x >> u;

		if(u == "JPY"){
			ans += x;
		}else{
			ans += 380000.0 * x;
		}
	}

	cout << fixed << setprecision(7) << ans << endl;
}


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

bool v[100100];
int p[100100];

bool is_prime(long N) {
  for (long i = 2; i * i <= N; i++) {
    if (N % i == 0) {
      return false;
    }
  }
  return N != 1;
}

int main() {

  for (int i = 1; i < 100100; i++) {
    v[i] = is_prime(i);
  }

  p[0] = 0;
  p[1] = 0;
  p[2] = 0;

  for (int i = 3; i < 100100; i++) {
    if (i % 2 != 0) {
      if (v[(i + 1) / 2] && v[i]) {
        p[i] = p[i - 1] + 1;
      } else {
        p[i] = p[i - 1];
      }
    } else {
      p[i] = p[i - 1];
    }
  }

  int Q;
  cin >> Q;

  vector<pair<int,int>> lr;

  while (0 < Q) {

    int l, r;
    cin >> l >> r;

    lr.push_back(make_pair(l,r));

    Q--;
  }

  for (int i = 0; i < lr.size(); i++) {

    int l_ = lr[i].first;
    int r_ = lr[i].second;

    cout << p[r_] - p[l_ - 1] << endl;
  }

}

Measured memory_bytes: 2036
#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long

vector<int>g[100000];
int n, u, v, a, b, ans;
int du[100000], dv[100000];

//Graph ⇒ std::vector<int> v[100]; 100 verices
void dfs(int x, int y, int z) {
	dv[x] = z;
	for (int i = 0; i < g[x].size(); i++) {
		if (g[x][i] != y)dfs(g[x][i], x, z + 1);
	}
}

int main() {
  scanf("%d%d%d", &n, &u, &v);
	u--; v--;
	for (int i = 0; i < n - 1; i++) {
		scanf("%d%d", &a, &b);
		a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}

  dfs(u, -1, 0);
for (int i = 0; i < n; i++)du[i] = dv[i];
dfs(v, -1, 0);
for (int i = 0; i < n; i++) {
  if (dv[i] > du[i]) {
    if (dv[i] > ans)ans = dv[i];
  }
}
printf("%d\n", ans - 1);

  return 0;
}



Measured memory_bytes: 10368
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if i * 500 + j * 100 + k * 50 == X:
                cnt += 1
print(cnt)

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

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

const long long INF = 1LL << 60;

int main(){
  int N, T;
  cin >> N >> T;

  int sum = 0;
  int t, bt;
  cin >> bt;
  rep(i, N-1){
    cin >> t;
    sum += min(T, t - bt);
    bt = t;
  }
  sum += T;

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int time = 0;
			for(int i = 0;i < 4;i++){
				time += scan.nextInt();
			}
			System.out.println(time/60 + "\n" + time%60);
		}
	}
}

Measured memory_bytes: 17312
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include <utility>
using namespace std;


	bool dfs(int current, vector<vector<pair<int,int>>>& neighbors , vector<bool> & visited, vector<int> & values){
		//cout<<current<<": "<<visited[current]<<", "<<values[current]<<"\n";
		
		for(int i = 0; i < neighbors[current].size(); i++){
			int next_n = neighbors[current][i].first;
			int dif = neighbors[current][i].second;
			//cout<<"next: "<<next_n<<": "<<visited[next_n]<<", "<<values[next_n]<<"\n";
			if(visited[next_n] == 1){
				if(values[current] + dif != values[next_n])
					return 0;
			}
			else{
				visited[next_n] = 1;
				values[next_n] = values[current] + dif;
				if(dfs(next_n, neighbors, visited, values) == 0)
					return 0;
			}
		}
		return 1;
	}

int main(){
	int N, M;
	cin>>N>>M;
	
	
	vector<vector<pair<int,int>>> neighbors(N,vector<pair<int,int>>());
	for(int i = 0; i < M; i++){
		int n1, n2, dif;
		cin >> n1 >> n2 >> dif;
		neighbors[n1-1].push_back(make_pair(n2-1, dif));
		neighbors[n2-1].push_back(make_pair(n1-1, -dif));
	}
	
	bool ans = 1;
	/*
	for(int current = 0; current < N; current++){
		for(int i = 0; i < neighbors[current].size(); i++){
			cout<< "("<<current<<", "<<neighbors[current][i].first<<", is "<<neighbors[current][i].second<<"), ";
		}
	}
	*/
	vector<bool> visited(N,0);
	vector<int> values(N,0);
	for(int i = 0; i < N; i++){
		if(visited[i] == 0){
			visited[i] = 1;
			values[i] = 0;
			ans &= dfs(i,neighbors, visited, values);
		}
	}
	
	
	if(ans == 0)
		cout<< "No" <<"\n";
	else
		cout<< "Yes" <<"\n";
return 0;
}

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

public class Main {


    public Main(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int M = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        boolean[] bad = new boolean[N];
        for (int i = 0; i < M; i++) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            if (H[a] <= H[b])
                bad[a] = true;
            if (H[a] >= H[b])
                bad[b] = true;
        }

        int res = 0;
        for (int i = 0; i < N; i++) if (!bad[i]) {
            res++;
        }
        out.println(res);

    }

    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);

        out.close();
    }
}


class FastScanner{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

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

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

    boolean isSpaceChar(int c)
    {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    }

    boolean isEndline(int c)
    {
        return c=='\n'||c=='\r'||c==-1;
    }

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

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

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

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

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


Measured memory_bytes: 53888
import sys
from math import factorial

def comb(n, k):
    return int(factorial(n)) // int(factorial(k)) // int(factorial(n-k))

def h_comb(n, k):
    return int(factorial(n+k-1)) // int(factorial(k)) // int(factorial(n - 1))

n, k =[int(i) for i in sys.stdin.readline().split()]
for i in range(1,k+1):
    if n-k-i+1 < 0:
        print(0)
    else:
        x = comb(k-1, i-1)
        y = h_comb(i+1, n-k-i+1)
        print(int( x * y )% (10**9+7))

Measured memory_bytes: 3316
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<queue>
#include<vector>
#include<complex>
#include<map>
#include<set>
using namespace std;
#define int long long
vector<int> SS;
signed main(){
	int N, P, Q;
	cin >> N >> P >> Q;
	vector<int> C(N);
	for (int i = 0; i < N; i++) {
		cin >> C[i];
		C[i] -= P*(Q - i);
	}
	int sum = 0;
	for (int i = 0; i < N; i++) {
		sum += P*(Q - i);
	}
	sort(C.begin(), C.end());

	int x = 0;
	int res = -((int)1 << 60);
	//cerr << sum << endl;
	for (int i = N; i >= 0; i--) {
		if (i < N)x += C[i];
		res = max(res, sum + (P * (i*(i - 1))) + x);
		//cerr << sum + ((i*(i - 1)) / 2) + x << endl;
	}
	cout << res << endl;
}


Measured memory_bytes: 6796
#include<bits/stdc++.h>
#define ll long long 
#define inf 0x3f
#define INF 0x3f3f3f3f
#define fi first
#define se second 
#define mp make_pair
#define pa pair<int,int>

using namespace std;

inline ll read()
{
	ll sum=0,f=1;char c=getchar();
	while (!isdigit(c)) {if (c=='-') f=-1;c=getchar();}
	while (isdigit(c)) {sum=sum*10+c-'0';c=getchar();}
	return sum*f;
}
const int MAXN=4010;
#define Mod 998244353
int f[MAXN][MAXN];
int n;
char s[100010];
int main()
{
	scanf("%s",s+1);n=strlen(s+1);
	int s1=0,s2=0;
	f[0][0]=1;
	for(int i=0;i<2*n;i++)
	{	
		if(i+1<=n)
		{
			if(s[i+1]=='0') s1+=2;
			if(s[i+1]=='1') s1+=1,s2+=1;
			if(s[i+1]=='2') s2+=2;
		}
		for(int j=0;j<=2*n;j++)
		{
			if(!f[i][j]) continue;
			if(s1>j)
				f[i+1][j+1]+=f[i][j],f[i+1][j+1]%=Mod; 
			if(s2>i-j)
				f[i+1][j]+=f[i][j],f[i+1][j]%=Mod;
		}
	}
	cout<<f[2*n][s1];
	return 0;
}

Measured memory_bytes: 60544
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define st string
#define dl double
#define ve(i) vector<i>
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define each(i, n) for(auto&& i: n)
#define pr(n) cout << fixed << setprecision(n)

int main() {
  st S, T;
  cin >> S >> T;
  int a = 0;
  rep(i, 3) {
    if(S.at(i) == T.at(i)) {
      a++;
    }
  }
  cout << a << endl;
}  

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;

#define MAX_N 100000
#define INF 100000000000000
typedef long long Int;
int N;
Int A[MAX_N * 2 + 1];

bool CC(int a, int b, Int x){
	return A[b] - A[a] >= x;
}

bool C(Int x){
	int lb, ub, left;
	bool cut;
	for(int i = 0; i <= N; i++){
		left = i; lb = i; ub = 2 * N + 1;
		cut = false;
		while(ub - lb > 1){
			int mid = (lb + ub) / 2;
			if(CC(left, mid, x)){
				ub = mid;
				cut = true;
			}
			else lb = mid;
		}
		if(!cut) continue;
		left = ub; ub = 2 * N + 1;
		cut = false;
		while(ub - lb > 1){
			int mid = (lb + ub) / 2;
			if(CC(left, mid, x)){
				ub = mid;
				cut = true;
			}
			else lb = mid;
		}
		if(!cut) continue;
		left = ub; ub = 2 * N + 1;
		cut = false;
		while(ub - lb > 1){
			int mid = (lb + ub) / 2;
			if(CC(left, mid, x)){
				ub = mid;
				cut = true;
			}
			else lb = mid;
		}
		if(!cut) continue;
		if(ub - i < N + 1) return true;
	}
	return false;
}

int main(){
	scanf("%d", &N);
	A[0] = 0;
	scanf("%lld", &A[1]);
	A[N + 1] = A[1];
	for(int i = 2; i <= N; i++){
		scanf("%lld", &A[i]);
		A[i] += A[i - 1];
		A[i + N] = A[i];
	}
	for(int i = N + 1; i <= N * 2; i++){
		A[i] += A[N];
	}
	
	Int lb = 0, ub = INF;
	while(ub - lb > 1){
		Int mid = (lb + ub) / 2;
		if(C(mid)) lb = mid;
		else ub = mid;
	}
	
	printf("%lld\n", lb);
	
	return 0;
}

Measured memory_bytes: 2588
//
//  main.cpp
//  backToProblemSolving
//
//  Created by Khaled Abdelfattah on 6/27/17.
//  Copyright © 2017 Khaled Abdelfattah. All rights reserved.
//

#include <bits/stdc++.h>
// #include <iostream>
using namespace std;

typedef long long ll;
#define MAX 1000000000
#define BASE1 23
#define BASE2 31
#define MOD1 1000000007
#define MOD2 217645177
#define eps 1e-6

int main() {
    int h, w;
    cin >> h >> w;
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i ++)
        cin >> arr[i];
    int idx = 1, flag = arr[idx - 1];
    int grid[h][w];
    for (int i = 0; i < h; i += 2) {
        for (int j = 0; j < w; j ++) {
            grid[i][j] = idx;
            flag --;
            if (!flag) {
                idx ++;
                if (idx == n + 1)
                    break;
                flag = arr[idx - 1];
            }
        }
        if (i + 1 == h)
            break;
        for (int j = w - 1; j >= 0; j --) {
            grid[i + 1][j] = idx;
            flag --;
            if (!flag) {
                idx ++;
                if (idx == n + 1)
                    break;
                flag = arr[idx - 1];
            }
        }
    }
    for (int i = 0; i < h; i ++) {
        for (int j = 0; j < w; j ++)
            cout << grid[i][j] << " ";
        cout << endl;
    }
    return 0;
}


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

using namespace std;

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cout << setprecision(9) << fixed;

    long long W, H, x, y;

    cin >> W >> H >> x >> y;

    cout << W * H / 2.0 << ' ';

    if(x * 2 == W and y * 2 == H) cout << 1 << '\n';
    else cout << 0 << '\n';

    return 0;
}


Measured memory_bytes: 256
//BISMILLAHIR-RAH-MANIR-RAHIM.
//ABU AYUB MD AHMADUL(CEO-PEREGRINE SPHERE).
//FORMER CEO-SPACEH(2019).
//DEPT.OF CSE,SUST//2018-19.
//------------------------------------------\\
//PRE-CODE========>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#include<vector>
#include<math.h>
#include<numeric>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#define mp make_pair
#define ins insert
#define lli long long int
#define ll long long
#define pb push_back
#define loop1(i,l,n) for(i=l;i<=n;i++)
#define loop0(i,l,n) for(i=l;i<n;i++)
#define inf (1<<28)
#define pi 3.1415926536
const int MAX=1e6+9;
set<int>ist;
map<string,int>msi;
map<string,string>mss;
map<int,string>mis;
map<int,int>mii;
pair<int,int>pii;
vector<int>v;
vector<pair<int,int> >vv;
int cc[]= {1,-1,0,0};
int rr[]= {0,0,1,-1};
//BIPARTITE GRAPH FUCTION========>
/*
int cnt[2];
int vertices[MAX];
void Bipartite(int node,int pnode,int color)
{
    cnt[color]++;
    for (int i=0;i<vertices[node].size();i++)
    {
        if (vertices[node][i]!=pnode)
        {
            Bipartite(vertices[node][i],node,!color);
        }

    }
}
*/
//REAL TIME BINARY SERACH FUNCTION========>
/*
int Bsearch(int left,int right,int query,int n)
{
    int mid=left+(right-left)/2;
    if(query<mid)
    {
        return Bsearch(left,mid-1,query,n);
    }
    else if(query>mid)
    {
        return Bsearch(mid+1,right,query,n-1);
    }
    else
    {
        return n;
    }
}
*/
//DECIMAL TO BINARY DECODING========>
/*
ll D2B(ll dec)
{
    ll digit[32]={};
    ll i = 0;
    while (dec > 0)
    {
        [i] = n % 2;
        n = n / 2;
        i++;
    }

}
*/
//BINARY TO DECIMAL DECODING========>
/*
ll b2d(ll bin)
{
    ll digit,sum=0,h=0;
    while(bin!=0)
    {
        digit=bin%10;
        sum+=digit*pow(2,h++);
        bin/=10;
    }
    return sum;
}
*/
//DFS FUNCTION=========>
/*
int visited[MAX];
vector<int>adj[MAX];
int weight[MAX];
void dfs(int v)
{
    visited[v] = 1;
    for (auto j: adj[v])
    {
        if (!visited[j])
        {
            dfs(j);
        }
    }
}
*/
//------------------------------------------\\
//LAUNCHING SHARK-20========>
void FIRST_ATC()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t;
    int a,b,c;
    cin>>a>>b>>c;
    int l=(a-1)/c;
    int r=b/c;
    int ans=r-l;
    cout<<ans<<endl;



}
//MAIN FUNCTION========>
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    FIRST_ATC();

    return 0;
}
//------------------------------------------\\
//ABOUT THE SERIES========>
//THE BUTTERFLY SERIES-(MAY-2020).
//SPONSERED BY QUANTUM SPACE(CEO-NAIMUL ISLAM).
//CONTROLLER=>SAFIA BEGUM(CEO-BACKS/ASH).
//ADVISOR=>NASRULLAH SAMI(CEO-FALCON AXIS).
//CO-CHIEF ADVISOR=>G.M NAYEEM(CEO-TECH FRIGATE).
//PRESIDENT=>SAMIA PREITY(CEO-FASTEX AND SPAIT).



Measured memory_bytes: 3652
//      https://youtu.be/X_hMZYDMps4

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef long long unsigned llu;
typedef pair<long long, long long> pll;
const long long inf = 2000000000000000000LL;    // 2e18
#define pi                  acos(-1.0)
#define fast                ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define nl                  "\n"
#define ff                  first
#define ss                  second
#define pb                  push_back
#define pf                  push_front
#define all(x)              x.begin(),x.end()
#define debug(x)            cout<<"debug "<<x<<"\n"

int main()
{
    fast;
    ll t,i,j,k,l,m,n,o,p,q,temp,ans=0,flag=0,mod=1000000007,odd=0,even=0;
    cin>>n;
    vector<pll>v(n);
    for(i=0;i<n;i++){
        cin>>v[i].ff;
    }
    for(i=0;i<n;i++){
        cin>>v[i].ss;
    }
    for(i=0;i<n;i++){
        ans+=max(0LL,v[i].ff-v[i].ss);
    }
    cout<<ans;
}


Measured memory_bytes: 3628
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>

using namespace std;

typedef long long ll;

typedef std::pair<int, int> ipair;
bool lessPair(const ipair& l, const ipair& r){return l.second < r.second;}
bool morePair(const ipair& l, const ipair& r){return l.second > r.second;}

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

const ll MOD = 1e9 + 7;
// const long long INF = 1LL<<60;
void add(long long &a, long long b) { a += b; if (a >= MOD) a -= MOD; }
void sub(long long &a, long long b) { a -= b; if (a < 0) a += MOD; }
void mul(long long &a, long long b) { a *= b; a %= MOD; }
ll llmin(ll a, ll b) { if (a < b) return a; else return b; }
ll llmax(ll a, ll b) { if (a < b) return b; else return a; }
ll llabs(ll a) { if (a >= 0) return a; else return - a; }
ll llmodpow(ll a, ll n) {
   if (n == 0) return 1;
   ll tmp = llmodpow(a, n / 2);
   mul(tmp, tmp);
   if (n & 1) mul(tmp, a);
   return tmp;
}

int main() {
   int N;
   cin >> N;
   ll ans = 1;
   for (int i = 1; i <= N; i++) {
      ans *= i;
      ans %= MOD;
   }
   cout << ans << endl;
   return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var h, w int
	fmt.Scan(&h, &w)
	s := make([]string, h)
	for i := 0; i < h; i++ {
		fmt.Scan(&s[i])
	}

	dots := 0
	m := make([][]int, h)
	for i := 0; i < h; i++ {
		m[i] = make([]int, w)
		for j := 0; j < w; j++ {
			m[i][j] = -1
			if s[i][j] == '.' {
				dots++
			}
		}
	}
	m[0][0] = 0

	ds := [][2]int{{0, -1}, {0, 1}, {-1, 0}, {1, 0}}
	q := make([][2]int, 0)
	q = append(q, [2]int{0, 0})
	for len(q) > 0 {
		y, x := q[0][0], q[0][1]
		q = q[1:]
		for _, d := range ds {
			ny, nx := y+d[0], x+d[1]
			if 0 <= ny && ny < h && 0 <= nx && nx < w {
				if m[ny][nx] == -1 && s[ny][nx] == '.' {
					m[ny][nx] = m[y][x] + 1
					q = append(q, [2]int{ny, nx})
				}
			}
		}
	}

	g := m[h-1][w-1]
	if g == -1 {
		fmt.Println(-1)
		return
	}

	ans := dots - g - 1
	fmt.Println(ans)
}


Measured memory_bytes: 768
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int a = sc.nextInt();
        int b = sc.nextInt();

        if(a<b){
            for(int i=0;i<b;i++){
                System.out.print(a);
            }
        } else {
            for(int i=0;i<a;i++){
                System.out.print(b);
            }
        }
    }
}


Measured memory_bytes: 35636
s = gets.chomp.split("")
l = s.length-1

ans = 0
for i in 0..(2**l-1)
  ss = s.clone
  exp = []
    while ss.size > 0
      exp << ss.shift
      exp << "+" if i%2==1
      i = i >> 1
    end
    ans += exp.join.split("+").map(&:to_i).inject(:+)
end
puts ans


Measured memory_bytes: 1916
N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(N):
    B+=[[i+1,A[i]]]
B.sort(key=lambda x:x[1])
print(B[0][0], end="")
for i in range(1,N):
    print(" {}".format(B[i][0]),end="")
print("")

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

using namespace std;

const int maxn = 112345;
int main()
{

    int n;
    cin>>n;
    for(long long a=n;a>0;a--)
    {
        for(long long b=1;b<=3500;b++)
        {
            if(4*a*b-a*n-b*n<=0)continue;
            if(n*a*b%(4*a*b-a*n-b*n)==0)
            {
                long long c=n*a*b/(4*a*b-a*n-b*n);
                cout<<a<<' '<<b<<' '<<c<<endl;
                return 0;
            }
        }
    }
    return 0;
}

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

#define ll long long int
#define vl vector<ll>

int main() {

    ll N;
    cin >> N;

    ll len = 0;
    vl A(200010);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        len += A[i];
    }

    ll c;
    ll ans, ans1, ans2;
    ll left, right;
    ll tmp = 0;
    if (len%2 == 0) {
        c = len / 2;
        for (int i = 0; i < N; i++) {
            tmp += A[i];
            if (tmp >= c) {
                left = tmp - A[i];
                right = tmp;
                ans = min(len - 2*left, 2*right - len);
                // cout << "left " << left << "  right " << right << endl;
                cout << ans << endl;
                return 0;
            }
        }
    }
    else {
        c = (len + 1) / 2;
        for (int i = 0; i < N; i++) {
            tmp += A[i];
            if (tmp >= c) {
                left = tmp - A[i];
                right = tmp;
                ans1 = min(len - 2*left, 2*right - len);
                // cout << "left " << left << "  right " << right << endl;
                break;
            }
        }
        tmp = 0;
        c = (len - 1) / 2;
        for (int i = 0; i < N; i++) {
            tmp += A[i];
            if (tmp >= c) {
                left = tmp - A[i];
                right = tmp;
                ans2 = min(len - 2*left, 2*right - len);
                // cout << "left " << left << "  right " << right << endl;
                break;
            }
        }
        cout << min(ans1, ans2) << endl;
    }

    return 0;
}


Measured memory_bytes: 1920
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;
import std.container;

enum MAX = 1_000_100;
ulong MOD = 1_000_000_007;
ulong INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias Pair = Tuple!(long, "a", long, "b");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long a, b;
    scan(a, b);
    auto t = gcd(a, b);
    writeln(a * b / t);
}

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}


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

int main() {    
    string line;
    
    while (getline(cin,line)) {
        for (int i = 0; i != 26; i++) {
            for (int j = 0; j != line.size(); j++) {
                if (isalpha(line[j])) {
                    line[j] = (line[j] - 'a' + 1) % 26 + 'a';
                }            
            }
            if (line.find("the") != string::npos || line.find("this") != string::npos || line.find("that") != string::npos) {break;}                    
        }
        cout << line << endl;
    }    
    return 0;
}

Measured memory_bytes: 1180
#include <bits/stdc++.h> 
#include <iostream>
 #include<stdio.h>
 #include<math.h>
 #include<string.h>
using namespace std;

int main() {
    int t,n,i,j,k,l;
     int a[100001];
     char s[100001];
     vector<int> v;
     scanf("%d",&n);
     if(n==0)
     printf("1");
     if(n==1)
     printf("0");
	
	return 0;
}


Measured memory_bytes: 3760
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cerr << #x << ": " << x << endl
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  rep(i, n) cin >> v[i];

  vector<ll> sl(n + 1);
  rep(i, n) sl[i + 1] = sl[i] + v[i];

  reverse(all(v));
  vector<int> rv(n);
  rep(i, n) rv[i] = v[i];
  reverse(all(v));

  vector<ll> sr(n + 1);
  rep(i, n) sr[i + 1] = sr[i] + rv[i];

  ll ans = 0;
  rep(l, k + 1) rep(r, k - l + 1) {
    if(l + r > n) continue;
    int ret = k - l - r;
    if(ret < 0) continue;
    vector<int> hand;
    rep(i, l) hand.push_back(v[i]);
    rep(i, r) hand.push_back(rv[i]);
    sort(all(hand));
    ll now = sl[l] + sr[r];
    rep(i, ret) {
      if(i >= hand.size()) break;
      if(hand[i] > 0) break;
      now -= hand[i];
    }
    ans = max(ans, now);
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> struct edge { int from, to; T cost;};
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }


int main() {
  string s; cin >>s;
  if (s[0] == '7' || s[1] == '7' || s[2] == '7'){
    cout <<"Yes" <<endl;
  }else{
    cout <<"No" <<endl;
  }
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
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 (a>b) { a=b; return 1; } return 0; }

int main() {
    string KEY = "keyence";
    string s;
    cin >> s;
    rep(i,s.size()+1) {
        for(int j = 0; i + j <= s.size(); j++) {
            if(s.substr(0, i) + s.substr(s.size() - j, j) == KEY) {
                cout << "YES" << endl;
                return 0;
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader
import kotlin.system.exitProcess

fun main() {
    val br = System.`in`.bufferedReader()
    var k = br.readInt()
    if (k % 7 == 0) {
        k /= 7
    }
    k *= 9

    if (k % 2 == 0 || k % 5 == 0) {
        print(-1)
        exitProcess(0)
    }

    var x = 1
    var thing = 10
    while (true) {
        if (thing % k == 1) {
            print(x)
            exitProcess(0)
        }
        thing *= 10
        thing %= k
        x++
    }
}

private const val SPACE_INT = ' '.toInt()
private const val ZERO_INT = '0'.toInt()
private const val NL_INT = '\n'.toInt()

private fun BufferedReader.readInt(): Int {
    var ret = read()
    while (ret <= SPACE_INT) {
        ret = read()
    }
    val neg = ret == '-'.toInt()
    if (neg) {
        ret = read()
    }
    ret -= ZERO_INT
    var read = read()
    while (read >= ZERO_INT) {
        ret *= 10
        ret += read - ZERO_INT
        read = read()
    }

    while (read <= SPACE_INT && read != -1 && read != NL_INT) {
        mark(1)
        read = read()
    }
    if (read > SPACE_INT) {
        reset()
    }
    return if (neg) -ret else ret
}

Measured memory_bytes: 34304
n = int(input())
s = []
for i in range(n):
    s.append(list(input().split()))
    s[i] = [s[i][0] , int(s[i][1])]


t = sorted(s, key=lambda x:(x[0],-x[1]))


for j in range(n):
    for i in range(n):
        if set(s[i]) == set(t[j]):
            print(i+1)
            break


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

int findSumOfDigits(int n){
    int sum = 0;
    while(n>0){
        sum += n % 10;
        n /= 10;    
    }
     return sum;
}

int main(){
    int n,a,b;
    cin >> n >> a >> b;
    int total=0;
    for(int i=0;i<=n;i++){
        int sum = findSumOfDigits(i);
        if(sum >= a && sum <= b)
            total+=i;
    }
    cout << total << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n";
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define clt(x) 63-__builtin_clzll(x)
#define bct(x) __builtin_popcountll(x)
#define all(v) (v).begin(),(v).end()
#define pi pair<ll,ll>
#define vi vector<ll>
#define vpi vector<pair<ll,ll>>
#define maxq priority_queue<ll>
#define minq priority_queue<ll,vector<ll>, greater<ll>>
#define cont continue;
#define reto return 0;
#define sz size()
#define spmod 1116295198451
#define mod 1000000007
#define md 998244353 
#define N 300009
//typedef tree<int,null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> //pbds;

ll r[N],c[N];
set<pi> S;
vi v;
int main()
{
  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  ll h,w,m,l,q;
  cin>>h>>w>>m;
  ll mr=0,mc=0;
  while(m--)
  {
    cin>>l>>q;
    r[l]++;
    c[q]++;
    S.insert({l,q});
    mr=max(mr,r[l]);
    mc=max(mc,c[q]);
  }
  ll i=1;
  while(i<=w)
  {
    if(c[i]==mc)
    {
      v.pb(i);
    }
    i++;
  }
  i=1;
  ll ct=0;
  while(i<=h)
  {
    if(r[i]==mr)
    {
      for(auto z:v)
      {
        if(S.find({i,z})==S.end())
        {
          deb(mr+mc)
          return 0;
        }
        ct++;
      }
    }
    i++;
  }
  deb(mr+mc-1)
}

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

int main()
{
    int n; std::cin >> n;
    std::vector<std::string> s(n);
    bool b = true;
    for (int i = 0; i < n; i++) {
        std::cin >> s[i];
        if (i != 0) {
            if (s[i-1].back() != s[i].front()) {
                b = false;
            }
        }
        for (int j = 0; j < i; j++) {
            if (s[i] == s[j]) {
                b = false;
            }
        }
    }
    std::cout << (b?"Yes":"No") << std::endl;
    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

S = input().split()
S = list(S[0])
T = input().split()
T = list(T[0])
S.sort()
T.sort()
s = []
t = []
i=0
while i < len(S):
    j = i
    count=0
    while j < len(S):
        if S[i] == S[j]:
            count += 1
            j+=1
        else:
            s.append(count)
            break
    i = j
if count!=0:
    s.append(count)
i=0
while i < len(T):
    j = i
    count=0
    while j < len(T):
        if T[i] == T[j]:
            count += 1
            j+=1
        else:
            t.append(count)
            break
    i = j
if count!=0:
    t.append(count)
s.sort()
t.sort()

if s==t:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 7444