akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_macros)]
macro_rules! get {
    ([$t:ty] ; $n:expr) => {
        (0..$n)
        .map(|_| get!([$t])).collect::<Vec<_>>()
    };
    ($($t:ty),+ ; $n:expr) => {
        (0..$n).map(|_| get!($($t),+)).collect::<Vec<_>>()
    };
    ([$t:ty]) => {
        rl().split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<Vec<$t>>()
    };
    ($t:ty) => {
        rl().parse::<$t>().unwrap()
    };
    ($($t:ty),*) => {
        {
            let line =rl();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()),*)
        }
    };
}
fn rl() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().to_string()
}

fn main() {
    let (n, k) = get!(usize, usize);
    let v = get!([i64]);
    let mut ans = 1 << 60;
    for i in 0..n - k + 1 {
        let d1 = (v[i] - v[i + k - 1]).abs();
        for j in 0..2 {
            let d2;
            if j % 2 == 0 {
                d2 = v[i].abs();
            } else {
                d2 = v[i + k - 1].abs();
            }
            //eprintln!("d1: {}, d2: {}", d1, d2);
            ans = std::cmp::min(ans, d1 + d2);
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 8444
#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
#define mp make_pair
using namespace std;
using ll=long long;
using P=pair<int,int>;
const ll INF=1LL<<30;
const ll LINF=1LL<<60;
const double eps=1e-5;
const ll MOD=1000000007LL;
template<typename T>void chmin(T &a,T b){a=min(a,b);};
template<typename T>void chmax(T &a,T b){a=max(a,b);};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
struct edge{int to;ll s;};
vector<vector<edge>> G;
vector<int> vis;
vector<ll> a,b;
ll x;
bool f;
void dfs(int i){
    vis[i]=true;
    for(auto e:G[i]){
        if(vis[e.to]){
            ll j=e.s-(b[e.to]+b[i]),k=a[e.to]+a[i];
            if(k==0&&j){
                f=true;
                return;
            }else if(k==0){
                continue;
            }
            if(j%k){
                f=true;
                return;
            }
            if(x==LINF){
                x=j/k;
            }else{
                if(x!=j/k){
                    f=true;
                    return;
                }
            }
        }else{
            a[e.to]=-a[i];
            b[e.to]=e.s-b[i];
            dfs(e.to);
        }
    }
}
int main(){
    int n,m;cin>>n>>m;
    x=LINF;
    G.resize(n);
    vis.resize(n);
    a.resize(n);
    b.resize(n);  
    for(int i=0;i<m;i++){
        int u,v;ll s;cin>>u>>v>>s;--u;--v;
        G[u].push_back({v,s});
        G[v].push_back({u,s});
    }
    a[0]=1,b[0]=0;
    dfs(0);
    if(f){
        cout<<0<<endl;
        return 0;
    }
    if(x!=LINF){
        for(int i=0;i<n;i++){
            if(a[i]*x+b[i]<=0LL){
                cout<<0<<endl;
                return 0;
            }
        }
        cout<<1<<endl;
        return 0;
    }
    ll lb=1,ub=LINF;
    for(int i=0;i<n;i++){
        if(a[i]>0){
            lb=max(lb,-b[i]+1LL);
        }else{
            ub=min(ub,b[i]-1LL);
        }
    }
    cout<<max(ub-lb+1LL,0LL)<<endl;
}   

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

using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define ll long long
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define INF INT_MAX
#define cases(t) ll t; cin>>t; while(t--)
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }

#define pb push_back
#define mp make_pair
#define ii pair<int,int>
#define msi map<string,int>

int main(){
	IOS
	ll n,k;
	cin>>n>>k;
	ll a[n];
	for(ll i = 0; i < n; ++i){
		cin>>a[i];
	}
	ll prod = 1;
	for(ll i = k; i < n; ++i){
		if(a[i] > a[i-k])
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
		
return 0;
}

Measured memory_bytes: 5216
#include <stdio.h>
#include <math.h>

int main(void) {
    int n, l, ans = 0, min, memo;

    scanf("%d %d", &n, &l);
    min = abs(l);
    memo = 1;

    for (int i = 1; i <= n; ++i) {
        ans += l + i-1;

        if (min > abs(l + i - 1)) {
            min = abs(l + i - 1);
            memo = i ;
        }
    }
    printf("%d", ans- (l + memo - 1));

    return 0;
}

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

int main() {
	int n, m;
	cin >> n >> m;
	vector<pair<int, int>> p(m);
	for (int i = 0; i < m; i++) {
		cin >> p[i].first >> p[i].second;
		p[i].first--;
	}
	for (int i = 0; i <= 999; i++) {
		string s = to_string(i);
		if ((int)s.size() < n) continue;
		bool ok = true;
		for (auto a : p) {
			if (s[a.first] != a.second + '0') ok = false;
		}
		if (ok) {
			cout << s << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}

Measured memory_bytes: 3656
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

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

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

trait Joinable {
    fn join(self, sep: &str) -> String;
}

impl<U: ToString, T: Iterator<Item = U>> Joinable for T {
    fn join(self, sep: &str) -> String {
        self.map(|x| x.to_string()).collect::<Vec<_>>().join(sep)
    }
}
fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let N: usize = sc.get();
    let A: Vec<i64> = sc.vec(N);
    let mut cum = vec![0; N+1];
    for i in 0..N {
        cum[i+1] = cum[i] + A[i];
    }
    let mut ans: usize = 0;
    let mut cnt = HashMap::new();
    for r in 0..N+1 {
        ans += *cnt.get(&cum[r]).unwrap_or(&0);
        let e = cnt.entry(&cum[r]).or_insert(0);
        *e += 1;
    }
    println!("{}", ans);
}


Measured memory_bytes: 19224
import math
a,b,x = map(int,input().split())
if x >= a*a*b/2:
  rest = a*a*b-x
  n = rest*2/a/a
  print(math.degrees(math.atan(n/a)))
else:
  n = x*2/b/a
  print(math.degrees(math.atan(b/n)))

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
#define int long long

int n;
int compaitable[25][25];
int dp[21][3000005];

const int MOD=1e9+7;

bool isNotSet(int mask,int i){
    if(mask&(1<<i)) return false;
    else return true;
}

int solve(int index,int women_mask){
    if(__builtin_popcount(women_mask)<index) return 0;
    if(index==n){
        if(women_mask==(1<<n)-1) return 1;
        else return 0;
    }
    int &ans=dp[index][women_mask];
    if(ans!=-1) return ans;
    ans=0;
    for(int i=0;i<n;i++){
        if(compaitable[index][i]==1&&isNotSet(women_mask,i)){
            ans=(ans+solve(index+1,(women_mask|(1<<i))))%MOD;
        }
    }
    return ans;
}

int32_t main(){
    memset(dp,-1,sizeof(dp));
    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>compaitable[i][j];
        }
    }

    cout<<solve(0,0)<<"\n";
    return 0;
}

Measured memory_bytes: 492416
#include<iostream>
#include<vector>
#include<stack>
#include<map>
using namespace std;

int main() {
    long N, Q;
    cin>>N>>Q;
    vector<vector<long> > tmptree(N);
    vector<vector<long> > tree(N);
    long a, b;
    for(long i=0;i<N-1;++i){
        cin>>a>>b;
        a--;
        b--;
        tmptree[a].push_back(b);
        tmptree[b].push_back(a);
    }
    stack<long> maketree;
    map<long, int> treemap;
    long tmpstate;
    maketree.push(0);
    treemap[0]++;
    while(!maketree.empty()){
        tmpstate = maketree.top();maketree.pop();
        for(int i=0;i<tmptree[tmpstate].size();++i){
            if(treemap[tmptree[tmpstate][i]]==0){
                tree[tmpstate].push_back(tmptree[tmpstate][i]);
                maketree.push(tmptree[tmpstate][i]);
            }
            treemap[tmptree[tmpstate][i]]++;
        }
    }
    long p, x;
    vector<long> arr(N);
    for(long i=0;i<N;++i){
        arr[i] = 0;
    }
    for(long i=0;i<Q;++i){
        cin>>p>>x;
        p--;
        arr[p] += x;
    }
    stack<long> treestack;
    stack<long> scorestack;
    treestack.push(0);
    scorestack.push(arr[0]);
    vector<long> ans(N);
    long state;
    long score;
    while(!treestack.empty()){
        state = treestack.top();treestack.pop();
        score = scorestack.top();scorestack.pop();
        ans[state] = score;
        for(long i=0;i<tree[state].size();++i){
            treestack.push(tree[state][i]);
            scorestack.push(score + arr[tree[state][i]]);
        }
    }
    for(long i=0;i<N;++i){
        cout<<ans[i]<<" ";
    }
    cout<<endl;
}


Measured memory_bytes: 39936
#include<iostream>
#include<stack>
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];

int next(int u) {
  for ( int v = nt[u]; v < n; v++ ) {
    nt[u] = v + 1;
    if ( M[u][v] ) return v;
  }
  return -1;
}

void dfs_visit(int r) {
  for ( int i = 0; i < n; i++ ) nt[i] = 0;

  stack<int> S;
  S.push(r);
  color[r] = GRAY;
  d[r] = ++tt;

  while ( !S.empty() ) {
    int u = S.top();
    int v = next(u);
    if ( v != -1 ) {
      if ( color[v] == WHITE ) {
        color[v] = GRAY;
        d[v] = ++tt;
        S.push(v);
      }
    } else {
      S.pop();
      color[u] == BLACK;
      f[u] = ++tt;
    }
  }
}

void dfs() {
  for ( int i = 0; i < n; i++ ) {
    color[i] = WHITE;
    nt[i] = 0;
  }
  tt = 0;

  for ( int u = 0; u < n; u++ ) {
    if ( color[u] == WHITE ) dfs_visit(u);
  }
  for ( int i = 0; i < n; i++ ) {
    cout << i + 1 << " " << d[i] << " " << f[i] << endl;
  }
}

int main() {
  int u, k, v;

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

  for ( int i = 0; i < n; i++ ) {
    cin >> u >> k;
    u--;
    for ( int j = 0; j < k; j++ ) {
      cin >> v;
      v--;
      M[u][v] = 1;
    }
  }

  dfs();

  return 0;
}


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

int main() {
  int N;
  int64_t x;
  cin >> N >> x;
  vector<int64_t> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  int count = 0;

  for (int i = 0; i < N; i++) {
    if (i == N - 1 && x - vec[i] > 0) {
      break;
    }
    if (x - vec[i] >= 0) {
      x -= vec[i];
      count++;
    } else {
      break;
    }
  }

  cout << count << endl;
}

Measured memory_bytes: 3596
shared void main(){
  assert(exists sve=process.readLine());
  value tve=sve.split();
  //assert(exists v=parseInteger(tve.first));
  assert(exists e=parseInteger(tve.last));
  for(_ in 0:e){
    process.readLine();
  }
  assert(exists stmax=process.readLine());
  assert(exists tmax=parseInteger(stmax));
  for(_ in 0:tmax){
    print(-1);
  }
}

Measured memory_bytes: 190540
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <fstream>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, P> T;

const ll mod = 1000000007;
const ll INF = 1000000100;

ll N;
ll a[100010];
vector<ll> vec;

ll ans;

ll pow_mod(ll x, ll y)
{
	if (y == 0) return 1;
	if (y % 2 == 1)
	{
		return x * pow_mod(x, y - 1) % mod;
	}
	else
	{
		ll half = pow_mod(x, y / 2);
		return half * half % mod;
	}
}

ll div_mod(ll x)
{
	return pow_mod(x, mod - 2);
}

void init()
{
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> a[i];
		vec.push_back(a[i]);
	}
}

void output()
{
	cout << ans << endl;
}

bool kiwosorasetai()
{
	ll sum[100010];
	for (int i = 0; i <= N; i++)
	{
		sum[i] = 0;
	}
	for (int i = 0; i < N; i++)
	{
		if (i)
		{
			sum[i + 1] = sum[i] - 1;
		}
		else
		{
			sum[i + 1] = sum[i] + 1;
		}
	}
	for (int i = 1; i < N; i++)
	{
		
	}
	return true;
}

void solve()
{
	sort(vec.begin(), vec.end());
	
	ll lb = -1, ub = vec.size();
	while (lb + 1 < ub)
	{
		ll mid = (lb + ub) / 2;
		
	}
}

int main()
{
	//init();

	//solve();

	ll N, A[20], x[20][20], y[20][20];
	cin >> N;
	for (int i = 1; i <= N; i++)
	{
		cin >> A[i];
		for (int j = 1; j <= A[i]; j++)
		{
			cin >> x[i][j] >> y[i][j];
		}
	}

	for (int i = 0; i < 1 << N; i++)
	{
		bool judge = true;
		ll cnt = 0;
		for (int j = 1; j <= N; j++)
		{
			if (i & 1 << (j - 1))
			{
				cnt++;
				for (int k = 1; k <= A[j]; k++)
				{
					if ((1 << (x[j][k] - 1) & i) > 0 && y[j][k] == 0)
					{
						judge = false;
					}
					else if ((1 << (x[j][k] - 1) & i) == 0 && y[j][k] == 1)
					{
						judge = false;
					}
				}
			}
		}
		if (judge)
		{
			ans = max(ans, cnt);
		}
	}

	cout << ans << endl;

	//output();

	cin >> N;
}

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

const int MAX = 1e9;

int n, s[101];
pair<int, int> dp[102][101 * 500], result;

void solve(int n){
    for(int i = 0; i < n; i++){
        scanf("%d", &s[i]);
    }
    for(int i = 0; i <= n; i++){
        for(int j = 0; j < 101 * 500; j++){
            dp[i][j] = make_pair(-MAX, 0);
        }
    }
    dp[0][0] = make_pair(0, 0);
    for(int i = 1; i <= n; i++){
        for(int j = 0; j < 101 * 500; j++){
            int r = s[i-1] % 1000;
            dp[i][j] = max(dp[i-1][j], dp[i][j]);
            if(r == 0){
                if(j >= 500){
                    dp[i][j-500] = max(dp[i][j-500], make_pair(dp[i-1][j].first + 1, dp[i-1][j].second - s[i-1]));
                }
            }
            else if(r <= 500){
                dp[i][j+500-r] = max(dp[i][j+500-r], make_pair(dp[i-1][j].first + 1, dp[i-1][j].second - s[i-1]));
            }
            else{
                dp[i][j+1000-r] = max(dp[i][j+1000-r], make_pair(dp[i-1][j].first, dp[i-1][j].second - s[i-1]));
                if(j >= r - 500){
                    dp[i][j+500-r] = max(dp[i][j+500-r], make_pair(dp[i-1][j].first + 1, dp[i-1][j].second - s[i-1]));
                }
            }
        }
        /*for(int j = 0; j < 101 * 500; j++){
            result = max(result, dp[i][j]);
        }
        printf("%d %d\n", result.first, result.second);*/
    }
    int c = 0;
    result = make_pair(0, 0);
    for(int i = 0; i < 101 * 500; i++){
        pair<int, int> a = dp[n][i];
        result = max(result, dp[n][i]);
    }
    printf("%d %d\n", result.first, -result.second);
}


int main(){
    while(scanf("%d", &n), n)
        solve(n);
    return 0;
}

Measured memory_bytes: 41428
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int n) { return n & 1; }
constexpr bool even(const int n) { return ~n & 1; }
template<typename T = int> T in() { T x; cin >> x; return x; }
template<typename T = int> T in(T &&x) { T z(forward<T>(x)); cin >> z; return z; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> istream &operator>>(istream &is, pair<A, B> &p) { return is >> p.first >> p.second; }
template<typename T> ostream &operator<<(ostream &os, const vector<vector<T>> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : "\n"); return os; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : " "); return os; }
template<typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << ' ' << p.second; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
// clang-format on

int eulerPhi(int n) {
  int cnt = n;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      cnt -= cnt / i;
      while (n % i == 0) n /= i;
    }
  }
  if (n > 1) cnt -= cnt / n;
  return cnt;
}

main { cout << eulerPhi(in()) << endl; }



Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int inputCount;
  cin >> inputCount;
  vector<int> inputList(inputCount);
  // 入力値取得
  for (int i = 0; i < inputCount; i++) {
      int a;
      cin >> a;
      inputList.at(i) = a;
  }

  int cnt = 0;
  bool checkCounter = true;
  while(checkCounter) {
      for(int i = 0; i < inputList.size(); i++) {
          if (inputList[i] % 2 == 0) {
              inputList[i] = inputList[i] / 2;
          } else {
            checkCounter = false;
          }
      }
      if (checkCounter) {
          cnt++;
      }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
N, M = map(int, input().split())

def factorial(n):
    p = 1
    for i in range(n, 0, -1):
        p *= i
    return p


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


res = comb(M, 2) + comb(N, 2)

print(res)

Measured memory_bytes: 9012
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long MOD = 1e9 + 7;
const int MAX = 2010;
long long fac[MAX], finv[MAX], inv[MAX];
//invの要素にはiの逆元が格納されている
//前処理
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;//i!(mod MOD)を計算
        inv[i] = MOD - inv[MOD%i]* (MOD / i) % MOD;//iの逆元を計算
        finv[i] = finv[i - 1] * inv[i] % MOD;//i!(mod MOD)の逆元を計算
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;//nCk = n!/(k!*(n-k)!)を計算
}
int main(){
    COMinit();
    int N, K;
    cin >> N >> K;
    int aka = N - K;
    for(int i = 1; i <= K; i++){
        long long ans = COM(aka + 1, i) * COM(K - 1, i - 1) % MOD;
        cout << ans << endl;
    }
}

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

int main()
{
string a;
char g[26];
for(int i=0;i<26;i++) g[i]='a'+i;
int mum[26]={0};
for(;;){
getline(cin,a);
if((int)a.size()==0) break;
else{
for(int d=0;d<(int)a.size();d++){
for(int i=0;i<26;i++){
if('a'+i==a[d]||'A'+i==a[d]) mum[i]++;
}}}}
for(int i=0;i<26;i++) cout << g[i] << " : " << mum[i] << endl;

return 0;
}




Measured memory_bytes: 3160
// https://ei1333.github.io/luzhiled/
// http://beet-aizu.hatenablog.com/entry/2017/01/04/113233
// http://www.prefield.com/algorithm/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vd = vector<ld>;
using vs = vector<string>;
using vb = vector<bool>;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;
using Graph = vector<vector<ll>>;
const ll INF = 1LL << 60;
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
#define tl 1'000'000'007
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REREP(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, n) for (ll i = a; i < n; i++)
#define REFOR(i, n, a) for (ll i = n; i >= a; i--)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define debug cout << "line : " << __LINE__ << " debug" << endl;
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ind(...) long double __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define inc(...) char __VA_ARGS__; in(__VA_ARGS__)
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << endl;} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#define in1(A) REP(i,A.size()) in(A[i]);
#define in2(A,B) REP(i,A.size()) in(A[i],B[i]);
#define in3(s,t,u) REP(i,sz(s)){in(s[i] , t[i] , u[i]);}
#define in4(s,t,u,v) REP(i,sz(s)){in(s[i] , t[i] , u[i] , v[i]);}
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
struct Point{ ld x,y; };
ld dist(Point a, Point b){return sqrt(abs(a.x-b.x)*abs(a.x-b.x)+abs(a.y-b.y)*abs(a.y-b.y));} // ２点間の距離 
ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b;} 
ll fact(ll n){ if(n < 2) return 1; return (n * fact(n-1))%tl; } //階乗
inline ll updiv(ll a,ll b){ return (a + b - 1) / b; } //切り上げ
template<typename T,typename U>ll ceil(T a,U b){return (a + b - 1) / b;}
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
//-------------------------------------------------------------------------------------------------
void alfDfs(ll n, ll depth, ll kind,string s){
    if(depth==n){
        out(s);
        return;
    }
    // out(s);
    REP(i,kind+1){
        s[depth]= ('a'+i);
        alfDfs(n, depth+1, max(i+1,kind), s);
    }
    return;
}
int main(){
    init();
    inl(n);
    string s(n,'a');
    alfDfs(n,1,1,s);
    
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl '\n'
ll M = 1e9 + 7;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  ll r = c / b;
  if (c % b != 0)
    r++;
  ll s = a / d;
  if (a % d != 0)
    s++;
  if (r <= s)
    cout << "Yes";
  else
    cout << "No";
}

Measured memory_bytes: 3644
import Data.List

main :: IO ()
main = do
    s <- getLine
    print $ solve s

solve :: String -> Int
solve = (\(_, _, _, w) -> w) . foldl' op (1, 0, 0, 0)

op :: (Int, Int, Int, Int) -> Char -> (Int, Int, Int, Int)
op (x, y, z, w) 'A' = (x, y %+% x, z, w)
op (x, y, z, w) 'B' = (x, y, z %+% y, w)
op (x, y, z, w) 'C' = (x, y, z, w %+% z)
op (x, y, z, w) '?' = (3 %*% x, 3 %*% y %+% x, 3 %*% z %+% y, 3 %*% w %+% z)

infixl 6 %+%
(%+%) :: Int -> Int -> Int
x %+% y = (x + y) `mod` 1000000007

infixl 7 %*%
(%*%) :: Int -> Int -> Int
x %*% y = (x * y) `mod` 1000000007

Measured memory_bytes: 27004
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T> void assign(V<T>& v, int n, const T& a = T()) { v.assign(n, a); }
template<class T, class... U> void assign(V<T>& v, int n, const U&... u) { v.resize(n); for (auto&& i : v) assign(i, u...); }

int main() {
  cin.tie(NULL); ios::sync_with_stdio(false);
  int n; cin >> n;
  V<> a(101);
  for (int i = 0; i < 101; i++) {
    for (int j = i * 4; j < 101; j += 7) a[j] = 1;
  }
  cout << (a[n] ? "Yes" : "No") << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;


int main(){
    int n;
    int m;
    cin >> n >> m;

    vector<pair<int,int>> a(m);
    bool jud = true;

    rep(i,m){
        cin >> a[i].first >> a[i].second;
    }

    vector<int> d(n,-1);
    bool jud2 = false;


        rep(i,m){
            if(d[a[i].first-1] != -1 && d[a[i].first-1] != a[i].second){
                jud = false;
                break;
            }
            
            d[a[i].first-1] = a[i].second;
        }

        if(d[0] == 0 && n != 1) jud = false;

    rep(i,n){
        if(d[i] == -1) d[i] = 0;
    }

    if(jud){

    if(d[0] == 0 && n != 1) d[0] =1;
    }

    if(jud){
        rep(i,n){
            cout << d[i];
        }
        cout << endl;
    }

    else{
        cout << -1 << endl;
    }
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
#define io ios_base::sync_with_stdio(0);cin.tie(0);
#define mod 1000000009
#define pi 2*acos(0)
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
using namespace std;


int main()
{

	io;
	
	ll int a, b; cin >> a >> b;

	ll int gcd_ = gcd(a, b);
	ll  int pro = a * b;
	//gcd * lcm = a* b
	ll int ans = pro / gcd_;
	cout << ans;
}



Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
using pii = pair<int, int>;
ll mod = 1e9 + 7;
ll dp[1050][1050] = {};
int main() {
  int h, w;
  cin >> h >> w;
  vector<string> a(h);
  for (int i = 0; i < h; i++) {
    cin >> a[i];
  }
  // dp[i][j] := (i,j)までいくのに何通り？？(0-indexed)
  // dp[h-1][w-1]

  dp[0][0] = 1;

  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (a[i][j] != '#') {
        dp[i][j] = (i != 0 ? dp[i - 1][j] : 0) + (j != 0 ? dp[i][j - 1] : 0);
        dp[i][j] %= mod;
        dp[0][0] = 1;
      }
    }
  }
  cout << dp[h - 1][w - 1] << endl;
}

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

 typedef long long ll;

 int main()
 {
    int n;
    cin >> n;
    vector<int> h(n);
    for(int i = 0; i < n; i++) cin >> h.at(i);

    int y = h.at(0);
    int cnt = 0;
    int ans = 0;

    for(int i = 1; i < n; i++)
    {
        
        if(h.at(i) <= y)
        {
            y = h.at(i);
            cnt++;
        }
        else
        {
            y = h.at(i);
            ans = max(ans, cnt);
            cnt = 0;
        }
        
    }

    ans = max(ans, cnt);

    cout << ans << endl;

     
     return 0;
 }

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

int coun(int year, int month, int day);

int main(void)
{
	int n;
	int m;
	int d;
	int year;
	int month;
	int day;

	int sub;

	int i1;

	cin >> n;
	m = coun(1000, 1, 1);

	for(i1=0;i1<n;i1++){


		cin >> year >> month >> day;

		
		d = coun(year, month, day);

		sub = m - d;



		cout << sub << endl;
	}

	return 0;
}

int coun(int year, int month, int day)
{
	int i1;
	int d_n = 195;
	int d_unn = 200;
	int dai = 20;
	int syo = 19;
	int date = 0;


	for(i1=1;i1<year;i1++){
		if (i1%3==0){
			date += d_unn;
		}
		else {
			date += d_n;
		}
	}

	if (year%3 == 0){
		for(i1=1;i1<month;i1++){
			date += dai;
		}
	}
	else {
		for(i1=1;i1<month;i1++){
			if (i1%2==1){
				date += dai;
			}
			else{
				date += syo;
			}
		}
	}


	date += day;

	return date;
}

Measured memory_bytes: 1160
#include <iostream>
#define N 51
#define M 100001
using namespace std;

int main()
{
  while(true){
    int n,m;
    char mae[N],ato[N];
    cin >> n;
    if(n<=0) break;
    
    for(int i=0;i<n;i++){
      cin >> mae[i] >> ato[i];
    }
    cin >> m;
    
    for(int i=0;i<m;i++){
      char ch;
      cin >> ch;
      
      for(int j=0;j<n;j++){
	if(ch==mae[j]){
	  ch=ato[j];
	  break;
	}
      }
      cout << ch;
    }
    cout << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3084
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int D;
  cin >> D;
  vector<int> c(26);
  for (int &x : c) cin >> x;
  vector<vector<int>> s(D, vector<int>(26));
  for (auto &x : s) {
    for (int &y : x) cin >> y;
  }
  
  vector<vector<int>> last(D, vector<int>(26, -1));
  for (int d = 0; d < D; ++d) {
    if (d > 0) {
      for (int i = 0; i < 26; ++i) last.at(d).at(i) = last.at(d-1).at(i);
    }
    int max_vi = -100000000, max_i = 0, vi;
    for (int i = 0; i < 26; ++i) {
      vi = s.at(d).at(i);
      for (int j = 0; j < 26; ++j) {
        if (j == i) continue;
        vi -= c.at(i) * (d - last.at(d).at(i));
      }
      if (vi > max_vi) {
        max_vi = vi;
        max_i = i;
      }
    }
    cout << max_i + 1 << endl;
    last.at(d).at(max_i) = d;
  }
  return 0;
}



Measured memory_bytes: 3684
n, m = map(int, input().split())
a_list = [False]*(n+1)
for i in range(m):
    a = int(input())
    a_list[a] = True

amari = 1000000007

dp = [0]*(n+1)

dp[0] = 1
for i in range(1,n+1):
    if a_list[i]:
        dp[i] = 0
    elif i == 1:
        dp[i] = dp[0]
    else:
        dp[i] = dp[i-1]+dp[i-2]

print(dp[n]%amari)

Measured memory_bytes: 470648
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<numeric>
typedef long long ll;

using namespace std;

int main(){ 
    int n;
    cin >> n;

    cout << (n / 2) + (n % 2) << endl;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	//inp_out();
	ll n;
	cin>>n;

	vector<string> v;
	v.pb("a");

	for(ll i=2;i<=n;++i)
	{
		vector<string> temp;
		for(ll j=0;j<v.size();++j)
		{
			for(ll k=1;k<=i;++k)
			{
				string s=v[j];
				s+=('a'+k-1);
				temp.pb(s);
			}
		}
		v=temp;
	}

	for(ll i=0;i<(ll)v.size();++i)
	{
		ll flag=1;
		char cur='a';
		for(ll j=1;j<n;++j)
		{
			if((v[i][j]-cur)>1)
			{
				flag=0;
			}
			cur=max(cur,v[i][j]);
		}
		if(flag)
			cout<<v[i]<<"\n";
	}
	return 0;
}



Measured memory_bytes: 253520
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

char field[21][21];
bool obj[21][21];
int w,h;
pair<int,int> goal;
pair<int,int> start;

const int INF = 1000000;

int cnt = 0;

int dfs(int y,int x){
	int minCnt = INF;

	if(cnt >= 10){
		return minCnt;
	}

	// ツ湘」ツづ可督ョツつゥツつキ
	for(int i = 0; y - i >= 0; i++){
		if(y-i == goal.first && x == goal.second)
			return 1;
		if(y-i == 0)
			break;
		if(i == 0 && obj[y-i-1][x])
			break;
		if(y - i > 0 && obj[y-i-1][x]){
			obj[y-i-1][x]=false;
			cnt++;
			minCnt = min(minCnt,dfs(y-i,x)+1);
			cnt--;
			obj[y-i-1][x]=true;
			break;
		}
	}
	// ツ可コツづ可督ョツつゥツつキ
	for(int i = 0;  y + i <= h-1; i++){
		if(y+i == goal.first && x == goal.second)
			return 1;
		if(y + i == h-1 || (i == 0 && obj[y+i+1][x]))
			break;
		if(i != 0 && y+i < h-1 && obj[y+i+1][x]){
			obj[y+i+1][x]=false;
			cnt++;
			minCnt = min(minCnt,dfs(y+i,x)+1);
			cnt--;
			obj[y+i+1][x]=true;
			break;
		}
	}
	// ツ右ツづ可督ョツつゥツつキ
	for(int i = 0; x + i <= w-1; i++){
		if(y == goal.first && x+i == goal.second)
			return 1;
		if(x + i == w-1 || (i == 0 && obj[y][x+i+1]))
			break;
		if(i != 0 && x+i < w-1 && obj[y][x+i+1]){
			obj[y][x+i+1]=false;
			cnt++;
			minCnt = min(minCnt,dfs(y,x+i)+1);
			cnt--;
			obj[y][x+i+1]=true;
			break;
		}
	}
	// ツ債カツづ可督ョツつゥツつキ
	for(int i = 0; x - i >= 0; i++){
		if(y == goal.first && x-i == goal.second)
			return 1;
		if(x - i == 0 || (i == 0 && obj[y][x-i-1]))
			break;
		if(i != 0 && x - i > 0 && obj[y][x-i-1]){
			obj[y][x-i-1]=false;
			cnt++;
			minCnt = min(minCnt,dfs(y,x-i)+1);
			cnt--;
			obj[y][x-i-1]=true;
			break;
		}
	}
	return minCnt;
}

int main(){

	while(cin >> w >> h && !(w == 0 && h == 0)){
		for(int i = 0; i < 21; i++)
			fill(obj[i],obj[i]+21,false);
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				cin >> field[i][j];
				if(field[i][j] == '1'){
					obj[i][j] = true;
				}
				else if(field[i][j] == '2'){
					start.first = i;
					start.second = j;
				}
				else if(field[i][j] == '3'){
					goal.first = i;
					goal.second = j;
				}
			}
		}
		int ret = dfs(start.first,start.second);
		if(ret != INF)
			cout << ret << endl;
		else
			cout << -1 << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

constexpr int atcoder_mod = 1e9+7;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}

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

	int X=in();
	if(X==1){
		cout << 1 << endl;
		return 0;
	}
	int ans = 0;
	for(int i=2;;i++){
		int v = i;
		while(v*i<=X){
			ans = max(ans,v*i);
			v *= i;
		}
		if(i*i>X) break;
	}
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
MOD = int(1e9+7)
f = {}
f[0] = 1
for i in range(1, 100100):
    f[i] = f[i - 1] * i
    f[i] %= MOD

def mod_pow(x, y):
    if y == 0:
        return 1
    res = mod_pow(x * x % MOD, y // 2)
    if y & 1 == 1:
        res = res * x
    return res

def inverse(x):
    return mod_pow(x, MOD - 2)

def cmb(n, r):
    return f[n] * inverse(f[r] * f[n - r] % MOD)

n, m = map(int, input().split())
ans = 1
t = 2
while m >= t ** 2:
    cnt = 0
    while m % t == 0:
        m //= t
        cnt += 1
    if cnt > 0:
        ans *= cmb(n + cnt - 1, cnt) % MOD
        ans %= MOD
    t += 1
if m > 1:
    ans *= n
    ans %= MOD
print(ans)

Measured memory_bytes: 17900
N, M = map(int, input().split())
XYZ = [list(map(int, input().split())) for _ in range(M)]

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0]*(n+1)

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def same_check(self, x, y):
        return self.find(x) == self.find(y)

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

uf = UnionFind(N)
for xyz in XYZ:
    uf.union(xyz[0], xyz[1])

set_par = set()
for i in range(1, N+1):
    uf.find(i)
    set_par.add(uf.par[i])
print(len(set_par))

Measured memory_bytes: 38328
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        int max = L + N - 1;
        int sum = N * L + N * (N - 1) / 2;
        if (L > 0) {
            sum -= L;
        } else if (max < 0) {
            sum -= max;
        }
        System.out.println(sum);
    }
}


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

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int i=(first);i<(last);++i){cout<<#a<<"["<<i<<"] = "<<(a)[i]<<endl;}
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

using namespace std;

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

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

int main(void)
{
    string S;
    cin >> S;
    if (S.size() == 26) {
        RREP(i, 25) {
            if (S[i] < S[i + 1]) {
                REP(j, i) cout << S[j];
                RREP(j, 26) {
                    if (S[j] > S[i]) {
                        cout << S[j] << endl;
                        return 0;
                    }
                }
            }
        }
        cout << "-1" << endl;
    } else {
        for (char c = 'a'; c <= 'z'; ++c) {
            if (count(S.begin(), S.end(), c) == 0) {
                cout << S << c << endl;
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reprl(i, n) for(ll i = n; i >= 0; i--)
#define fori(i, m, n) for(int i = m; i < (int)n; i++)
#define forl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define all(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string bans(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  string s;cin>>s;
  bool ans=0;
  set<char> abc;
  rep(i,3){
    abc.insert(s[i]);
  }
  cout << bans(abc.size()==3) << endl;
  return 0;
}


Measured memory_bytes: 256
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>

#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) //[l, r)
#define rep(i,n) REP(i,0,n)           //[0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define shows(n) for(auto z:n){cerr<<z<<", ";}cerr<<endl
#define showslr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i];}cerr<<endl //[l, r))

#define yes puts("Yes")
#define no puts("No")
#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

inline void io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}

void _DEBUG(){cerr<<endl;}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<",";_DEBUG(b...);}

template<typename T> inline void in(T &e){cin>>e;}
template<typename H,typename... T>void in(H &a, T&... b){in(a);in(b...);}
template<typename T> inline void out(T e){cout<<e<<endl;}
template<typename H,typename... T> void out(H a, T... b){out(a);out(b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;

const int max_w=510;

int h,w;
vi grid[max_w];
vector<pair<pint,pint> > ki;

void p(pint from,pint to){
    printf("%lld %lld %lld %lld\n",from.fs,from.sc,to.fs,to.sc);
}

signed main(){
    io();

    in(h,w);
    rep(i,w) grid[i].resize(h+10);
    rep(y,h){
        rep(x,w){
            in(grid[x][y]);
        }
    }
    int tmp=0;
    rep(y,h){
        REPEAT(x,0,w,y%2==0){
            if(tmp!=0){
                grid[x][y]+=tmp;
                ki[ki.size()-1].sc={y+1,x+1};
            }
            //show(y+1,x+1,grid[x][y]);
            if(grid[x][y]&1) {
                tmp=grid[x][y];
                ki.pb({{y+1,x+1},{}});
            }else tmp=0;
        }
    }
    if(ki.size()>0){
        if(ki[ki.size()-1].sc.fs==0&&ki[ki.size()-1].sc.sc==0){
            ki.erase(ki.end()-1);
        }
    }

    out(ki.size());
    for(auto e:ki){
        p(e.fs,e.sc);
    }

    return 0;
}


Measured memory_bytes: 8564
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
    return b?gcd(b,a%b):a;
}
bool cmp(int x,int y)
{
    return x>y;
}
const int N=55;
const int mod=1e9+7;
ll dp[N][N*N];
int main()
{
    int n,a;
    cin>>n>>a;
    dp[0][0]=1;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        for(int j=i-1;j>=0;j--)    //每一次个数向下减少
            for(int k=0;k<=N*j;k++)    //优化时间  由于k最大为N*j次
                dp[j+1][k+x]+=dp[j][k];       //个数加1 则找到前面个数的值相加
    }
    ll ans=0;
    for(int i=1;i<=n;i++)
        ans+=dp[i][i*a];
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<array>
#include<string>
#include<stack>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<random>
#include<complex>
#include<bitset>
#include<chrono>
//#include<boost/multiprecision/cpp_int.hpp>
#define int int64_t
#define uint uint64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define SZ(X) ((int64_t)((X).size()))
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define Min(x) *min_element(ALL(x))
#define Max(x) *max_element(ALL(x))
#define Unique(L) (L.erase(unique(ALL(L)), L.end()))
#define intmax (std::numeric_limits<int64_t>::max() / 4)
#define doublemax (std::numeric_limits<double>::max() / 4)
using namespace std;
//typedef boost::multiprecision::cpp_int bigint;
const double EPS = 1e-9;
const double PI = acos(-1.0);



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

	string S, T;
	cin >> S >> T;

	vector<int>Si(S.size()+1, 0), Ti(T.size()+1, 0);
	rep(i, S.size()) {
		Si[i + 1] = S[i] == 'A' ? 2 : 1;
		Si[i + 1] += Si[i];
	}
	rep(i, T.size()) {
		Ti[i + 1] = T[i] == 'A' ? 2 : 1;
		Ti[i + 1] += Ti[i];
	}

	int q;
	cin >> q;
	rep(qq, q) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		a--; c--;

		int bnum = Si[b] - Si[a] - Ti[d] + Ti[c];
		if (abs(bnum) % 3 == 0)cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

Measured memory_bytes: 2512
SIZE=10**5+10; MOD=10**9+7 #998244353 #ここを変更する

SIZE += 1
inv = [0]*SIZE  # inv[j] = j^{-1} mod MOD
fac = [0]*SIZE  # fac[j] = j! mod MOD
finv = [0]*SIZE # finv[j] = (j!)^{-1} mod MOD
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
for i in range(2,SIZE):
    fac[i] = fac[i-1]*i%MOD
finv[-1] = pow(fac[-1],MOD-2,MOD)
for i in range(SIZE-1,0,-1):
    finv[i-1] = finv[i]*i%MOD
    inv[i] = finv[i]*fac[i-1]%MOD

def choose(n,r): # nCk mod MOD の計算
    if 0 <= r <= n:
        return (fac[n]*finv[r]%MOD)*finv[n-r]%MOD
    else:
        return 0

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,*a = map(int,read().split())

r = [-1]*(n+1)
for i,ai in enumerate(a):
    if r[ai]==-1:
        r[ai] = i
    else:
        p = r[ai]
        q = i
        break


for i in range(1,n+2):
    ans = choose(n+1,i)
    ans -= choose(p+n-q,i-1)
    print(ans%MOD)
    
    
    
    
    







Measured memory_bytes: 32452
#include <bits/stdc++.h>
using namespace std;
const int nmax=8;
bool graph[nmax][nmax];

int dfs(int v, int N, bool visited[nmax])
{
/**
 * @param v 探索開始頂点
 * @param N 頂点数
 * @param visited 訪問済みの頂点の配列
 */
    bool all_visited = true;

    for (int i = 0; i < N; i++)
    {
        if(visited[i] == false)
        {
            all_visited = false;
        }
    }
    if(all_visited)
    {
        return 1;
    }

    int ret = 0;

    for (int i = 0; i < N; i++)
    {
        if(graph[v][i]==false) continue;    //graph[v][i]が未接続ならpass
        if(visited[i]) continue;            //頂点iが訪問済みならpass

        visited[i] = true;
        ret += dfs(i, N, visited);
        visited[i] = false;
    }
    
    return ret;
    
}

int main(void)
{
    int N, M;
    cin >> N >> M;

    for (int i = 0; i < M; i++)
    {
        int A, B;
        cin >> A >> B;
        graph[A-1][B-1] = graph[B-1][A-1] = true;   //無向グラフのため 例：3<-->4
    }

    bool visited[nmax];
    for (int i = 0; i < N; i++)
    {
        visited[i] = false;     //全ての頂点は未訪問
    }

    visited[0] = true;      //頂点1は訪問済み
    cout << dfs(0, N, visited) << endl;
}

Measured memory_bytes: 256