Codeforces Round 493 (Div. 1)
B
Roman Digits
Codeforces
2000
原题
← AC →
翻译中…

Let's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers $1$, $5$, $10$ and $50$ respectively. The use of other roman digits is not allowed.

翻译中…

Numbers in this system are written as a sequence of one or more digits. We define the value of the sequence simply as the sum of digits in it.

翻译中…

For example, the number XXXV evaluates to $35$ and the number IXI — to $12$.

翻译中…

Pay attention to the difference to the traditional roman system — in our system any sequence of digits is valid, moreover the order of digits doesn't matter, for example IX means $11$, not $9$.

翻译中…

One can notice that this system is ambiguous, and some numbers can be written in many different ways. Your goal is to determine how many distinct integers can be represented by exactly $n$ roman digits I, V, X, L.

翻译中…

Input

翻译中…

The only line of the input file contains a single integer $n$ ($1 \le n \le 10^9$) — the number of roman digits to use.

翻译中…

Output

翻译中…

Output a single integer — the number of distinct integers which can be represented using $n$ roman digits exactly.

翻译中…

Note

翻译中…

In the first sample there are exactly $4$ integers which can be represented — I, V, X and L.

翻译中…

In the second sample it is possible to represent integers $2$ (II), $6$ (VI), $10$ (VV), $11$ (XI), $15$ (XV), $20$ (XX), $51$ (IL), $55$ (VL), $60$ (XL) and $100$ (LL).

翻译中…

样例

Input #1
1
Output #1
4
InputCopy OutputCopy
Input #2
2
Output #2
10
InputCopy OutputCopy
Input #3
10
Output #3
244
InputCopy OutputCopy
题目信息
题号
997B
时间限制
1 s
内存限制
256 MB
标签
暴力
组合数学
动态规划
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。