akhauriyash/Code-Regression huggingface dataset:
package main
import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
)

func Solve() {
  var A, B, N int
  NextInt(&A, &B, &N)
  x := MinInt(N, B - 1)
  Write(A * x / B)
}

func main() {
  Solve()
  Output()
}

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}
func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func SumInt(A ...int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}
func AbsInt(x int) int {
  if x < 0 { x = -x }
  return x
}

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

typedef long long ll;
typedef ll int__;
#define rep(i,j) for(int__ (i)=0;(i)<(j);(i)++)
#define repeat(i,j,k) for(int__ i=(j);i<(k);(i)++)
#define all(v) begin(v),end(v)

const int INF =1<<30;

int main()
{
  const int dx[]={-1,0,1,0};
  const int dy[]={0,1,0,-1};
  
  while(true){
    int n;
    cin>>n;
    if(n==0)break;

    map<int,pair<int,int> > data;
    vector< pair< pair<int,int> ,int> > input(n-1);
    rep(i,n-1){
      cin>>input[i].first.first>>input[i].first.second;
      input[i].second=i+1;
    }
    sort(all(input));
    
    data[0]=make_pair(0,0);
    
    rep(i,n-1){
      pair<int,int> pos=data[input[i].first.first];
      int dir=input[i].first.second;
      int nx=pos.first+dx[dir];
      int ny=pos.second+dy[dir];
      data[input[i].second]=make_pair(nx,ny);
    }

    int min_x=INF,max_x=-INF;
    int min_y=INF,max_y=-INF;
    rep(i,n){
      pair<int,int> pos=data[i];
      min_y=min(min_y,pos.second);
      max_y=max(max_y,pos.second);
      min_x=min(min_x,pos.first);
      max_x=max(max_x,pos.first);
    }

    //printf("x [%d:%d]\n",min_x,max_x);
    //printf("y [%d:%d]\n",min_y,max_y);
    
    
    cout<< max_x-min_x +1<<" "<<max_y-min_y+1<<endl;
    
  }
  
  return 0;
}

Measured memory_bytes: 1216
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include<cmath>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define deb(x) cerr<<#x<<" "<<x<<"\n"
#define debi cerr<<"hey sparky\n"
#define x first
#define y second
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define newline cout<<"\n"
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define INF (ll)1e14+5
#define nax (ll)2e5+3
#define eps (double)1e-9
#define all(x) x.begin(),x.end()
 
using namespace std;
using namespace __gnu_pbds; 
typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> pdbs;
// look for  all edge cases
//search for a pattern
int n;
vector<ll> v(3003);

ll dp[3003][3003][3];

ll solve(int start,int end,int player){

	if(start > end){
		debi;
		return -1;
	}
	
	if(dp[start][end][player] != INF){
		return dp[start][end][player];
	}
	
	if(start == end){
		if(player == 1){
			
			dp[start][end][player] = v[start];
			return v[start];
		}
		else{
			dp[start][end][player] = v[start];
			return v[start];
		}
	}
	
	
	// case when player is taro 
	if(player == 1){
		ll val = 0;
		ll temp1 = v[start] - solve(start+1,end,2);
		ll temp2 = v[end] - solve(start,end-1,2);
		return dp[start][end][player] = max(temp1,temp2);
	}
	else{
		ll val= 0;
		ll temp1 = v[start] - solve(start+1,end,1);
		ll temp2 = v[end] - solve(start,end-1,1);
		
		return dp[start][end][player] = max(temp1,temp2);
	}
	
	
}



int main(){
	fast;
	cin >> n;
	//vector<ll> v(n+1); 
	
	for(int i = 0; i <=3002;i++){
		for(int j = 0 ; j<= 3002;j++){
			for(int k =0 ; k<3;++k){
				dp[i][j][k] = INF;
			}
		}
	}
	
	for(int i =1;i<=n;++i){
		 cin >> v[i];
	}
	ll ans = max(solve(1,n,1),solve(1,n,1));
	cout<<ans;
		
		
		
	return 0;
}

	


Measured memory_bytes: 211840
import copy
h, w, k = map(int, input().split())
a = [[] for j in range(h)]
for i in range(h):
    a[i] = [int(i) for i in input()]
ans = 0
for p in range(h):
    for q in range(w):
        cand = 0
        b = copy.deepcopy(a)
        b[p][q] = 0
        disap = True
        fall = True
        disapnum = 0
        while(disap):
            disap=False
            cur = 0
            for i in range(h):
                suc = 1
                for j in range(w-1):
                    if b[i][j] == b[i][j+1]:
                        suc += 1
                    else:
                        if suc >= k:
                            if b[i][j]:
                                disap=True
                                fall=True
                                cur += b[i][j]*suc
                            for m in range(j+1-suc, j+1):
                                b[i][m] = 0
                        suc = 1
                if suc >= k:
                    if b[i][w-1]:
                        disap=True
                        fall=True
                        cur += b[i][w-1]*suc
                    for m in range(w-suc, w):
                        b[i][m] = 0
            if disap:
                cand += cur*(2**disapnum)
                disapnum += 1
            while(fall):
                fall=False
                for i in range(1, h):
                    for j in range(w):
                        if b[i][j] == 0 and b[i-1][j]:
                            b[i][j], b[i-1][j] = b[i-1][j], b[i][j]
                            fall = True
                            disap = True
        ans = max(cand, ans)
print(ans)

Measured memory_bytes: 58332
#include<iostream>
using namespace std;
typedef long long ll;
int main(){
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	ll ans=0;
	int dp=0;
	for(int i=0; i+1<s.size() ;i++){
		if(s[i]=='A') dp++;
		else if(s[i]=='B' && s[i+1]=='C'){
			ans+=dp;
			i++;
		}
		else dp=0;
	}
	cout << ans << endl;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
//using P = pair<int, int>;
 
int main() {
  ll a;
  double b;
  cin >> a >> b;
  ll ans = b*100 +0.5;
  ans *= a;
  ans /= 100;
  cout << ans << endl;
  return 0;
}

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

using namespace std;

#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

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

const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

// #define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cout << #x << " : " << x << endl
#define LINE cout << "line : " << __LINE__ << endl
#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl;
#define STOP assert(false);
#else
#define dump(x) ;
#define LINE 	;
#define dumpV(v);
#define STOP 	;
#endif

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fi<<", "<<a.se<<')';
    return out;
  }
}



//[l, r) wo merge
set<pll> mergeSegment(const set<pll>& st) {
	set<pll> ret;
	if (st.size() == 0) return ret;
	auto p = *st.begin();
	auto it = st.begin();
	it++;
	while (it != st.end()) {
		auto tmp = *it;
		if (p.se >= tmp.fi) {
			p.fi = min(p.fi, tmp.fi);
			p.se = max(p.se, tmp.se);
		} else {
			ret.insert(p);
			p = tmp;
		}
		it++;
	}
	ret.insert(p);
	return ret;
}

int main() {
	ll a, b;
	cin >> a >> b;
	if (a == b) {
		cout << 1 << endl;
		return 0;
	}
	int r;
	int keta = 0;
	for (int i = 61; i >= 0; i--) {
		bool fa = (1LL << i)&a;
		bool fb = (1LL << i)&b;
		if (fa | fb) {
			keta = i;
			break;
		}
	}
	for (int i = keta; i >= 0; i--) {
		bool fa = ((1LL << i)&a);
		bool fb = ((1LL << i)&b);
		if (fa == fb) continue;
		if (fa) swap(a, b);
		r = i + 1;
		break;
	}
	a %= (1LL<<r);
	// cout << r << endl;
	set<pll> st;
	ll c = pow(2LL, r - 1LL);
	if (c > a) st.insert({a, c});
	int k = 0;
	for (int i = r-2; i >= 0; i--) {
		if ((1LL << i)&b) {
			k = i+1;
			break;
		}
	}
	st.insert({c, c + (ll)pow(2LL, k)});
	dump(c);
	dump(c+(ll)pow(2LL, k));
	if (c + a < c * 2) st.insert({c + a, c * 2LL});
	dumpV(st);
	st = mergeSegment(st);
	ll ans = 0LL;
	for (auto& p : st) ans += p.se - p.fi;
	cout << ans << endl;
	dump(r);dump(k);dump(c);
	dumpV(st);
	dump(a);

	return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int N=scan.nextInt();
    List<Integer> list=new ArrayList<>();
    for(int i=0;i<N;i++){
      list.add(scan.nextInt());
    }
    Collections.reverse(list);
    int count=0;
    int max=count;
      for(int j=0;j<N-1;j++){
        if(list.get(j)<=list.get(j+1)){
          count++;
        }else{
          count=0;
        }
        if(max<count){
          max=count;
      }
    }
    System.out.println(max);
  }
}

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

int main(){
  long long X; cin >> X;
  int c=0;
  long long n=100;
  while(1){
    if(n>=X){
      cout << c << endl;
      return 0;
    }
    n=floor(n*1.01+1e-10);
    c++;
  }
}

Measured memory_bytes: 3764
#include <iostream>
#include <cmath>
int main(){
  int N,K;
  int Num=0;
  std::cin >> K >> N;

  /*while(K>0){
    Num++;
    K -= pow(N,Num);
    std::cout << Num << " "<< K  << " " << pow(N,Num) << std::endl;
  }
  if(K + pow(N,Num) >=  0)
    Num++;
  */

  while(pow(N,Num) < K)
    Num++;

  if(pow(N,Num) == K)
    Num++;
  std::cout << Num << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int mod2 = 998244353;

int main() {
  int p, q, r;
  cin >> p >> q >> r;
  cout << min({p+q, q+r, r+p}) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// debug
#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl;
#define ddd(x, y, z) cerr << "(" #x "," #y "," #z "):(" << x << "," << y << "," << z << ")" << endl;
#define dump(v)              \
  cerr << #v ":[ ";          \
  for (auto macro_vi : v)    \
  {                          \
    cerr << macro_vi << " "; \
  }                          \
  cerr << "]" << endl;
#define ddump(v)                     \
  cerr << #v ":" << endl;            \
  for (auto macro_row : v)           \
  {                                  \
    cerr << "[";                     \
    for (auto macro__vi : macro_row) \
    {                                \
      cerr << macro__vi << " ";      \
    }                                \
    cerr << "]" << endl;             \
  }
#define damp(m)                                                   \
  for (auto macro_pair : m)                                       \
  {                                                               \
    cerr << macro_pair.first << ":" << macro_pair.second << endl; \
  }
#define dpair(p) cerr << #p ":" \
                      << "(" << p.first << "," << p.second << ")" << endl;
// iterate
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define itr(macro_v, i) macro_v.begin() + i
// etc
#define chmin(mi, val) mi = min(mi, val);
#define chmax(ma, val) ma = max(ma, val);
using ll = long long;

using namespace std;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  vector<int> v(0);
  cin >> n;
  rep(i, n)
  {
    char c;
    cin >> c;
    v.push_back(c - '0');
  }
  int cnt = 0;
  for (int x = 0; x <= 999; x++)
  {
    int x1 = (x / 100) % 10, x2 = (x / 10) % 10, x3 = (x / 1) % 10;
    vector<int> odr{x1, x2, x3};
    int pos = 0;
    bool ok = true;
    for (auto x : odr)
    {
      while (pos < v.size() and v[pos] != x)
        pos++;
      if (pos == v.size())
      {
        ok = false;
        break;
      }
      else
      {
        pos++;
        continue;
      }
    }
    if (ok)
    {
      cnt++;
    }
    else
    {
      continue;
    }
  }
  cout << cnt << endl;
  return 0;
}

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

int main() {
  string S, T;
  cin >> S >> T;
  int ans = T.size();
  for (int i = 0; i < S.size() - T.size() + 1; ++i) {
    int cnt = 0;
    for (int k = 0, j = i; j < i + T.size(); ++j, ++k) {
      cnt += S[j] != T[k];
    }
    ans = min(ans, cnt);
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 3704
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll n,i,p,max=-1,c=0;
  cin>>n;
  ll a[n];
  for(i=0;i<n;i++)
      {
        cin>>a[i];
      }
  p=*max_element(a,a+n);   
  for(i=0;i<n;i++)
  {
  	if(a[i]==p)
  	c++;
   }
  for(i=0;i<n;i++)
  {
    if(a[i]<p)
    {
      if(max<a[i])
      {
        max=a[i];
      }
    }
  }
if(c>1)
{
	max=p;
}
  for(i=0;i<n;i++)
  {
    if(a[i]==p)
      cout<<max<<endl;
    else
      cout<<p<<endl;
  }
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    int n, d, x; cin >> n >> d >> x;
    ll ans = 0;
    rep(i,n){
        int tmp; cin >> tmp;
        int cnt = 1;
        while(cnt <= d){
            ans++;
            cnt += tmp;
        }
    }

    cout << ans + x << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <set>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>

using namespace std;

char sir[5005];
char pp[5005];
int K;
set <string> myset;
vector <string> v;
int main() {
    cin >> sir;

    int lg = strlen(sir);
    cin >> K;

    for(int oLungime = 1; oLungime <= 5; ++oLungime) {
        for(int pos = 0; pos < lg - oLungime + 1; ++pos) {
            string rr = "";
            for(int parc = pos; parc <= pos + oLungime - 1; ++parc) {
                rr = rr + char(sir[parc]);
            }
            if(myset.find(rr) == myset.end()) {
                myset.insert(rr);
                v.push_back(rr);
            }
        }
    }

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

    cout << v[K - 1] << '\n';

    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll op(ll n) {
	ll k = n/2;
	if(n%2) {
		return k*(k+1);
	} else {
		return k*k;
	}
}
ll get(ll val) {
	ll s = 0, e = 3e9;
	ll ls = 0;
	while(s <= e) {
		ll m = (s+e)/2;
		if(op(m) >= val) {
			e = m-1;
		} else {
			ls = m;
			s = m+1;
		}
	}
	return ls;
}
int main() {
	ll q;
	scanf("%lld",&q);
	while(q--) {
		ll a,b;
		scanf("%lld %lld",&a,&b);
		ll tot = a*b;
		ll res = get(tot)-2;
		if(a == b) {res = 2*a-2;}
		printf("%lld\n",res);
	}
}

Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Console;

namespace AtCoder_1
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = CinL();
            var a = CinLAr();
            var all = a.Sum();
            long t = 0;
            for(int i = 1;i < N; i += 2)
            {
                t += 2 * a[i];
            }
            long fm = all - t;
            Write(fm);
            long bm = fm;
            for(int i = 1; i < N; i++)
            {
                long nm = a[i - 1] * 2 - bm;
                bm = nm;
                Write(" " + bm);
            }

            Cin();
        }


        static string Cin() { return ReadLine(); }
        static string[] CinAr() { return ReadLine().Split(' '); }
        static int CinT() { return S2i(Cin()); }
        static int[] CinTAr() { return CinAr().Select((x, i) => { return S2i(x); }).ToArray(); }
        static long CinL() { return S2L(Cin()); }
        static long[] CinLAr() { return CinAr().Select((x, i) => { return S2L(x); }).ToArray(); }
        static double CinD() { return S2D(Cin()); }
        static double[] CinDAr() { return CinAr().Select((x, i) => { return S2D(x); }).ToArray(); }
        static int S2i(string s) { return int.Parse(s); }
        static long S2L(string s) { return long.Parse(s); }
        static double S2D(string s) { return double.Parse(s); }
        static void Cout(object s) { WriteLine(s); }
        static void CoutAr<Type>(IEnumerable<Type> types)
        {
            string text = "";
            foreach (var i in types)
            {
                text += " " + i;
            }
            WriteLine(text.Substring(1));
        }
    }
}


Measured memory_bytes: 29788
//52行目から編集
#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <cassert>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvl;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

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

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(20);
    string s;cin >> s;
    if(s[3] == s[2] and s[5] == s[4])cout << "Yes" << '\n';
    else cout << "No" << '\n';
    return 0;
}
/*
 *!!CHECK!! 
 * intの掛け算をしてる場合：overflowは大丈夫？
 * 制約の下限・上限は大丈夫？
 * 木構造は一直線にした時TLEしない？
 * */


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define P(type,x,y) fprintf(stdout,#x" %"#type"\n",x*100/y)

int main() {
	int h, m, M, lunch, dinner, midnight, n, cl, cd, cm;
	
	for (; fscanf(stdin, "%d", &n), n != 0; ) {
		lunch = dinner = midnight = cl = cd = cm = 0;
		while (n--) {
			fscanf(stdin, "%d%*c%d%d", &h, &m, &M);
			if (m > M) M += 60;
			if (11 <= h&&h < 15) { cl++; if(M - m <= 8)lunch++;}
			else if (18 <= h&&h < 21) { cd++; if (M - m <= 8)dinner++; }
			else if (h < 2 || 21 <= h) { cm++; if (M - m <= 8)midnight++; }
		}
		if (cl) P(d,lunch,cl);
		else puts("lunch no guest");
		if (cd) P(d, dinner,cd);
		else puts("dinner no guest");
		if (cl) P(d, midnight,cm);
		else puts("midnight no guest");
	}
	return 0;
}

Measured memory_bytes: 616
import fractions
mod = 10 ** 9 + 7

def lcm(a,b):
    return (a * b) // fractions.gcd(a, b)

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

LCM = 1
for i in a:
    LCM = lcm(LCM,i)

ans = 0
for i in a:
    ans += LCM // i
print(ans % mod)



Measured memory_bytes: 82144
//

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

int main(){
	string N;
	cin >> N;

	string ans;
	if (N[0] == '7' || N[1] == '7' || N[2] == '7') ans = "Yes";
	else ans = "No";

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3620
#include<stdio.h>
int sum(int a,int b){
  return a+b;}
int main(){
  int n,x,i,s;
  scanf("%d%d",&n,&x);
  int L[n],c=1;
  s=0;
  for(i=0;i<n;i++){
    scanf("%d",&L[i]);
    s=sum(s,L[i]);
    if(x+1>s)
      c++;
  }
  printf("%d\n",c);
  return 0;}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include<chrono>
using namespace std;
using namespace std::chrono;
using namespace __gnu_pbds; 
#define lli long long int
#define fr(i,a,b) for(lli i=a;i<b;i++)
#define bfr(i,a,b) for(lli i=a;i>=b;i--)
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL),cout.tie(NULL);
#define tc int t;cin>>t;while(t--)
#define mod 1000000007LL
#define mod2 998244353LL
#define all(vec) vec.begin(),vec.end()  
#define ld long double
#define pb push_back
#define ordered_set tree<lli, null_type,less<lli>, rb_tree_tag,tree_order_statistics_node_update> 


int main()
{
    
                        
     fio

      lli l,r,d,cnt=0;
      cin>>l>>r>>d;
      fr(i,l,r+1)
      if(i%d==0)cnt++;
      cout<<cnt<<'\n';

     

     
    
      
      



     



     


     
    
     




      
     

     
              


return 0;}    


Measured memory_bytes: 3608
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<iostream>
using namespace std;
long long int lcm(long long int a,long long int b){
  long long int n;
  n=a*b/__gcd(a,b);
  return n;
}
using ll =long long int;
#define ci(a) cin>>a
#define co(a) cout<<a<<endl
#define gcd(a,b) __gcd(a,b)
#define vec vector<ll>
#define for(i,a,b) for(int i=a;i<b;i++)
#define sort(a,b) sort(a.begin(),b.end())
//gcd 最大公約数
//lcm 最小公倍数
//double 少数（変数）
//string 文字列（変数）
//sqrt 平方根
//ceil 天井関数
//floor 床関数
//abs 絶対値
//pow 累乗
//cbrt  立方根
//hypot 平方和の平方根
//(string-'0') 文字列を数字に変換
//vector<vector<int>> data(a,vector<b>(b)) a×b行列
//for(int i=0;i<a;i++)
//for(int j=0;j<b;j++)
//cin>>data.at(i).at(j)  a×b行列の入力
//floor(log10(a)+1) aの10進法での桁数

int main() {
  string a;
  ci(a);
  ll b=a.size();
  co(a[0]<<b-2<<a[b-1]);
  }

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define revrep(i, n) for(ll i = (n)-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
/*
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll max3(ll a, ll b, ll c){return max(a, max(b, c));};
ll min3(ll a, ll b, ll c){return min(a, min(b, c));};
ll max4(ll a, ll b, ll c, ll d){return max(max(a, b), min(c, d));};
ll min4(ll a, ll b, ll c, ll d){return min(min(a, b), min(c, d));};
ll max5(ll a, ll b, ll c, ll d, ll e){return max(max(a, b), max3(c, d, e));};
ll min5(ll a, ll b, ll c, ll d, ll e){return min(min(a, b), min3(c, d, e));};
*/
const ll INFL = 1LL << 60;//10^18 = 2^60
const int INF = 1 << 30;//10^9
ll MOD = 1000000007;
//ll MOD = 998244353;

vector<ll> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0};


ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}
ll pow_mod(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}

ll inverse(ll x){return pow_mod(x, MOD - 2);};

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

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

ll kai_mod(ll x){
  if(x == 0) return 1;
  return x * kai_mod(x-1) % MOD;
}


//コンビネーション
const int MAXcomb = 200010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAXcomb; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
ll comb(int n, int k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * finv[k] % MOD * finv[n-k] % MOD;
}


bool f(string S, ll x){
  ll sl = S.size();
  for(ll i = sl-x; i < x-1; i++){
    if(S[i] != S[i+1]) return false;
  }
  return true;
}

int main(){
  string S;
  cin >> S;
  ll ok = S.size() / 2, ng = S.size() + 1;
  while(ng - ok > 1){
    ll mid = (ng + ok) / 2;
    if(f(S, mid)) ok = mid;
    else ng = mid;
  }
  cout << ok << endl;
}


Measured memory_bytes: 512
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main(){
    int n;
    cin >> n;
    vector<int> d(n);
    rep(i,n) cin >> d[i];
    int m = 0;
    rep(i,n){
        rep(j,n){
            if(i != j){m += d[i]*d[j];}
        }
    }
    cout << m/2 <<"\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define db "Kangaroo"
#define fi first
#define se second
#define endl '\n'
#define int long long
const int INF = 1e18 + 1;
const int mod = 1e9 + 7;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<PII, int> PII2;
typedef pair<int, PII> PII3;
typedef pair<PII, PII> PII4;

void docfile()
{
    if (ifstream("FORM.inp"))
    {
        freopen("FORM.inp", "r", stdin);
        freopen("FORM.out", "w", stdout);
    }
    else if (ifstream(db".inp"))
    {
        freopen(db".inp", "r", stdin);
        freopen(db".out", "w", stdout);
    }
}


//---------------------------------------------------------------------------
const int N = 16 + 5;
int n, a[N][N], dp[100000], sum[100000];

void input()
{
    cin >> n;
    for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
    cin >> a[i][j];
}

int cal(int x)
{
    if(sum[x] != -INF) return sum[x];
    int res = 0;
    vector <int> v;
    for(int i = 0; i < n; i++) if((1<<i)&x) v.push_back(i);
    for(int i = 0; i < v.size(); i++)
    for(int j = i+1; j < v.size(); j++)
    res += a[v[i]][v[j]];
    sum[x] = res;
    return res;
}

void solve()
{
    int m = (1<<n);
    for(int j = 0; j < m; j++) sum[j] = -INF;
    for(int j = 0; j < m; j++)
    {
        for(int k = j; ; k = (j&(k-1)))
        {
            int k2 = j^k;
            dp[j] = max(dp[j], dp[k] + cal(k2));
            if(k == 0) break;
        }
    }
    cout << dp[m-1];
}

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

    //int test = 1; cin >> test; while(test--) {input(); solve();}
    input(); solve();
}


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

/*
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
    while (c >= '0' && c <= '9') {x = x * 10 + c - '0'; c = getchar();}
    return x * f;
}
void write(int x)
{
    if (x > 9) write(x / 10);
    putchar(x % 10 + '0');
}
*/


Measured memory_bytes: 4680
#include <iostream>
#define LENGTH 1000000
#define TEST cout << endl << "test "
using namespace std;

int main(void){
  int list[LENGTH],head = 2000000,tail = 2000000,n,temp;
  char command[17];
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> command;
    if(command[0] == 'i'){
      cin >> temp;
      head--;
      list[head % LENGTH] = temp;
    }
    else if(command[6] == '\0'){
      cin >> temp;
      for(int j = head % LENGTH; j % LENGTH != tail % LENGTH; j++){
        if(list[j % LENGTH] == temp){
          for(int k = j % LENGTH; k % LENGTH != tail % LENGTH; k++)list[k] = list[k + 1];
          tail--;
          break;
        }
      }
    }
    else if(command[6] == 'F'){
      head++;
    }
    else if(command[6] == 'L'){
      tail--;
    }
  }

  for(int i = head % LENGTH; i % LENGTH != tail % LENGTH; i++){
    if(i != head % LENGTH)cout << ' ';
    cout << list[i % LENGTH];
  }
  cout << endl;
  return 0;
}



Measured memory_bytes: 6916
using System;
using System.Collections.Generic;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("cabacc");
            WillReturn.Add("abc");
            //1
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("codeforces");
            WillReturn.Add("atcoder");
            //6
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("");
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        string S = InputList[0];
        string T = InputList[1];

        int UB_S = S.Length - 1;
        int UB_T = T.Length - 1;
        int Answer = int.MaxValue;
        for (int I = 0; I <= UB_S; I++) {
            if (I + T.Length - 1 > UB_S) break;

            int ReplaceCnt = 0;
            for (int J = 0; J <= UB_T; J++) {
                if (S[I + J] != T[J]) {
                    ReplaceCnt++;
                }
            }
            //Console.WriteLine("I={0},ReplaceCnt={1}", I, ReplaceCnt);
            Answer = Math.Min(Answer, ReplaceCnt);
        }
        Console.WriteLine(Answer);
    }
}


Measured memory_bytes: 26228
N,K = map(int,input().split())
S = list(input())
K -= 1
if S[K] == 'A':
    S[K] = 'a'
elif S[K] == 'B':
    S[K] = 'b'
elif S[K] == 'C':
    S[K] = 'c'
print(''.join(S))

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

const int base = 26;

int main()
{
    string s;
    long long N, a;
    int c = 0;
    cin >> N;
    vector<int> x26;
    while(1)
    {
        N--;
        a = N % base;
        x26.push_back( a );
        if(N < base) break;
        N /= base;
        ++c;
    }
    int num = x26.size();

    for(int i = 0;i < num; ++i)
    {
        s.push_back('a' + x26[i]);
    }
    reverse(s.begin(), s.end());
    for(char c : s) cout << c;
    cout << endl;
}


Measured memory_bytes: 3628
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(X))
#define all(X) (X).begin(), (X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define print(x) cout << x << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void solve(long long N, std::vector<long long> u, std::vector<long long> v,
           std::vector<long long> w) {

  vector<bool> checked(N + 1);
  map<ll, vector<pair<ll, ll>>> edges;

  rep(n, N) {
    edges[u[n]].push_back({v[n], w[n]});
    edges[v[n]].push_back({u[n], w[n]});
  }

  queue<ll> que;
  que.push(1);
  checked[1] = true;
  vector<ll> color(N + 1);
  color[1] = 0;
  while (!que.empty()) {
    ll from = que.front();
    auto edgeCosts = edges[from];
    que.pop();

    for (auto iter = edgeCosts.begin(); iter != edgeCosts.end(); iter++) {
      ll to = iter->first;
      ll w = iter->second;

      if (!checked[to]) {
        if (w % 2 == 0) {
          color[to] = color[from];
        } else {
          color[to] = 1 - color[from];
        }

        checked[to] = true;
        que.push(to);
      }
    }
  }

  for (ll i = 1; i <= N; i++) {
    print(color[i]);
  }
}

int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> u(N - 1);
  std::vector<long long> v(N - 1);
  std::vector<long long> w(N - 1);
  for (int i = 0; i < N - 1; i++) {
    scanf("%lld", &u[i]);
    scanf("%lld", &v[i]);
    scanf("%lld", &w[i]);
  }
  solve(N, std::move(u), std::move(v), std::move(w));
  return 0;
}


Measured memory_bytes: 16512
h,w=map(int,input().split())
A=[]
for _ in range(h):
    A.append(list(map(int,input().split())))
n=0
B=[]
for i in range(h):
    if i%2==0:
        for j in range(w):
            if A[i][j]%2==1:
                if j!=w-1:
                    A[i][j]-=1
                    A[i][j+1]+=1
                    n+=1
                    B.append([i+1,j+1,i+1,j+2])
                elif i!=h-1:
                    A[i][j]-=1
                    A[i+1][j]+=1
                    n+=1
                    B.append([i+1,j+1,i+2,j+1])
    else:
        for j in range(w):
            if A[i][w-j-1]%2==1:
                if j!=w-1:
                    A[i][w-j-1]-=1
                    A[i][w-j-2]+=1
                    n+=1
                    B.append([i+1,w-j,i+1,w-j-1])
                elif i!=h-1:
                    A[i][w-j-1]-=1
                    A[i+1][w-j-1]+=1
                    n+=1
                    B.append([i+1,w-j,i+2,w-j])
print(n)
for i in range(n):
    print(' '.join(map(str,B[i])))

Measured memory_bytes: 30524
#include <iostream>

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <tuple>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

using namespace std;

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

//math
//-------------------------------------------
template <class T>
inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

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

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0, sizeof(a))

//debug
// #define dump(x) cerr << #x << " = " << (x) << endl;
// #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
//                       << " " << __FILE__ << endl;

int main()
{
    long long L, R;

    cin >> L >> R;

    if (R - L + 1 >= 2019)
    {
        cout << 0 << endl;
        return 0;
    }

    int res = INT_MAX;
    for (LL i = L; i < R + 1; i++)
    {
        for (LL j = i + 1; j < R + 1; j++)
        {
            res = min(int((i * j) % 2019), res);
        }
    }

    cout << res << endl;
}

Measured memory_bytes: 256
n = int(input())
a =[chr(ord('a') + i) for i in range(26)]
ans = [10000]*26
for i in range(n):
    hindo = [0]*26
    s = input()
    for j in range(len(s)):
        hindo[a.index(s[j])] += 1
    for j in range(26):
        ans[j] = min(ans[j], hindo[j])
ans_ar = []
for i in range(26):
    tar = ans[i]
    for j in range(ans[i]):
        ans_ar.append(a[i])
print("".join(ans_ar))



Measured memory_bytes: 3064
import math
N = int(input())
MOD = 10**9+7

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

primes = dict()
for a in range(2,N+1):
    c = prime_factorize(a)
    if len(c) == 1:
        i = 1
        cnt = 0
        while a**i<=N:
            cnt += (N//a**i)
            i += 1
        primes[a] = cnt
ans = 1
for i in primes.values():
    ans *= (i+1)
    ans%= MOD
print(ans)

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

struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) { }
  bool unionSet(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool findSet(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};

int main()
{
	int V, E;
	cin >> V >> E;
	vector<tuple<int, int, int>> edge( E );
	for( int i = 0; i < E; i++ ) {
		int s, t, w;
		cin >> s >> t >> w;
		edge[i] = make_tuple( w, s, t );
	}

	int ans = 0;
	sort( edge.begin(), edge.end() );
	UnionFind uf( V );
	for( int i = 0; i < E; i++ ) {
		int s, t, w;
		tie( w, s, t ) = edge[i];
		if( uf.findSet( s, t ) ) continue;
		uf.unionSet( s, t );
		ans += w;
	}

	cout << ans << endl;
}



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

int main() {
  std::string s, t;
  std::cin >> s >> t;
  
  std::sort(s.begin(), s.end());
  std::sort(t.begin(), t.end());
  std::reverse(t.begin(), t.end());
  
  if (s < t) {
    std::cout << "Yes\n";
  } else {
    std::cout << "No\n";
  }
}

Measured memory_bytes: 256
//Reference : editorial
// This is the template example file for programming//
#include<bits/stdc++.h>
//macros
using namespace std;
typedef long long ll;
typedef pair<int, int > Pii;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
typedef vector<ll> Vll;
#define pb push_back
#define rs resize 
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define repll(i, a, b) for(ll i=(a); i<(b); i++)
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define COUT(a) cout << a << endl
#define ALL(a) (a).begin(),(a).end()
const long long int mod = 1e9 + 7;

int N;
vector<Vi > to;
Vi dist;

void dfs(int v, int d=0, int p=-1){
    //今の頂点、距離、親
    dist[v]=d;
    for(int u : to[v]){
        if(u==p) continue;
        dfs(u,d+1,v);
    }
}

Vi calcDist(int s){
    dist = vector<int>(N);
    dfs(s);
    return dist;
}


int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);  
    int u,v;   
    cin >> N >> u >> v;
    u--;v--;
    to.rs(N);
    rep(i,0,N-1){
        int temp1,temp2;
        cin >> temp1 >> temp2;
        temp1--;temp2--;
        to[temp1].pb(temp2);
        to[temp2].pb(temp1);
    }
    //Sからの距離がTからの距離よりも小さく、かつTからの距離が最大のところに行きたい
    Vi distS = calcDist(u);
    Vi distT = calcDist(v);

    int mx=0;
    rep(i,0,N){
        if(distS[i]<distT[i]) mx = max(mx, distT[i]);
    }
    int ans = mx-1;
    COUT(ans);
}

Measured memory_bytes: 10744
//AcFreak

#include<bits/stdc++.h>
#define lint long long int 
#define mp make_pair
#define pb push_back
#define f first
#define INF (lint )(1e9)
#define __ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define s second
#define endl '\n'
#define pii pair<int,int >
using namespace std;
struct pair_hash {
    template <class T1, class T2>
    std::size_t operator () (const std::pair<T1,T2> &p) const {
        auto h1 = std::hash<T1>{}(p.first);
        auto h2 = std::hash<T2>{}(p.second);
        
        return h1 ^ h2;  
    }
};
int main()
{__

      int a,b;
      cin>>a>>b;
      
      cout<<(a*b)+1-a-b<<endl;
      return 0;
}

Measured memory_bytes: 896
#include<stdio.h>
#include<stdlib.h>
int sum_of_digit(int );
int fun(int ,int ,int );
int sum_of_digit(int n)
{
    int sum=0;
    while(n)
    {
        sum=sum+n%10;
        n=n/10;
    }
    return sum;
}
int fun(int n,int A,int  B)
{
    int i,ans=0;
    for(i=1;i<=n;i++)
    {
        if(sum_of_digit(i)>=A&&sum_of_digit(i)<=B)
        {
            ans=ans+i;
        }
    }
    return ans;
}
int main()
{
    int n,A,B;
    scanf("%d%d%d",&n,&A,&B);
    printf("%d\n",fun(n,A,B));
    return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        System.out.print(scanner.next().toUpperCase().charAt(0));
        System.out.print(scanner.next().toUpperCase().charAt(0));
        System.out.println(scanner.next().toUpperCase().charAt(0));
    }
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (a < b) {
    ll tmp = a;
    a = b;
    b = tmp;
  }
  ll r = a%b;
  while(r != 0) {
    a = b;
    b = r;
    r = a%b;
  }
  return b;
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}

int main() {
    double r;
    cin >> r;
    cout << fixed << setprecision(10);
    cout << M_PI*r*r << ' ' << 2*r*M_PI << endl;
}


Measured memory_bytes: 3292
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
using namespace std;

typedef pair<int,int> pii;
typedef long long ll;

int main(){
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	int a,b;
	cin >> a >> b;
	if(a == 1)a += 13;
	if(b == 1)b += 13;
	if(a == b){
		cout << "Draw" << '\n';
	}
	else{
		cout << (a < b ? "Bob" : "Alice") << '\n';
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    int counter1=0,counter2=0;
    if(a==5)counter1++;
    if(b==5)counter1++;
    if(c==5)counter1++;
    if(a==7)counter2++;
    if(b==7)counter2++;
    if(c==7)counter2++;
    if(counter1==2&&counter2==1)cout<<"YES";
    else cout<<"NO";

    return 0 ;
}


Measured memory_bytes: 256
function Main(input) {
	input = input.split('\n');
	var input0 = input[0].split(' ');
	var input1 = input[1].split(' ');
	var N = parseInt(input0[0], 10);
	var K = parseInt(input0[1], 10);
	var h = input1;

	var results = [];
	for (var i = 0; i < N; i++) {
		if (parseInt(h[i], 10) >= K) {
			results.push(h[i]);
		}
	}
	console.log(results.length);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

typedef long long ll;

class UnionFInd {
	
public:
	vector<int>Parent;

	UnionFInd(int n) {
		Parent = vector<int>(n, -1);
	}

	int root(int x) {
		if (Parent[x] < 0)return x;
		return Parent[x] = root(Parent[x]);
	}

	int size(int x) {
		return -Parent[root(x)];
	}

	bool connect(int a, int b) {
		a = root(a);
		b = root(b);
		if (a == b)return false;
		if (size(a) < size(b))swap(a, b);

		Parent[a] += Parent[b];
		Parent[b] = a;
		return true;
	}

};

int main() {
	ll n, m; cin >> n >> m;
	vector<ll>a(m), b(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
	}

	vector<ll>ans(m);
	ans[m - 1] = n * (n - 1) / 2;

	UnionFInd Uni(n);
	for (int i = m - 1; i >= 1; i--) {
		ans[i - 1] = ans[i];
		if (Uni.root(a[i]) != Uni.root(b[i])) {
			ans[i - 1] -= (ll)Uni.size(a[i]) * Uni.size(b[i]);
			Uni.connect(a[i], b[i]);
		}
	}
	for (auto&& x : ans)cout << x << endl;

	return 0;
}

Measured memory_bytes: 4096
package main

import (
	"fmt"
	"sort"
)

func main() {

	var L,R int

	fmt.Scan(&L,&R)
  
  	if R-L >= 2019{

		fmt.Println(0)

		return
	}

	var res[]int 

	for i:=L;i<=R;i++{

		for j:=i+1;j<=R;j++{

			res = append(res, (i*j)%2019)
		}
	}

	sort.Sort(sort.IntSlice(res))

	fmt.Println(res[0])

}


//SliceInt 引数サイズのSliceを返す
func SliceInt(a int) []int {

	IntSample := make([]int, a)

	return IntSample

}


Measured memory_bytes: 35456
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc133/tasks/abc133_c>
 問題文============================================================
 =================================================================
 解説=============================================================
 iかjのどちらかが2019の倍数になれば答えは自明に0
 よって、2019周期でしか値を見なくていい為、見るべき範囲は[L,min(L+2019,R)]でいい。
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    res = LINF;
    ll L,R; cin >> L >> R;
    for(ll i = L; i <= min(L+2019,R); i++){
        for(ll j = i+1; j <= min(L+2019,R); j++){
            res = min(res,i*j%2019);
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 256