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

using namespace std;

#define boost                         \
    ios_base::sync_with_stdio(false); \
    fin.tie(NULL);                    \
    fout.tie(NULL);
#define ll long long int
// #define int ll
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<ll, ll>
#define vii vector<pii>
#define pb push_back
#define B begin()
#define E end()
#define sz(A) (ll)(A).size()
#define F first
#define S second
#define loop(z, v) for (auto &z : v)
#define sp << ' ' <<
#define sps << ' '
#define nl "\n"
// #define nl endl
#define fat 1000000007
// #define fat 998244353
#define PI_2 1.57079632679489661923

int main()
{
    // boost;
    // ifstream fin;
    // fin.open("./fb_d1.txt");
    // ofstream fout;
    // fout.open("./d1_out.txt");

    time_t tic, toc;
    ll tt = 1, n, m, k = 0, i, j, p, q;
    ll a, b, c, h, w, u, v, x, y, t;
    ll l = 0, r = 0;
    ll ans = 0;

    bool poss = true;

    string s;

    // cin >> tt;
    tic = clock();
    for(int _ = 1; _ <= tt; _++){
        // cout << "Case #" << _ << ": ";
        cin >> n >> a;
        a = a*a;

        ans = 0;
        for(i = 0; i < n; i++){
            cin >> x >> y;
            if(a >= x*x + y*y) ans++;
        } 
        cout << ans << nl;   
    }
    // fin.close();
    // fout.close();
    // cerr << (clock() - tic*1.0) / CLOCKS_PER_SEC << nl;
    return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <list>

using namespace std;
typedef long long ll;
ll inf = 1001001001001;
int main() {
    // 頂点数と辺数
    int N, M;
  	ll L;
  	cin >> N >> M >> L;
  	vector<vector<ll>> dist(N,vector<ll>(N));
  	vector<vector<ll>> route(N,vector<ll>(N));
  
  	for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        route.at(i).at(j) = i;
        if(i == j){
          dist.at(i).at(j) = 0;
        }else{
	        dist.at(i).at(j) = inf;
        }
      }
    }
  
  	for(int i=0;i<M;i++){
      int a,b;
      ll c;
      cin >> a >> b >> c;
      dist.at(a-1).at(b-1) = c;
      dist.at(b-1).at(a-1) = c;
    }

    /*
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        cout << dist.at(i).at(j) << " ";
      }
      cout << endl;
    }
    */
  
  	for(int k=0;k<N;k++){
      for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
          if(dist.at(i).at(j) > dist.at(i).at(k) + dist.at(k).at(j)){
            dist.at(i).at(j) = dist.at(i).at(k) + dist.at(k).at(j);
            //route.at(i).at(j) = route.at(k).at(k);
          }
        }
      }
    }
  	
    /*
  	for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        cout << dist.at(i).at(j) << " ";
      }
      cout << endl;
    }
    */

    vector<vector<ll>> gas(N,vector<ll>(N));

    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(i == j){
                gas.at(i).at(j) = 0;
            }else if(dist.at(i).at(j) <= L){
                gas.at(i).at(j) = 1;
            }else{
                gas.at(i).at(j) = inf;
            }
        }
    }

    for(int k=0;k<N;k++){
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++){
                if(gas.at(i).at(j) > gas.at(i).at(k) + gas.at(k).at(j)){
                    gas.at(i).at(j) = gas.at(i).at(k) + gas.at(k).at(j);
                }
            }
        }
    }

    /*
  	for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        cout << gas.at(i).at(j) << " ";
      }
      cout << endl;
    }
    */

  	int Q;
  	cin >> Q;
  	
  	for(int i=0;i<Q;i++){
      int s,t;
      cin >> s >> t;
      s--;
      t--;
      if(gas.at(s).at(t) < inf){
          cout << gas.at(s).at(t)-1 << endl;
      }else{
          cout << -1 << endl;
      }
    }

 	return(0);
}

Measured memory_bytes: 5748
#include <stdio.h>
#include <math.h>
unsigned GetDigit(unsigned num)
{
    return log10(num) + 1;
}

int main()
{
    int a, b, c;
    scanf("%d %d", &a, &b);
    a *= pow(10,GetDigit(b));
    a+= b;
    c = (int)sqrt((double)a);
    if (c * c == a)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
string s[3];
int main(){
	for(int i=0;i<3;i++) cin >> s[i], reverse(s[i].begin(),s[i].end());
	int cur = 0;
	while(s[cur]!=""){
		int ccur = s[cur].back()-'a';
		s[cur].pop_back();
		cur = ccur;
	}
	cout << (char)(cur+'A') << endl;
	return 0;
}


Measured memory_bytes: 256
///スマホコーディング
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
typedef long long ll;
const int inf=1e9;
int main(){
  int x,y;cin>>x>>y;
  if(x==2||y==2)cout<<"No"<<endl;
  else{
  vector<int> v={4,6,9,11};
  int f=0;int f2=0;
  rep(i,4)if(v[i]==x)f=1;
  rep(i,4)if(v[i]==y)f2=1;
  if(f==1&&f2==1)cout<<"Yes"<<endl;
  else{
    if(f==1||f2==1)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
  }
  return 0;
}


Measured memory_bytes: 256
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using Pair = pair<int64_t, int64_t>;
constexpr int64_t kInf = INT64_MAX / 2L;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  int64_t N, X, M;
  cin >> N >> X >> M;
  vector<int64_t> order(M, -1);
  int64_t a = X;
  int64_t index = 0;
  int64_t P = 0, Q = 0;
  vector<int64_t> sequences;
  while (true) {
    if (order[a] >= 0) {
      P = order[a];
      Q = index - P;
      break;
    } else {
      order[a] = index;
      sequences.emplace_back(a);
      a = (a * a) % M;
      index++;
    }
  }
  int64_t cycle_sum = 0;
  for (int64_t i = P; i < P + Q; ++i) {
    cycle_sum += sequences[i];
  }

  int64_t result = 0;
  for (int64_t i = 0; i < min(P, N); ++i) {
    result += sequences[i];
  }

  result += ((N - P) / Q) * cycle_sum;
  int64_t residu = ((N - P) % Q) + P;
  for (int64_t i = P; i < residu; ++i) {
    result += sequences[i];
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 4636
//PLUS ULTRA
//one who atops 

#include<bits/stdc++.h>
using namespace std;
     
     
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back 
#define mp make_pair
#define forn(i,st,n) for(int i = st; i < n ; i++)
#define nfor(i,st,n) for(int i = st; i >= n ; i--)
#define ss second
#define ff first
#define ll long long 

typedef pair <int , int> pii;

const int N = 1e5 + 10 , mod =  1000000007;

void solve(){
    int s , w;

    cin >> s >> w;

    if(w >= s)cout << "unsafe";
    else cout << "safe";



}

int main(){
    SPEED;

   solve();



    

    return 0;
}
      
       


Measured memory_bytes: 3608
#include<iostream>
#include<vector>
#include<algorithm>
#define f first
#define s second

using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long ll;
typedef pair<int,int> P;

mat mul(mat &A,mat &B){
  mat C(A.size(),vec(B[0].size()));
  for(int i=0;i<A.size();i++)
    for(int k=0;k<B.size();k++)
      for(int j=0;j<B[0].size();j++)
	C[i][j]=(C[i][j]+A[i][k]*B[k][j]);

  return C;
} 

mat pow(mat A,ll n){
  mat B(A.size(),vec(A.size()));
  for(int i=0;i<A.size();i++)B[i][i]=1;
  while(n>0){
    if(n&1)B=mul(B,A);
    A=mul(A,A);
    n>>=1;
  }
  return B;
}

int main(void){

  int n,m,z,s,d;
  vector<P>G;

  while(cin >> n >> m >> z,n|m|z){
    G.clear();
    G.push_back(P(1,1));
    for(int i=0;i<m;i++){
      cin >> s >> d;
      G.push_back(P(s,d));
      G.push_back(P(d,s));
    }

    mat A(G.size(),vec(G.size()));
 
    for(int i=0;i<G.size();i++)
      for(int j=1;j<G.size();j++)
	if(i!=j && G[i].f!=G[j].s && G[i].s==G[j].f)A[i][j]=1;

    A=pow(A,z);

    bool fg=false;
    for(int i=0;i<A.size();i++)
      if(G[i].s==n && A[0][i])fg=true;

    cout << (fg?"yes":"no") << endl;
  }
  return 0;
}

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

int main(void)
{
    int n;
    cin >> n;
    while(n>1000){
        n-=1000;
    }
    int ans=-(n-1000);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
use io::*;
use std::*;

fn solve(N: i64, D: i64, X: Vec<Vec<i64>>) {
    let mut ans = 0;
    for i in 0..N as usize {
        for j in (i+1)..N as usize{
            let y = &X[i];
            let z = &X[j];
            if i == j { continue };
            let mut dist = 0;
            for d in 0..D as usize {
                dist += (y[d] - z[d]).pow(2);
            }
            let dist = dist as f32;
            if dist.sqrt().fract() == 0.0 {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
fn main() {
    let con = read_string();
    let mut scanner = Scanner::new(&con);
    let mut N: i64;
    N = scanner.next();
    let mut D: i64;
    D = scanner.next();
    let mut X: Vec<Vec<i64>> = vec![vec![0i64; (D) as usize]; (N) as usize];
    for i in 0..(N) as usize {
        for j in 0..(D) as usize {
            X[i][j] = scanner.next();
        }
    }
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(move || solve(N, D, X)).unwrap().join().unwrap();
}

pub mod io {
    use std;
    use std::str::FromStr;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }

        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }

        pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
    }

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}


Measured memory_bytes: 8572
a,b  = map(int, raw_input().split())
A = [map(int, raw_input().split()) for _ in xrange(a)]
B = [input() for _ in xrange(b)]
C = [sum([A[i][j] * B[j] for j in xrange(b)]) for i in xrange(a)]
for x in C:
    print x

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

using namespace std;
using ll = long long;
using ld = long double;

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

  int ans = 0;
  int h, w, K;
  cin >> h >> w >> K;

  // int bl = 0;
  vector<vector<char>> ve(h, vector<char>(w));
  for(int i = 0; i < h; i++) {
    for(int j = 0; j < w; j++) {
      cin >> ve[i][j];
      // if(ve[i][j] == '#')
      //   bl++;
    }
  }

  int mh = (1 << h) - 1;
  int mw = (1 << w) - 1;
  for(int i = 0; i <= mh; i++) {
    for(int j = 0; j <= mw; j++) {
      vector<vector<char>> temp = ve;
      int cur = 0;
      for(int k = 0; k < h; k++) {
        if((i >> k) & 1) {
          for(int kk = 0; kk < w; kk++) {
            temp[k][kk] = '.';
          }
        }
      }
      for(int l = 0; l < w; l++) {
        if((j >> l) & 1) {
          for(int ll = 0; ll < h; ll++) {
            temp[ll][l] = '.';
          }
        }
      }
      for(int k = 0; k < h; k++) {
        for(int l = 0; l < w; l++) {
          if(temp[k][l] == '#')
            cur++;
        }
      }
      if(cur == K)
        ans++;
    }
  }
  cout << ans << '\n';

  return 0;
}


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

int main() {
  string s;
  cin >> s;
  
  int count = 0;
  
  for (int i = 0; i < s.size(); i++){
    if (s.at(i) != s.at(s.size() - (i+1))){
      count++;
    }
  }
  cout << count / 2 << endl;
}

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

string board[50];

int main() {
    int h,w;
    cin >> h >> w;
    rep(i,h) cin >> board[i];

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

    rep(i,h){
        rep(j,w){
            if(board[i][j]=='#') continue;

            int num=0;
            rep(d,8){
                const int ni=i+dy[d];
                const int nj=j+dx[d];
                if(ni<0 || h<=ni) continue;
                if(nj<0 || w<=nj) continue;
                if(board[ni][nj]=='#') num++;
            }

            board[i][j]=char(num + '0');
        }
    }

    rep(i,h) cout << board[i] << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

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

	s.at(3) = '8';
	cout << s << endl;
}

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

using namespace std;

using ll = long long;

struct UnionFind {
    //各要素が属する集合の代表(根)を管理する
    //もし、要素xが根であればdata[x]は負の値を取り、-data[x]はxが属する集合の大きさに等しい
    vector<int> data;

    UnionFind(int sz) : data(sz, -1) {}

    bool unite(int x, int y) {
        x = find(x);
        y = find(y);
        bool is_union = (x != y);
        if (is_union) {
            if (data[x] > data[y]) swap(x, y);
            data[x] += data[y];
            data[y] = x;
        }
        return is_union;
    }

    int find(int x) {
        if (data[x] < 0) { //要素xが根である
            return x;
        } else {
            data[x] = find(data[x]); //data[x]がxの属する集合の根でない場合、根になるよう更新される
            return data[x];
        }
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }

    int size(int x) {
        return -data[find(x)];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> x(n), y(n);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
    }

    int ans = n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) continue;
            ll p = x[j] - x[i], q = y[j] - y[i];
            UnionFind uf(n);
            for (int k = 0; k < n; k++) {
                for (int l = 0; l < n; l++) {
                    if (k == l) continue;
                    ll pp = x[k] - x[l], qq = y[k] - y[l];
                    if (pp == p && qq == q) uf.unite(k, l);
                }
            }

            int cnt = 0;
            for (int k = 0; k < n; k++) {
                if (uf.find(k) == k) cnt++;
            }
            ans = min(ans, cnt);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
S = list(input())
maxCommon = 0
for i in range(1, N):
    count = 0
    for j in range(ord('a'), ord('z')+1):
        left = False
        right = False
        for k in range(i):
            if ord(S[k]) == j:
                left = True
        for k in range(N - 1, i - 1, -1):
            if ord(S[k]) == j:
                right = True
        if right and left:
            count += 1
    if maxCommon < count:
        maxCommon = count
print(maxCommon)

Measured memory_bytes: 3064
import math
def f(n, p1, p2):
    if n == 0: return
    s = []
    t = []
    u = []
    s.append((2*p1[0] + p2[0])/3)
    s.append((2*p1[1] + p2[1])/3)
    t.append((p1[0] + 2*p2[0])/3)
    t.append((p1[1] + 2*p2[1])/3)
    u.append((t[0]-s[0])*math.cos(math.radians(60))
             - (t[1]-s[1])*math.sin(math.radians(60)) + s[0])
    u.append((t[0]-s[0])*math.sin(math.radians(60))
             + (t[1]-s[1])*math.cos(math.radians(60)) + s[1])
    f(n-1, p1, s)
    print(s[0],s[1])
    f(n-1, s, u)
    print(u[0],u[1])
    f(n-1, u, t)
    print(t[0],t[1])
    f(n-1, t, p2)


n = int(input())
p1 = [0,0]
p2 = [100,0]
print(p1[0],p1[1])
f(n, p1, p2)
print(p2[0],p2[1])




Measured memory_bytes: 5780
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());

    int[] h = new int[n];
    for (int i = 0; i < n; i++) {
      h[i] = Integer.parseInt(sc.next());
    }
    int[] dp = new int[n];
    Arrays.fill(dp, 10010);
    dp[0] = 0;
    dp[1] = Math.abs(h[0] - h[1]);
    

    for (int i = 2; i < n; i++) {
      int min = dp[i - 1] + Math.abs(h[i] - h[i - 1]);
      for (int j = 2; j <= k; j++) {
        if (i >= j) {
          min = Math.min(min, dp[i - j] + Math.abs(h[i] - h[i - j]));
        }
       }
      dp[i] = min;
     }
    System.out.println(dp[n - 1]);
  }

}


Measured memory_bytes: 47036
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
const ll mod=1e9+7;

const int N=3001;
double dp[N];
vector<double> a(N);

int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();
    
    ll n;
    cin>>n;
    for(ll i=0;i<n;i++)
        cin>>a[i];
    for(ll i=0;i<=n;i++)
        dp[i]=0;
    dp[0]=1;
    for(ll i=0;i<n;i++){
        for(ll h=n+1;h>=0;h--){
            if(h==0) dp[h]=(1-a[i])*dp[h];
            else dp[h]=a[i]*dp[h-1]+(1-a[i])*dp[h];
        }
    }
    double ans=0;
    for(ll i=n/2+1;i<=n;i++)
        ans+=dp[i];
    cout<<fixed<<setprecision(10);
    cout<<ans;
    

    

    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}

Measured memory_bytes: 3820
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
// #include <bits/stdc++.h> all

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;

int main(void){
  int s, w; cin >> s >> w;
  if(w >= s){
    cout << "unsafe" << endl;
  } else {
    cout << "safe" << endl;
  }

  return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define int long long
int INF = 1e9 +7;
signed main(){
   char b;
   cin>>b;
   if(b=='A')cout<<'T';
   if(b=='C')cout<<'G';
    if(b=='G')cout<<'C';
    if(b=='T')cout<<'A';

    return 0;
}

Measured memory_bytes: 256
use std::collections::HashSet;
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident) => {
        $it.next().unwrap().parse().unwrap()
    };
    ($it: ident,2) => {
        (parse!($it), parse!($it))
    };
    ($it: ident,3) => {
        (parse!($it), parse!($it), parse!($it))
    };
    ($it: ident,4) => {
        (parse!($it), parse!($it), parse!($it), parse!($it))
    };
    ($it: ident, $n: expr) => {
        (&mut $it).take($n).map(|e| e.parse().unwrap()).collect();
    };
}
fn perm_part<T: Clone>(n: usize, v: &mut [T], all: &mut Vec<Vec<T>>) {
    if n == 1 {
        all.push(v.to_vec());
        return;
    }
    for i in 0..n {
        perm_part(n - 1, v, all);
        if n % 2 == 0 {
            v.swap(i, n - 1);
        } else {
            v.swap(0, n - 1);
        }
    }
}

pub fn perm<T: Clone>(v: &Vec<T>) -> Vec<Vec<T>> {
    let mut v = v.clone();
    let mut all = vec![];
    perm_part(v.len(), &mut v, &mut all);
    all
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    let (n, m) = parse!(it, 2);
    let mut g: Vec<HashSet<usize>> = vec![HashSet::new(); n];
    for _ in 0..m {
        let (a, b): (usize, usize) = parse!(it, 2);
        g[a - 1].insert(b - 1);
        g[b - 1].insert(a - 1);
    }
    let a: Vec<usize> = (1..n).collect();
    let mut ret = 0;
    for p in perm(&a) {
        let mut ok = true;
        if !g[0].contains(&p[0]) {
            ok = false;
        }
        for i in (0..(n - 2)) {
            if !g[p[i]].contains(&p[i + 1]) {
                ok = false;
                break;
            }
        }
        ret += ok as usize;
    }
    println!("{}", ret);
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


Measured memory_bytes: 4352
N, M = map(int, input().split())
H = list(map(int, input().split()))
ans = M
counted = []
appeared = set()


for i in range(M):
    a, b = map(int, input().split())
    if H[a-1] < H[b-1]:
        appeared.add(a)
    elif H[a-1] > H[b-1]:
        appeared.add(b)
    else:
        appeared.add(a)
        appeared.add(b)

ans = len(H) - len(appeared)
print(ans)


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

int main() {
  int A, B, C, K;
  cin >> A >> B >> C >> K;

  int CARD[3] = {1, 0, -1};

  int ans = 0;

  if(K < A) {
    cout << K << endl;
    return 0;
  }
  if(K <= A+B) {
    cout << A << endl;
    return 0;
  }
  cout << A - (K-A-B) << endl;
  return 0;
}

Measured memory_bytes: 3664
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int h = s / 3600;
        int m = (s - h * 3600) / 60;
        s = s - h * 3600 - m * 60;
        System.out.println(h + ":" + m + ":" + s);
    }
}



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

using namespace std;


int main()
{
    //freopen("input.inp", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    string s;
    cin >> s;
    int head;
    int minn = 1e8;
    int dem=0;
    vector<int> sum(n);
    if (s[0]=='#') sum[0]=1; else sum[0]=0;
    for(int i=1; i<n; ++i)
    {
        sum[i]=sum[i-1];
        if (s[i]=='#') sum[i]++;
    }
    for(int i=n-1; i>=0; --i)
    {
        int ans = sum[i];
        minn= min(ans+dem,minn);
        if (s[i]=='.')
        dem++;
    }
    minn = min(dem,minn);
    cout << minn;
    return 0;
}


Measured memory_bytes: 1300
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

typedef string::const_iterator State;

class ParseError{};

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
int number(State &begin);
int term(State &begin);
int expression(State &begin);
int expression(State &begin);

int number(State &begin){
    int ret = 0;

    while(isdigit(*begin)){
        ret *= 10;
        ret += *begin - '0';
        begin++;
    }
    return ret;
}

int factor(State &begin){
    if(*begin == '('){
        begin++;
        int ret = expression(begin);
        begin++;
        return ret;
    }else {
        return number(begin);
    }
}

int term(State &begin){
    int ret = factor(begin);
    for(;;){
        if(*begin =='*'){
            begin++;
            ret *= factor(begin);
        } else if(*begin == '/'){
            begin++;
            ret /= factor(begin);
        } else {
            break;
        }
    }
    return ret;
}


int expression(State &begin){
    int ret = term(begin);

    for(;;){
        if (*begin == '+'){
            begin++;
            ret += term(begin);
        } else if(*begin == '-'){
            begin++;
            ret -= term(begin);
        } else {
            break;
        }
    }
    return ret;
}

int main(){
    int N;
    cin >> N;
    cin.ignore();
    rep(i, N){
        string s;
        getline(cin, s);

        State begin = s.begin();
        int ans = expression(begin);
        cout << ans << endl;
    }
}

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

using namespace std;
using ll = long long;

//container util
#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)


int main(void){

	
	int N; cin >> N;
	string s, t; cin >> s >> t;

	REP(i,N){
		cout << s[i] << t[i];
	}
	cout << endl;

	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int V[11][11][11];
vector<int> v;
int N, M;
ll ans;
void dfs(int tmp) {
  if(tmp == N) {
    ll point = 0;
    rep(i, N) REP(j, i+1, N) point += V[i+1][j+1][v[j]-v[i]];
    if(point > ans) {
      ans = max(point, ans);
    }
    return;
  }
  int begin = (tmp ? (*--v.end()) : 1);
  REP(i, begin, M+1) {
    v.push_back(i);
    dfs(tmp+1);
    v.pop_back();
  }
}
int main() {
  int Q;
  cin >> N >> M >> Q;
  rep(i, 11) rep(j, 11) rep(k, 11) V[i][j][k] = 0;
  vector<int> A(Q), B(Q), C(Q), D(Q);
  rep(i, Q) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
    V[A[i]][B[i]][C[i]] = max(D[i], V[A[i]][B[i]][C[i]]);
  }
  ans = 0;
  dfs(0);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3604
n,p = tuple(int(x) for x in input().split())
s = [int(s) for s in input()][::-1]
modlist = [0]*p
modlist[0] = 1
if p!= 2 and p != 5:
    mod = 0
    pwrmod = 1
    for i in s:
        mod = (mod + pwrmod * i) % p
        pwrmod = (pwrmod * 10) % p
        modlist[mod] += 1
    ans = 0
    for i in modlist:
        ans += (i * (i-1)) // 2

    print(ans)
else:
    ans = 0
    for i in range(n):
        if s[i] % p == 0:
            ans += n-i
    print(ans)


Measured memory_bytes: 6560
#include <bits/stdc++.h>
#define ll long long
#define num_lim 10000
#define MAXN 100000
#define BIGN 1000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(v) v.begin(),v.end()
#define sortarr(arr_name,size) sort(arr_name,arr_name + size)
#define test int t;cin >> t;while(t--)
#define take(data_type,variable_name) data_type variable_name;cin >> variable_name;
#define forn(variable_name,start,end,step) for(int variable_name = start;variable_name<end;variable_name+=step)
#define in_arr(data_type,arr,n) data_type arr[n];forn(i,0,n,1) cin >> arr[i]
using namespace std;

int main(){
    fast
    take(int,x);
    x==0?cout << 1:cout << 0;
    cout << '\n';
}

Measured memory_bytes: 3640
using System;
using System.Text;
using System.Collections.Generic;

namespace AOJ2
{
    class Program
    {
        static void Main(string[] args)
        {
            List<decimal> resultList = new List<decimal>();

            string input;
            while ((input = Console.ReadLine()) != null)
            {
                decimal d = decimal.Parse(input);
                decimal sum = d;

                for (int i = 2; i <= 10; i++)
                {
                    if (i % 2 == 0)
                    {
                        d *= 2;
                    }
                    else
                    {
                        d /= 3;
                    }

                    sum += d;
                }

                resultList.Add(sum);
            }

            foreach (decimal sum in resultList)
            {
                Console.WriteLine(sum);
            }

        }


    }
}

Measured memory_bytes: 16112
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<iomanip>

using namespace std;

int main(void) {
	int n;
	cin >> n;
	vector<char>s(n);
	set<char>ans;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
		ans.insert(s[i]);
	}
	if (ans.size() == 3) {
		cout << "Three";
	}
	else {
		cout << "Four";
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <random>
#include <chrono>
#include <algorithm>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
using namespace std;
typedef long long ll;
const ll MOD = (ll)1e9 + 7;
const int N = 1e3+5, inf = 1e9+5;
ll add(ll x, ll y) { x += y; if (x >= MOD) return x - MOD; return x; }
ll sub(ll x, ll y) { x -= y; if (x < 0) return x + MOD; return x; }
ll mult(ll x, ll y) { return (x * y) % MOD; }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

char a[N][N];
ll dp[N][N];
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, m; cin >> n >> m;
    rep (i, 0, n) rep (j, 0, m) cin >> a[i][j];
    dp[0][0] = 1;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (a[i][j] != '#') {
                dp[i+1][j] = add(dp[i+1][j], dp[i][j]);
                dp[i][j+1] = add(dp[i][j+1], dp[i][j]);
            }
        }
    }
    cout << dp[n-1][m-1] << endl;
    return 0;
}

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

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int H1,M1,H2,M2,K,total_time; 
    cin >> H1 >> M1 >> H2 >> M2 >> K; 
    total_time = (H2-H1)*60+(M2-M1);
    cout << total_time-K << '\n';
    
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
ll Mod = 1000000007;

vector<int> Graph[110000];
vector<int> Depth[110000];
vector<int> Deep(110000);
vector<int> Parent(110000);
vector<int> child[110000];
int root;
void BFS() {
  for (int i = 0; i < (int)Deep.size(); i++) {
    Deep[i] = 999999;
  }
  priority_queue<P, vector<P>, greater<P>> Q;
  Q.push(make_pair(0,root));
  Depth[0].push_back(root);
  Deep[root] = 0;
  while (!Q.empty()) {
    P p = Q.top();
    Q.pop();
    for (int i = 0; i < (int)Graph[p.S].size(); i++) {
      if (Deep[Graph[p.S][i]] > p.F + 1) {
        Q.push(make_pair(p.F+1,Graph[p.S][i]));
        Deep[Graph[p.S][i]] = p.F + 1;
        Depth[p.F+1].push_back(Graph[p.S][i]);
        Parent[Graph[p.S][i]] = p.S;
        child[p.S].push_back(Graph[p.S][i]);
      }
    }
  }
}

int main() {
  int N,u,v;
  cin >> N >> u >> v;
  int ans = 0;
  u--; v--;
  for (int i = 0; i < N-1; i++) {
    int A,B;
    cin >> A >> B;
    A--; B--;
    Graph[A].push_back(B);
    Graph[B].push_back(A);
  }
  root = v;

  BFS();

  int color[N];
  for (int i = 0; i < N; i++) color[i] = -1;
  // U:0 V:1 else:-1
  vector<int> U = {u};
  vector<int> V = {v};
  color[u] = 0;
  color[v] = 1;
  while (0 == 0) {
    vector<int> newU = {};
    vector<int> newV = {};
    for (int i = 0; i < (int)V.size(); i++) {
      for (int j = 0; j < (int)Graph[V[i]].size(); j++) {
        int S = Graph[V[i]][j];
        if (color[S] == -1) {
          color[S] = 1;
          newV.push_back(S);
        }
      }
    }
    for (int i = 0; i < (int)U.size(); i++) {
      for (int j = 0; j < (int)Graph[U[i]].size(); j++) {
        int S = Graph[U[i]][j];
        if (color[S] == -1) {
          color[S] = 0;
          newU.push_back(S);
        }
      }
    }
    U = newU;
    V = newV;
    if (U.empty() && V.empty()) {
      break;
    }
  }

  for (int i = 0; i < N; i++) {
    if (color[i] == 0) {
      ans = max(ans,Deep[i]-1);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 20560
# 逆元を利用した組み合わせの計算
#############################################################


def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


# 問題に応じて変える、素数の時しか動作しない
mod = 10**9 + 7
# 問題に応じて変える、上限
N = 10**6

# 元テーブル
g1 = [1, 1]
# 逆元テーブル
g2 = [1, 1]
# 逆元テーブル計算用テーブル
inverse = [0, 1]

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)
#####################################################

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

# X+Yが3の倍数のマスしか通りえない
if (X + Y) % 3 == 0:
    # (1,2)移動をn回、(2,1)移動をm回したとする
    # n+2m = X, 2n+m = Y
    # n,mについて解く
    n = (2 * Y - X) // 3
    m = (2 * X - Y) // 3

    if n >= 0 and m >= 0:
        print(cmb(n + m, n, mod))
    else:
        print(0)

# X+Yが3の倍数でない場合
else:
    print(0)


Measured memory_bytes: 213168
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
}

macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, n: usize);
    let mut g = vec![vec![]; n];
    for _ in 0..(n - 1) {
        parse!(it, a: usize, b: usize);
        g[a - 1].push(b - 1);
        g[b - 1].push(a - 1);
    }
    let mut a = 0;
    let mut l = 0;
    let mut stack = vec![(0, 0)];
    let mut seen = vec![false; n];
    while let Some((v, d)) = stack.pop() {
        for &u in g[v].iter() {
            if !seen[u] {
                seen[u] = true;
                if d + 1 > l {
                    a = u;
                    l = d + 1;
                }
                stack.push((u, d + 1));
            }
        }
    }
    let a = a;
    let mut l = 0;
    let mut stack = vec![(a, 0)];
    let mut seen = vec![false; n];
    while let Some((v, d)) = stack.pop() {
        for &u in g[v].iter() {
            if !seen[u] {
                seen[u] = true;
                if d + 1 > l {
                    l = d + 1;
                }
                stack.push((u, d + 1));
            }
        }
    }
    if l % 3 == 1 {
        println!("Second");
    } else {
        println!("First"); // DEBUG
    }
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


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

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

	int month = stoi(s.substr(5, 2)), day = stoi(s.substr(8, 2));

	cout << ((month < 4 || (month == 4 && day <= 30)) ? "Heisei" : "TBD") << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

        //Nはお札の枚数
        int N = stdIn.nextInt();
        //合計金額
        int Y = stdIn.nextInt();

        for (int i=0; i<=N; i++) {
            for (int j=0; j<=N-i; j++) {
                int k = N - i - j;
                int totil = i * 10000 + j * 5000 + k * 1000;
                if (totil == Y) {
                    System.out.println(i + " " + j + " " + k);
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
}

Measured memory_bytes: 23636
a,b = map(int,input().split(" "))
ar = []
br = [[] for i in range(b)]
for i in range(a):
    l = list(input())
    if "#" in l:
        ar.append(l)
    for j in range(b):
        br[j].append(l[j])
cr = []
for i,r in enumerate(br):
    if "#" not in r:
        cr.append(i)
er = [[] for i in range(len(ar))]
for i in range(len(ar)):
    for j in range(b):
        if j not in cr:
            er[i].append(ar[i][j])
for r in er:
    print("".join(r))



Measured memory_bytes: 3316
import Control.Applicative( (<$>))
import Data.List( sortBy)
import Data.Function( on)
import Control.Monad( forM_)

data Direction = LEFT | RIGHT | UP | DOWN

main = do
    let
	readLine = map read . words <$> getLine
    [h_, w_] <- readLine
    _n_ <- readLn::IO Int
    as_ <- readLine
    let
	uzu 0 _ _ _ _ _ _ = []
	uzu n l u b r RIGHT p@(i,j)
	  | j<r		= p:(uzu (n-1) l u b r RIGHT (i,j+1))
	  | otherwise	= p:(uzu (n-1) l u b (r-1) DOWN (i+1,j))
	uzu n l u b r DOWN p@(i,j)
	  | i<b		= p:(uzu (n-1) l u b r DOWN (i+1,j))
	  | otherwise	= p:(uzu (n-1) l u (b-1) r LEFT (i,j-1))
	uzu n l u b r LEFT p@(i,j)
	  | l<j		= p:(uzu (n-1) l u b r LEFT (i,j-1))
	  | otherwise	= p:(uzu (n-1) (l+1) u b r UP (i-1,j))
	uzu n l u b r UP p@(i,j)
	  | u<i		= p:(uzu (n-1) l u b r UP (i-1,j))
	  | otherwise	= p:(uzu (n-1) l (u+1) b r RIGHT (i,j+1))

	poss = uzu (h_*w_) 1 2 h_ w_ RIGHT (1,1)
	
	gridDataList
	  = let
		decode _ [] = []
		decode n (a:as) = replicate a n:(decode (n+1) as)
		as' = concat $ decode 1 as_
		list = zip poss as'
	    in
		sortBy (compare `on` fst) list

	
	printGrid lines
	  = forM_ lines $ \line ->
		do
		forM_ line $	\v -> putStr $ (show v) ++ " "
		putStrLn ""
	
	chops _ [] = []
	chops n list
	  = let
		(sausage, rest) = splitAt n list
	    in
		sausage:(chops n rest)

    printGrid . chops w_ $ snd <$> gridDataList

Measured memory_bytes: 3580
fun main(arr: Array<String>) {
    val n = readLine()!!.toInt()
    val d = readLine()!!.split(" ").map { it.toInt() }
    val ans = d.indices.map { t1 -> d.indices.map { t2 -> if(t1==t2) 0 else d[t1]*d[t2] }.sum() }.sum() / 2
    println(ans)
}


Measured memory_bytes: 36680
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<deque>
#include<bitset>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef pair<ll,ll> P;
template<class T> inline bool chmax(T&a , T b){ if(a<b){ a=b; return true; } else{ return false; } }
template<class T> inline bool chmin(T&a , T b){ if(a>b){ a=b; return true; } else{ return false; } } 

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

int main(){
    int k;
    cin >> k;
    string s;
    cin >> s;
    if(s.size()<=k){
        cout << s << endl;
    }else{
        rep(i,k){
            cout << s[i];
        }
        cout << "..." << endl;
    }
}

Measured memory_bytes: 3640
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

using lli = long long int;
using ulli = unsigned long long int;

#define INF 999999999;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

string S;
int l, ans;

int main(){
	cin.tie(0);
	std::ios::sync_with_stdio(false);
    cin >> S;
    for(int i = 0; i < S.size(); i++){
        if(S[i] == 'A' || S[i] == 'T' || S[i] =='C' || S[i] == 'G'){
            l++;
            if(i+1 == S.size()){
                ans = max(l, ans);
            }
        }else{
            ans = max(l, ans);
            l = 0;
        }
    }


    cout << ans << "\n";
	return 0;
}

/*#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

using lli = long long int;
using ulli = unsigned long long int;

#define INF 999999999;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

int N, Q;
string S;
pair<int, int> lr[100010];

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

    cin >> N >> Q;
    cin >> S;
    for(int i = 0; i < Q; i++){
        if(S[i] == 'A' || S[i] == 'T' || S[i] =='C' || S[i] == 'G'){
            l++;
        }else{
            ans = max(l, ans);
            l = 0;
        }
    }

    cout << ans << "\n";
	return 0;
}
*/

Measured memory_bytes: 256
A, B, K = map(int, input().split())

result = set()

for n in range(A, min(A + K, B + 1)):
    result.add(n)

for n in range(max(A, B - K + 1), B + 1):
    result.add(n)

for n in sorted(list(result)):
    print(n)


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

using ll = long long;
constexpr ll inf = 1e18;

struct edge {
    int to;
    ll s;
};

using edges = vector<edge>;
using graph = vector<edges>;

int main() {
    int n, m;
    cin >> n >> m;
    graph g(n);
    for(int i = 0; i < m; ++i) {
        int u, v, s;
        cin >> u >> v >> s;
        g[u - 1].push_back(edge{v - 1, s});
        g[v - 1].push_back(edge{u - 1, s});
    }

    vector<bool> vis(n);
    vector<ll> sign(n), a(n);
    // sign[i] == 1:  assign a + t to val[i] (this is also mean t > -a)
    // sign[i] == -1: assign b - t to val[i] (this is also mean t < b)
    // so when val[i] <- a + t and b - t, t must equals (b - a) / 2
    ll mi = 1, ma = inf; // t is in [mi, ma)
    function<void(int)> dfs = [&] (int v) {
        vis[v] = true;
        for(auto& e : g[v]) {
            ll to = e.to, sum = e.s;
            ll nsign = -sign[v], na = sum - a[v];
            if(vis[to]) { // loop
                if(sign[to] == nsign) { // even loop
                    if(a[to] == na) continue; // should be assigned same value
                    mi = inf;
                    ma = 0;
                    continue;
                } else { // odd loop
                    if((a[to] + na) & 1) { // check parity
                        mi = inf;
                        ma = 0;
                        continue;
                    } else {
                        ll v = (sign[to] == 1 ? na - a[to] : a[to] - na);
                        mi = max(mi, v / 2);
                        ma = min(ma, v / 2 + 1);
                    }
                }
            } else {
                sign[to] = nsign, a[to] = na;
                if(sign[to] == 1) mi = max(mi, -a[to] + 1);
                else              ma = min(ma, a[to]);
                dfs(to);
            }
        }
    };
    sign[0] = 1;
    dfs(0);
    cout << max(0LL, ma - mi) << endl;
}


Measured memory_bytes: 15616
n, k = map(int, input().split())
X = list(map(int, input().split()))
l, r = -1, n
while r - l > 1:
    p = (l + r) // 2
    if X[p] < 0:
        l = p
    else:
        r = p

if l == -1:
    print(X[k - 1])
elif r == n:
    print(abs(X[n - k]))
elif n == k:
    print(min(2 * abs(X[0]) + X[-1], abs(X[0]) + 2 * X[-1]))
else:
    best_score = 10 ** 9
    for i in range(max(l - k + 1, 0), n - k):
        score = 0
        if i > r:
            break
        if X[i + k] < 0:
            score = abs(X[i])
        elif X[i] > 0:
            score = X[i + k - 1]
        elif abs(X[i]) < abs(X[i + k - 1]):
            score = 2 * abs(X[i]) + X[i + k - 1]
        else:
            score = abs(X[i]) + 2 * X[i + k - 1]
        if score < best_score:
            best_score = score
    print(best_score)


Measured memory_bytes: 14696
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,z=0;
  cin>>n;
  m=__builtin_popcount(n);
  for(int i=0;i<32;i++){
    if((1<<i)&n)z=i;
  }
  cout<<max(m,z)<<endl;
}



Measured memory_bytes: 3108
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

bool ch_string(string s){
	char t = s[0];
	for(int i = 1; i<s.size(); ++i){
		if(s[i] != t)return false;
	}
	return true;
}

int main(){
	string s;cin>>s;
	set <char> crac;
	rep(i,s.size())crac.insert(s[i]);
	int ans = inf;
	for(char x:crac){
		int e_ans = 0;
		string t = s;
		while(!ch_string(t)){
			string ch = t;
			rep(i,t.size()-1){
				ch[i] = ((t[i] == x || t[i+1] == x)?x:t[i]);
			}
			t = ch.substr(0,t.size()-1);
			++e_ans;
		}
		ans = min(ans, e_ans);
	}
	cout<<ans<<endl;
	return 0;
}

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

namespace ABC103
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int ans = 0;
            if (n % 2 == 0) { ans = n; }
            else { ans = n * 2; }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11092
#include <stdio.h>
int main(void){
    // Your code here!
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    if(0<=x-r&&0<=y-r&&x+r<=W&&y+r<=H){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}



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

void write(int);

int main() {
	int H, W, x;

	while (true) {
		cin >> H >> W;
		if (H == 0 && W == 0)	break;

		for (int i = 0; i < H; i++) {
			x = i % 2;

			for (int j = 0; j < W; j++) {
				write(x);
				x++;
			}

			cout << endl;
		}

		cout << endl;
	}

	return 0;
}

void write(int x) {
	if (x % 2 == 0)	cout << '#';
	else cout << '.';
}

Measured memory_bytes: 1152
#include <algorithm>
#include <iostream>
#include <vector>

int main() {
  int N, X;
  std::cin >> N >> X;
  std::vector<int> A(N);
  for (int i = 0; i < N; i++) std::cin >> A[i];
  std::sort(A.begin(), A.end());
  int i{0};
  int sum{0};
  while (sum <= X && i < N) {
    sum += A[i];
    ++i;
  }
  if(sum==X){
    std::cout << i << std::endl;
  } else{
    std::cout << i - 1 << std::endl;
  }
}

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

int main(){
  int a;
  cin >> a;
  if (a/1000 == (a%1000)/100 && (a%1000)/100 == (a%100)/10 || (a%1000)/100 == (a%100)/10  && (a%100)/10 == a%10){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256