akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author hakamada
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AtCoder109_2 solver = new AtCoder109_2();
        solver.solve(1, in, out);
        out.close();
    }

    static class AtCoder109_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String phrase = in.nextLine();
            String matcher = in.nextLine();
            if (phrase.compareTo(matcher) == 0) {
                out.println("Yes");
                return;
            }


            for (int i = 1; i < phrase.length(); i++) {
                String work1 = matcher.substring((matcher.length() - i));
                String work2 = matcher.substring(0, (matcher.length() - i));
                String work3 = work1 + work2;
                if (work3.compareTo(phrase) == 0) {
                    out.println("Yes");
                    return;

                }
            }

            out.println("No");
        }

    }
}



Measured memory_bytes: 21844
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		int N = nextInt();
		ArrayList<Integer> one = nextIntArray();
		int D = one.get(0);
		int X = one.get(1);
		int output = 0;
		for(int i = 0; i < N; i++){
			int tmp = 1;
			int add = nextInt();
			while(tmp <= D){
				output++;
				tmp += add;
			}
		}
		myout(output + X);
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 32568
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
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); }

ll comb_count(int n, int m) {
  if (m == 0)
    return 1;
  if (n == 0)
    return 0;
  return (n * comb_count(n - 1, m - 1) / m);
}

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

  int n;
  string s;
  cin >> n >> s;

  map<char, int> mp;
  int diff = 0;
  rep(i, 0, s.size()) {
    if (i < s.size() - 2) {
      if (s[i] != s[i + 1] && s[i] != s[i + 2] && s[i + 1] != s[i + 2])
        diff++;
    }
    mp[s[i]]++;
  }
  ll r = mp['R'], g = mp['G'], b = mp['B'];
  ll ans = r * g * b;
  rep(i, 0, n) {
    rep(j, 0, n) {
      if (i - j < 0 || i + j >= n)
        break;
      if (s[i] != s[i - j] && s[i - j] != s[i + j] && s[i] != s[i + j])
        ans--;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 3652
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      String[] line;
      MyList list = new MyList();

      for(int i=0; i<n; i++) {
        line = br.readLine().split(" ");
        switch( line[0] ) {
          case "insert" :
            list.insertFirst( Integer.parseInt(line[1]) );
            break;
          case "deleteFirst" :
            list.deleteFirst();
            break;
          case "deleteLast" :
            list.deleteLast();
            break;
          case "delete" :
            list.delete( Integer.parseInt(line[1]) );
            break;
          default :
        }
      }

      System.out.println ( list.getAllElements() );
    }
  }
}

class Node {
  Node next,prev;
  int key;

  public Node(int key) {
    this.key = key;
  }
}

class MyList {
  Node nil;
  Node current;
  int size;

  public MyList() {
    nil = new Node(0);
    nil.next = nil.prev = nil;
    size = 0;
  }

  public String getAllElements() {
    StringBuilder buf = new StringBuilder(size*3);

    if(size > 0){
      current = nil.next;
      for(int i=0; i<size; i++){
        buf.append(current.key).append(" ");
        current = current.next;
      }
    }
    buf.setLength(buf.length()-1);

    return buf.toString();
  }
  public void insertFirst(int x) {
    if(size == 0) {
      current = new Node(x);
      nil.next = current;
      nil.prev = current;
      current.prev = nil;
      current.next = nil;
      size++;
    }
    else {
      Node add = new Node(x);
      
      current.prev.next = add;
      add.prev = current.prev;

      add.next = current;
      current.prev = add;

      current = add;
      size++;
    }
  }
  public void deleteFirst() {
    nil.next = current.next;
    current.next.prev = current.prev;

    current = current.next;
    size--;
  }
  public void deleteLast() {
    current = nil.prev;

    nil.prev = current.prev;
    current.prev.next = current.next;

    current = nil.next;
    size--;
  }
  public void delete(int x) {
    Node target = findFirst(x);

    if(target == nil) current = current.next;
    else {
      current.prev.next = target.next;
      current.next.prev = target.prev;
      current = nil.next;
      size--;
    }
  }
  private Node findFirst(int x) {
    while(current != nil) {
      if(current.key == x) break;
      current = current.next;
    }

    return current;
  }
}


Measured memory_bytes: 189908
#include <stdio.h>


int main()
{
    int a, b, c, d;
    int ans;

    int division_right;
    
    scanf("%d %d %d %d", &a, &b, &c, &d);

    if (a <= c)
    {
	// cが区間の左端？
	// a---b  c---d
	
	// 区間は重なっている？
	if (b < c)
	{
	    ans = 0;
	}
	else
	{
	    if (b <= d)      // a---c--b---d
	    {
		division_right = b;
	    }
	    else             // a---c--d---b
	    {
		division_right = d;
	    }
	    ans = division_right - c;
	}
    }
    else
    {
	// aが区間の左端？
	// c-----d a-----b

	// 区間は重なっている？
	if (d < a)
	{
	    ans = 0;
	}
	else
	{
	    if (d <= b)     // c---a--d--b
	    {
		division_right = d;
	    }
	    else            // c---a--b---d
	    {
		division_right = b;
	    }
	    ans = division_right - a;
	}
    }

    printf("%d\n", ans);

    return 0;
}


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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }

typedef pair<int,int> P;



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

    cout << n*n*n << endl;
    return 0;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    map<ll, ll> cnt;
    rep(i, N) {
        cnt[A[i]]++;
    }
    ll re = 0;
    ll m = 0;
    for (auto x: cnt) {
        if (x.second >= 2) {
            if (x.second % 2 == 0) {
                re += x.second - 2;
                m++;
            } else {
                re += x.second - 1;
            }
        }
    }
    ll ans = N - re;
    if (m % 2 == 0) {
        ans -= m;
    }else{
        ans -= m + 1;
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

struct Edge{
  int to, id;
};

vector<vector<Edge>> g;
vector<int> ans;

void dfs(int v, int c = -1, int p = -1){
  int k = 1;
  for(int i = 0; i < g[v].size(); ++i){
    int nv = g[v][i].to, ei = g[v][i].id;
    if(nv == p)continue;
    if(k == c)++k;
    ans[ei] = k;
    ++k;
    dfs(nv, ans[ei], v);
  }
}

int main(){
  int n;
  cin >> n;
  g.resize(n);
  ans = vector<int>(n - 1);

  for(int i = 0; i < n - 1; ++i){
    int a, b;
    cin >> a >> b;
    --a; --b;
    g[a].push_back((Edge){b, i});
    g[b].push_back((Edge){a, i});
  }

  int root = 0;
  dfs(root);
  int mx = 0;
  for(int i = 0; i < n; ++i){
    mx = max(mx, int(g[i].size()));
  }
  cout << mx << endl;
  for(int i = 0; i < n - 1; ++i){
    cout << ans[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 8320
#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <queue>
#include <stdio.h>
#include <cstdio>
#include <math.h>
#include <cmath>
#include <sstream>
#include <cassert>
#include <functional>
#include <cfloat>
#include <climits>
#include <cstring>
#include <stack>
#include <time.h>
#include <complex>
using namespace std;
int main()
{
    int M;
    cin>>M;
    cout<<48-M;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;

    int dx = tx-sx, dy = ty - sy;    
    cout << string(dy, 'U') << string(dx, 'R');
    cout << string(dy, 'D') << string(dx, 'L');
    cout << 'L' << string(dy+1, 'U') << string(dx+1, 'R') << 'D';
    cout << 'R' << string(dy+1, 'D') << string(dx+1, 'L') << 'U';
    cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define HERE cout<<"here - "<<__LINE__<<"\n";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout<<endl;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cout << *it << " = " << a << " ";
    err(++it, args...);
}
#else
#define HERE
#define debug(args...)
#endif
const ll mod = 998244353 ;
const int N = 1e5+5;
typedef pair<int,int> pii;




void TEST_CASES(int cas)
{
    ll x,k,d;
    cin>>x>>k>>d;
    x= abs(x);
    if(k*d>=0 && x- k*d >=0)
    {
        printf("%lld\n",x-k*d);
        return;
    }
    ll a = x%d;
    ll b= abs(a - d);
    k-= x/d;
    if(k%2==0)
    {
        printf("%lld\n",a);
    }
    else{
        printf("%lld\n",b);
    }

}


/*

*/

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1,cas=0;
    //scanf("%d",&t);
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}



template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


Measured memory_bytes: 3760
#include "bits/stdc++.h"
using namespace std;
int a[200010], b[200010];

int main(int argc, char const *argv[])
{
	int n;
	scanf("%d", &n);
	
	long long P = 0, Q = 0;
	long long X = 0, Y = 0;
	int cnt = 0;
	bool good = true;
	for(int i = 1; i <= n; i++) {
		scanf("%d %d", &a[i], &b[i]);
		good &= (a[i] == b[i]);
		if(a[i] <= b[i]) {
			P += b[i] - a[i];
			Q += a[i];
		} else {
			X += a[i] - b[i];
			Y += b[i];
			++cnt;
		}
	}
	long long ans = 0;
	if(good) {
		printf("0\n");
		exit(0);
	}
	ans += Q;
	ans += P;
	if(cnt == 1) printf("%lld\n", ans);
	else {
		ans += Y;
		int opt = INT_MAX;
		for(int i = 1; i <= n; i++) {
			if(b[i] < a[i]) {
				opt = min(opt, b[i]);
			}
		}
		ans -= opt;
		printf("%lld\n", ans);
	}
	return 0;
}

Measured memory_bytes: 384
#![allow(non_snake_case)]
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let N:usize = sc.read();
    let S:Vec<char> = sc.chars();
    if N%2 == 1{
        println!("No");
        return
    }
    let mut ans = true;
    let k = N/2;
    for i in 0..k{
        if S[i] != S[i+k]{
            ans = false;
            break
        }
    }
    if ans{
        println!("Yes");
    }else{
        println!("No");
    }

}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
        .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}




Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define ll long long
 
int main(int qtd, char* nome[])
{
	ios::sync_with_stdio(false);
	cin.tie(0);
 
	int n, m;
	cin >> n >> m;
	if(n == m)
		cout << "Yes\n";
	else
		cout << "No\n";
	
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int ans = 1;
		
		for (int i = 2; i * i <= n; i++) {
			for (int j = i * i; j <= n; j *= i) {
				ans = Math.max(ans, j);
			}
		}
		
		System.out.println(ans);
		
	}
	
}

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

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,j,N) for(int i = (N-1);i >= (j);i--)
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define LL long long

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}

const int maxc = 31;
int D[maxc][maxc];

struct P{
    int cost;
    int color;
    P(int costs,int colors):cost(costs),color(colors){;}
    bool operator<(const P &o){
        return cost < o.cost;
    }
};

vector<int> vi[3];
vector<P> vp[3];

int main()
{
    int N,C;
    cin >> N >> C;
    _rep(i,1,C){
        _rep(j,1,C){
            scanf("%d",&D[i][j]);
        }
    }

    _rep(i,1,N){
        _rep(j,1,N){
            int num;
            scanf("%d",&num);
            vi[(i+j)%3].push_back(num);
        }
    }

    _for(i,0,3){
        _rep(c,1,C){
            int val = 0;
            _for(j,0,vi[i].size()){
                int num = vi[i][j];
                val += D[num][c];
            }
            P s(val,c);
            vp[i].push_back(s);
        }
    }

    _for(i,0,3){
        sort(ALL(vp[i]));
    }


    int a = min(3,(int)vp[0].size());
    int b = min(3,(int)vp[1].size());
    int c = min(3,(int)vp[2].size());

    int ans = 1e9+5;

    _for(i,0,a){
        _for(j,0,b){
            _for(k,0,c){
                P p1 = vp[0][i];
                P p2 = vp[1][j];
                P p3 = vp[2][k];
                if(p1.color == p2.color || p1.color == p3.color || p2.color == p3.color) continue;
                ans = min(ans,p1.cost + p2.cost + p3.cost);

            }
        }
    }

    if(ans == 1e9+5) ans = 0;
    cout << ans << endl;

    return 0;
}


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

using namespace std;
using ll = long long;
using ld = long double;
using Vec = vector<int>;

int main() {
    
int n;
cin>>n;
Vec vec(1000000);
int x=1,y=1,z=1,ct=0;
for(int i=1;i<=100;i++){
    
    for(int j=1;j<=100;j++){

       for(int k=1;k<=100;k++){
  
       x=i,y=j,z=k;

       vec[ct]=x*x+y*y+z*z+x*y+y*z+z*x;
       ct++;
       }
    }

}
 

int t=0;
sort(vec.begin(),vec.end());
for(int i=1;i<=n;i++){
  int count=0;
    for(int j=t;j<1000000;j++){
   
   if(vec[j]==i){
       count++;
   }
    if(vec[j]>i){
       t=j-1;
       cout<<count<<endl;
       break; 
   } 

    }
}

 

}
 

Measured memory_bytes: 7000
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define int long long
typedef long long ll;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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

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

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

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

  int yes = false;
  rep(i, 3) {
    if (N[i] == '7')
      yes = true;
  }
  if (yes)
    cout << "Yes\n";
  else
    cout << "No\n";
}

Measured memory_bytes: 3652
#include<stdio.h>
int main()
{
    int a, b;
    scanf("%d %d", &a,&b);
    if(a<b)
    {
        printf("a < b\n");
    }
    else if(a>b)
    {
        printf("a > b\n");
    }
    else if(a==b)
    {
        printf("a == b\n");
    }
    return 0;
}



Measured memory_bytes: 2044
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <stack>
using namespace std;
string s;
long long a;
int f;
char* ans = "ILMU";
int main()
{
	cin>>s>>a;
	stack<long long> st;
	long long v=0;
	for (int i = 0; i < s.size(); i++)
	{
		if(i&1){
			if(s[i]=='+')
				v+=s[++i]-'0';
			else if(s[i]=='*')
				v*=s[++i]-'0';
			else;
		}
		else v=s[i]-'0';
	}
	if(v==a)f+=1;
	v=0;
	for (int i = 0; i < s.size(); i++){
		if(i&1){
			if(s[i]=='*'){
				long long top = st.top();st.pop();
				top*=s[++i]-'0';
				st.push(top);
			}
		}
		else st.push(s[i]-'0');
	}
	while(!st.empty()){
		v+=st.top();
		st.pop();
	}
	if(v==a)f+=2;
	cout<<ans[f]<<endl;
	return 0;
}


Measured memory_bytes: 1204
#include <iostream>
using namespace std;
int S[14],H[14],D[14],C[14];
int main() {
  int n;cin >> n;

  for(int i = 0;i<n;i++){
    char a;int x;cin >> a >> x;
    if(a == 'S') S[x] = 1;
    else if(a == 'H') H[x] = 1;
    else if(a == 'D') D[x] = 1;
    else if(a == 'C') C[x] = 1;
  }
  for(int i = 1;i<=13;i++){
    if(S[i] == 0) cout << 'S' << ' ' << i << endl;
  }
  for(int i = 1;i<=13;i++){
    if(H[i] == 0) cout << 'H' << ' ' << i << endl;
  }
  for(int i = 1;i<=13;i++){
    if(C[i] == 0) cout << 'C' << ' ' << i << endl;
  }
  for(int i = 1;i<=13;i++){
    if(D[i] == 0) cout << 'D' << ' ' << i << endl;
  }
  
}


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n; cin>>n;
    if(n<=1000) cout<<(1000-n)<<"\n";
    else
    {
        ll k=n%1000;
        if(k==0) cout<<0<<"\n";
        else cout<<(1000-k)<<"\n";
    }
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    string s;
    cin>>s;
    FOR(i,1,s.size()){
        if((s.size()-i)%2==0){
            int sz=s.size()-i;
            if(s.substr(0,sz/2)==s.substr(sz/2,sz/2)){
                cout<<sz<<endl;return 0;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;

namespace AtCoder_Beginner_Contest_129
{
    class Program
    {
        static public int[] Sarray() { return ReadLine().Split().Select(int.Parse).ToArray(); }
        static public List<int> Slist() { return ReadLine().Split().Select(int.Parse).ToList(); }

        static void Main(string[] args)
        {
            var HW = Sarray();
            var H = HW[0];
            var W = HW[1];
            var sharpH = new List<int>[H];
            var sharpW = new List<int>[W];
            var masuH = new int[H, W];
            var masuW = new int[H, W];
            for (var i = 0; i < H; ++i)
            {
                sharpH[i] = new List<int>();
            }
            for (var j = 0; j < W; ++j)
            {
                sharpW[j] = new List<int>();
            }
            //#の場所を記録
            for (var i = 0; i < H; ++i)
            {
                var line = ReadLine();
                for(var j =0;j<W;++j)
                {
                    if (line[j] == '#')
                    {
                        sharpH[i].Add(j);//i行のj列
                        sharpW[j].Add(i);//j列のi行
                    }
                }
            }
            //光の届くマス数(横)
            for (var i = 0; i < H; ++i)
            {
                int pre = -1;
                foreach(var s in sharpH[i])
                {
                    var num = s - pre - 1;
                    for (int j = pre + 1; j < s; ++j)
                    {
                        masuH[i, j] = num;
                    }
                    pre = s;
                }
                var nokori = W - pre - 1;
                for (int j = pre + 1; j < W; ++j)
                {
                    masuH[i, j] = nokori;
                }
            }
            //光の届くマス(縦)
            for (var i = 0; i < W; ++i)
            {
                int pre = -1;
                foreach (var s in sharpW[i])
                {
                    var num = s - pre - 1;
                    for (int j = pre + 1; j < s; ++j)
                    {
                        masuW[j, i] = num;
                    }
                    pre = s;
                }
                var nokori = H - pre - 1;
                for (int j = pre + 1; j < H; ++j)
                {
                    masuW[j, i] = nokori;
                }
            }

            //範囲を見ていく
            long max = 0;
            for (var i = 0; i < H; ++i)
            {
                for (var j = 0; j < W; ++j)
                {
                    max=Math.Max(max, masuW[i, j] + masuH[i, j] - 1);
                }
            }
            WriteLine(max);
        }
    }
}


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

using namespace std;
vector<long long> factors;
#define ll long long

#define pii pair<int,int>
#define pll pair<ll,ll>
#define _ <<'\n'
#define __ << ' '
#define all(x) (x).begin(), (x).end()
#define gcd __gcd
int IT_MAX = 1 << 17;
int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
#define szz(x) (int)(x).size()
#define IOS ios_base::sync_with_stdio(false); cout.tie(0);cin.tie(0);
#define flush fflush(stdout)

ll mod(ll a, ll m)
{ return (a + (abs(a) / m) * m + m) % m; }

//****************************don't use int!!!!!!!****************************//
//***************************code starts here!!!!!****************************//

int main()
{
	IOS

	string st;
	cin >> st;
	int count_0 = 0;
	int count_1 =0;
	for(int i = 0;i < st.size(); ++i)
	{
		if(st[i] == '0')
			++count_0;
		else
			++count_1;
	}
	cout << 2 * min(count_1,count_0);
	return 0;
}

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

#define lld long long
#define pp pair<int,int>
#define pb push_back
#define MOD 1000000007
#define left lleft
#define right rright
#define INF 2000000000
#define Linf 1000000000000000000LL
#define next nnext
#define minus mminus

using namespace std;

int N; lld ans;
int par[100002];
struct data{
	int num;
	lld x,y;
}a[100002];
vector<pair<int,pair<int,int>>> edge;

int getpar(int x){
	return (x == par[x])?x:par[x]=getpar(par[x]);
}

int main(){
	scanf("%d",&N);
	for(int i=1; i<=N; i++){
		scanf("%lld %lld",&a[i].x,&a[i].y);
		a[i].num= i;
		par[i] = i;
	}
	sort(a+1,a+N+1,[&](data &x,data &y){
		return x.x < y.x;
	});
	for(int i=1; i<N; i++){
		edge.pb({a[i+1].x-a[i].x,{a[i].num,a[i+1].num}});
	}
	for(int i=2; i<=N; i++){
		edge.pb({a[i].x-a[i-1].x,{a[i].num,a[i-1].num}});
	}
	sort(a+1,a+N+1,[&](data &x,data &y){
		return x.y < y.y;
	});
	for(int i=1; i<N; i++){
		edge.pb({a[i+1].y-a[i].y,{a[i].num,a[i+1].num}});
	}
	for(int i=2; i<=N; i++){
		edge.pb({a[i].y-a[i-1].y,{a[i].num,a[i-1].num}});
	}
	sort(edge.begin(),edge.end());
	for(auto &i : edge){
		int value;
		int x,y;
		value = i.first;
		x = i.second.first; y = i.second.second;
		x = getpar(x); y = getpar(y);
		if(x == y) continue;
		ans += value;
		par[x] = y;
	}
	printf("%lld\n",ans);

	return 0;
}


Measured memory_bytes: 11248
#include<bits/stdc++.h>
#define F first
#define S second
using namespace std;
 
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<vvvi> vvvvi;


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vi V(n);
    for (int i = 0; i < n; ++i) cin >> V[i];
    vi ans(n);
    for (int i = 0; i < n; ++i) ans[0] += i%2 ? -V[i] : V[i];
    for (int i = 1; i < n; ++i) {
        ans[i] = V[i-1]*2 - ans[i-1];
    }
    for (int i = 0; i < n; ++i) cout << ans[i] << " ";
    cout << "\n";
    return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
  int n;
  cin>>n;
  int a[n];
  int cnt=1;
  int check=0;
  rep(i,n) cin>>a[i];
  rep(i,n){
    if(a[i]==1){
      check++;
    }
  }
  if(check==0){
    cout<<-1<<endl;
    return 0;
  }
  rep(i,n){
    if(a[i]==cnt) cnt++;
  }
  cout<<n-cnt+1<<endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

void solve(){
	int n;
	cin>>n;
	vector<ll>a(n);
	rep(i,n)cin>>a[i];
	sort(begin(a),end(a));
	ll maxv=a.back();
	//nCk=n*(n-1)*....*(n-k+1)/k!のため、nは大きいほど良いことがわかる
	auto k=lower_bound(a.begin(),a.end(),(maxv+1)/2);
	ll ansk;
	if(*k==(maxv+1)/2)ansk=*k;
	else if(*(k)-(maxv+1)/2<(maxv+1)/2-*prev(k))ansk=*(k);
	else ansk=*prev(k);
	//真ん中((maxv+1)/2)からなるべく近いもの選ぶ
	cout<<maxv<<" "<<ansk<<endl;
}

signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	solve();
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main(){
    int X,Y,A,B,C;
    cin>>X>>Y>>A>>B>>C;
    
    vector<int> p(A);for(int i=0;i<A;++i)cin>>p[i];
    vector<int> q(B);for(int i=0;i<B;++i)cin>>q[i];
    vector<int> r(C);for(int i=0;i<C;++i)cin>>r[i];
    
    sort(p.begin(),p.end(),greater<int>{});
    sort(q.begin(),q.end(),greater<int>{});
    
    vector<int> s(X+Y);
    s.insert(s.end(),p.begin(),p.begin()+X);
    s.insert(s.end(),q.begin(),q.begin()+Y);
    s.insert(s.end(),r.begin(),r.end());
    sort(s.begin(),s.end(),greater<int>{});
    
    cout<<accumulate(s.begin(),s.begin()+X+Y,0ll)<<endl;
}


Measured memory_bytes: 5056
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>

#define DIV 998244353
#define TE 2e5
using namespace std;
using ll = long long;
using ldb = long double;

int main() {
	int N; cin >> N;
	vector<int> D(N);
	vector<int> cnt(13);
	for (int i = 0; i < N; i++){
		cin >> D[i];
		cnt[D[i]]++;
	}
	bool z = true;
	for (int i = 0; i <= 12; i++) {
		if (cnt[i] >= 3 || cnt[0] >= 1) z = false;
	}
	if (!z) cout << 0 << endl;
	else {
		int ans = -1;
		if (N >= 24) cout << 0 << endl;
		else if (N == 23) {
			cout << 1 << endl;
		}
		else {
			int mx = pow(2, N);
			for (int i = 0; i < mx; i++) {
				vector<int> bit(N);
				int temp = i;
				for (int j = 0; temp; j++) {
					bit[j] = temp % 2;
					temp /= 2;
				}
				vector<int> time(N);
				for (int j = 0; j < N; j++) {
					if (bit[j])time[j] = 24 - D[j];
					else time[j] = D[j];
				}
				sort(time.begin(), time.end());
				int di = time[0];
				for (int k = 1; k < N; k++) {
					di = min(di, time[k] - time[k - 1]);
				}
				di = min(di, 24 - time[N - 1]);
				ans = max(ans, di);
			}
			cout << ans << endl;
		}
	}
}

Measured memory_bytes: 384
#include <iostream>
#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define debug int debug = 0;
#define RREP(i,a) for(int i=a-1;i>=0;i--)
#define rrep(i,a,b) for(int i=a-1;i>=b;i--)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 1000000007; //10^9+7

int main() {
    ll d, n;
    cin >> d >> n;
    ll ans = 1;
    ans *= pow(100, d) * n;
    if(n == 100){ans += pow(100, d);}
    print(ans);
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;

int main() {
	ll x, a, b;
	cin >> x >> a >> b;
	if (-a + b <= 0) {
		cout << "delicious" << endl;
	} else if (- a + b >= x + 1) {
		cout << "dangerous" << endl;
	} else {
		cout << "safe" << endl;
	}
	return 0;
}


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

int main(void) {
    int N, Q;
    while (cin >> N >> Q, N||Q) {
        vector<vector<int>> Date(N);
        int d, M;
        for (int i = 0; i < N; i++) {
            cin >> M;
            for (int j = 0; j < M; j++) {
                cin >> d;
                Date[i].push_back(d);
            }
        }

        int max_num = 0;
        int max_cnt = 0;
        for (int i = 1; i <= 100; i++) {
            int cnt = 0;
            for (int j = 0; j < N; j++) {
                for (int k = 0; k < Date[j].size(); k++) {
                    if (i == Date[j][k]) cnt++;
                }
            }
            if (cnt > max_cnt) {
                max_cnt = cnt;
                max_num = i;
            }
        }

        if (max_cnt >= Q) {
            cout << max_num << endl;
        } else {
            cout << 0 << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 3088
#include<bits/stdc++.h>
#define rep(i,j,k) for(int i=(j);i<(k);i++)
#define mp make_pair
#define sz(a) (int)(a).size()
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef long double ld;
//----head----
int arr[30];
char str[100005];
int main()
{
	scanf("%s",str);
	for(int i=0;str[i];i++)arr[str[i]-'a']++;
	rep(i,0,26)if(!arr[i])
	{
		printf("%c\n",i+'a');
		return 0;
	}
	puts("None");
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = 1; i <= n; i++)
#define drep(i, n) for(int i = n-1; i >= 0; i--)
#define srep(i, s, t) for (int i = s; i < t; i++)
#define vi vector<int>
#define P pair<ll, ll>
using namespace std;
int mod = 1'000'000'000 + 7;
struct edge {
    int to;
    ll cost;
};
namespace mp = boost::multiprecision;

void COME_LET_THE_GAMES_BEGIN() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(20);
}

int main() {
    COME_LET_THE_GAMES_BEGIN();
    set<int> s;
    for (int i = 1; i < (1 << 9); i++) {
        for (int j = (1 << 9) - 1; j > 0; j--) {
            j &= (1 << 9) - 1 - i;
            if (j == 0)continue;
            for (int p = (1 << 9); p > 0; p >>= 1) {
                int k = (p - 1) - i - j;
                if (k <= 0)break;
                int a[] = {i, j, k};
                int b[] = {7, 5, 3};
                int r = 0;
                for (int x = 0; x < 3; x++) {
                    for (int y = 1; a[x] > 0; a[x] >>= 1, y *= 10) {
                        r += y * b[x] * (a[x] & 1);
                    }
                }
                s.insert(r);
            }
        }
    }
    int N;
    cin >> N;
    int ans = 0;
    for (auto x:s) {
        if (N >= x) {
            ans++;
        } else {
            break;
        }
    }
    cout << ans << endl;
}

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

int main(){
  int n;
  cin >> n;
  vector<int> l(n);
  for(int i = 0; i < n; i++) cin >> l[i];
  sort(l.begin(), l.end());
  
  int ans = 0;
  
  for(int i = 0; i < n-1; i++){
  for(int j = i+1; j < n; j++){
  	int k = lower_bound(l.begin(), l.end(), l[i]+l[j]) - l.begin();
  	ans += max(0, k-j-1);
  }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define ROOT 0
#define INTERNAL 1
#define LEAF 2

struct node {
  int id;
  int k;
  struct node *parent;
  int depth;
  int type;
  int *child_id;
  struct node **child;
};

struct node *tree;
int n;

void set_parameter(struct node *p);

int main(int argc, char *argv[])
{
  int i, j, border, num, ch;
  struct node *tmp;
  
  scanf("%d", &n);

  tree = (struct node *)malloc(sizeof(struct node) * n);

  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    tree[num].id = num;
    scanf("%d", &(tree[num].k));
    if (tree[num].k != 0) {
      tree[num].child_id = (int *)malloc(sizeof(int) * (tree[num].k));
      tree[num].child = (struct node **)malloc(sizeof(struct node *) * (tree[num].k));
      for (j = 0; j < tree[num].k; j++) {
	scanf("%d", &(tree[num].child_id[j]));
      }
    } else {
      tree[num].child_id = NULL;
      tree[num].child = NULL;
    }
    tree[num].parent = NULL;
  }

  for (i = 0; i < n; i++) {
    for (j = 0; j < tree[i].k; j++) {
      ch = tree[i].child_id[j];
      tree[ch].parent = &tree[i];
      tree[i].child[j] = &tree[ch];
    }
  }

  for (i = 0; i < n; i++) {
    if (tree[i].parent == NULL) break;
  }
  set_parameter(&tree[i]);

  for (i = 0; i < n; i++) {
    printf("node %d: ", tree[i].id);
    
    if (tree[i].parent == NULL) printf("parent = -1, ");
    else printf("parent = %d, ", tree[i].parent->id);
    
    printf("depth = %d, ", tree[i].depth);
    
    if (tree[i].type == ROOT) printf("root, ");
    else if (tree[i].type == INTERNAL) printf("internal node, ");
    else printf("leaf, ");

    printf("[");
    for (j = 0; j < tree[i].k; j++) {
      if (j != tree[i].k - 1) printf("%d, ", tree[i].child[j]->id);
      else printf("%d", tree[i].child[j]->id);
    }
    printf("]\n");
  }

  return 0;
}

void set_parameter(struct node *p)
{
  int i;

  if (p->parent == NULL) {
    p->depth = 0;
    p->type = ROOT;
  } else {
    p->depth = p->parent->depth + 1;
    if (p->k == 0) p->type = LEAF;
    else p->type = INTERNAL;
  }

  for (i = 0; i < p->k; i++) set_parameter(p->child[i]);
}

Measured memory_bytes: 5928
#include <stdio.h>

int h, w;
char field[51][51] = {};
int already[51][51] = {};

int flag = 0;

void check_field(int x, int y){

  if(x < 0 || x >= w || y < 0 || y >= h) return;

  //すでに調査済みなら
  if(already[y][x] == 1) return ;

  already[y][x] = 1;

  if(field[y+1][x] == '.' && field[y-1][x] == '.' && field[y][x-1] == '.' && field[y][x+1] == '.'){
    flag = 1;
  }

  return;
}

int main(){
  int i, j;

  scanf("%d %d", &h, &w);

  for(i = 0; i < h; i++){
    scanf("%s", field[i]);
  }

  for(i = 0; i < h; i++){
    for(j = 0; j < w; j++){
      if(field[i][j] == '#' && already[i][j] == 0) check_field(j,i);
    }
  }

  if(flag == 1){
    printf("No");
  } else {
    printf("Yes");
  }

  return 0;
}

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

int a[100001];

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

    //IN
    for(int i=0; i < n; i++){
        int tmp;
        cin >> tmp;
        a[tmp] += 1;
    }

    int ans = 0;
    //search
    for(int i=0; i < 100001-2; i++){
        int sum = a[i] + a[i+1] + a[i+2];
        ans = max(ans, sum);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main(){
    string n;
    cin >> n;
    int a = 0;
    for(int i=0; i<n.size(); i++){
        a += n[i] - '0';
    }
    if(stoi(n)%a==0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
def COMinit():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2,max):
        fac[i] = fac[i-1]*i%mod
        inv[i] = mod - inv[mod%i]*(mod//i)%mod
        finv[i] = finv[i-1]*inv[i]%mod

def COM(n,k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k]*finv[n-k]%mod)%mod

mod = 998244353
N,M,K = map(int,input().split())

max = N + 1
fac = [0] * max
finv = [0] * max
inv = [0] * max
COMinit()
ans = 0
for i in range(K+1):
    c = COM(N-1,i)
    m = pow(M-1,N-i-1,mod)
    ans = (ans + ((c*m%mod)*M%mod))%mod
print(ans)


Measured memory_bytes: 75500
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int n; cin >> n;
    VI a(n); cin >> a;
    SORT(a);
    int x = a.front() + a.back() >> 1;
    cout << max(x - a.front(), a.back() - x) << "\n";
}


Measured memory_bytes: 3180
#include <bits/stdc++.h>
#include <unistd.h>
#define ll long long
#define inf 1000000007
#define inf16 0x3f3f3f3f
#define INF 1000000000000000007LL
#define VI vector<int>
#define VPII vector<pair<int, int> >
#define VLL vector<ll>
#define PII pair<int, int>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define endl '\n'
#define ALL(c) (c).begin(), (c).end()
using namespace std;

#define int ll

int h, w, n, k, ans;

int pot[50*50];

int query(int y1, int y2, int x1, int x2)
{
	cout << "? " << y1 << " " << x1 << " " << y2 << " " << x2 << endl;
	int ans;
	cin >> ans;
	return ans;
}

void solve(int y1, int y2, int x1, int x2, int cnt, int split)
{
	if(cnt==0)
		return;

	if(cnt==(y2-y1+1)*(x2-x1+1))
	{
		for(int i = y1; i <= y2; ++i)
		{
			for(int j = x1; j <= x2; ++j)
			{
				ans += pot[i*w+j];
				ans %= k;
			}
		}

		return;
	}

	if(y1!=y2)//split)
	{
		int m = (y1+y2)/2;
		int h = query(y1, m, x1, x2);
		solve(y1, m, x1, x2, h, split^1);
		solve(m+1, y2, x1, x2, cnt-h, split^1);
	}
	else
	{
		int m = (x1+x2)/2;
		int h = query(y1, y2, x1, m);
		solve(y1, y2, x1, m, h, split^1);
		solve(y1, y2, m+1, x2, cnt-h, split^1);
	}
}

int32_t main()
{
	cin >> h >> w >> n >> k;

	pot[0] = 1;

	for(int i = 1; i < 50*50; ++i)
	{
		pot[i] = pot[i-1]*2%k;
	}

	for(int j = 0; j < w; j += 8)
	{
		solve(0, h-1, j, min(j+7, w-1), query(0, w-1, j, min(j+7, w-1)), 1);
	}

	/*for(int i = 0; i < h; i += 5)
	{
		for(int j = 0; j < w; j += 5)
		{
			solve(i, i+4, j, j+4, query(i, i+4, j, j+4), 1);
		}
	}*/

	//solve(0, h-1, 0, w-1, n, 1);

	cout << "! " << ans << endl;
}

Measured memory_bytes: 724
#include"iostream"
using namespace std;
 
int main() {
	int n;
	cin >> n;
	if (n > 17 || n == 4 || n == 7 || n == 8 || n == 11 || n == 12 || n == 14 || n == 15 || n == 16)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <list>

using namespace std;



int main(void){
    long long N,ans=0,tmp;
    map<long long,long long>X,Y;

    cin>>N;


    for(long long i=1;i<=N;i++){
        cin>>tmp;
        X[i+tmp]++;
        Y[i-tmp]++;
        }

    for(auto itr=X.begin();itr != X.end();++itr){
        ans=ans + X[itr->first] * Y[itr -> first];
    }


    cout<<ans<<endl;





    return 0;
}



Measured memory_bytes: 37752
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
int n;
int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	if(n>=30)
	cout<<"Yes\n";
	else
	cout<<"No\n";
	re 0;
}

Measured memory_bytes: 3608