Problem:
Score : 200 points

Problem Statement

Takahashi has two positive integers A and B.

It is known that A plus B equals N.
Find the minimum possible value of "the sum of the digits of A" plus "the sum of the digits of B" (in base 10).

Constraints

2 ≤ N ≤ 10^5

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the minimum possible value of "the sum of the digits of A" plus "the sum of the digits of B".

Sample Input 1

15

Sample Output 1

6

When A=2 and B=13, the sums of their digits are 2 and 4, which minimizes the value in question.

Sample Input 2

100000

Sample Output 2

10

Solution in C++14 (GCC 5.4.1) (judge verdict: Runtime Error)

/*
Problem:B - RGB Coloring
Algorithm:Maths
Status:
*/

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <utility>
#include <list>
#include <ctime>
#include <memory.h>
#include <stack>
#include <stdio.h>
#include <string.h>

using namespace std;

const long long INF=998244353ll;
const long long mod=998244353ll;

typedef long long ll;

long long c[300005];
long long a,b,n;
long long k;

long long fpower(long long x,long long y){
	if(y=0)return 1l;
	if(y=1)return x;
	if(y&1){
		long long tmp=fpower(x,y/2);
		return (((tmp*tmp)%INF)*x)%INF;
	}
	long long tmp=fpower(x,y/2);
	return (tmp*tmp)%INF;
}

ll mpow(ll a,ll b,ll mod){
 if(b==0) return 1;
 ll ans=mpow(a,b/2,mod);
 if(b%2==1){
  return ans*ans%mod*a%mod;
 }else{
  return ans*ans%mod;
 }
}


ll inv(ll a,ll mod){
 return mpow(a,mod-2,mod);
}

/*
void pre(){
	C[0]=1;
	for(long long i=1;i<=n;i++){
		C[i]=(C[i-1]*(n-i+1));
		C[i]=(C[i]%(INF*i))/i;
		//cout<<C[i]<<endl;
	}
	
}
*/

int main()
{
	long long ans=0;

	cin>>n>>a>>b>>k;
	
	c[0]=1;
	for(ll i=1,j=n; i<=n; i++,j--)  {
 		ll ooo=j*inv(i,mod)%mod;
 		c[i]=c[i-1]*ooo%mod; 
	}
	
	for(long long an=0;an<=n;an++){
		if((k-an*a)%b==0){
			int bn=(k-an*a)/b;
			ans+=(c[an]*c[bn])%INF;
		}
	}
	cout<<ans%INF<<endl;
	
	return 0;
}