305247: CF997B. Roman Digits

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Roman Digits

题意翻译

我们在研究罗马数字。罗马数字只有4个字符,I,V,X,L分别代表1,5,10,100。一个罗马数字的值为该数字包含的字符代表数字的和,而与字符的顺序无关。例如XXXV=35,IXI=12. 现在求问一个长度为 $n$ 的罗马数字可以有多少种不同的值。( $n \leq 10^9$ ) 感谢@litble 提供翻译

题目描述

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.

输入输出格式

输入格式


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 a single integer — the number of distinct integers which can be represented using $ n $ roman digits exactly.

输入输出样例

输入样例 #1

1

输出样例 #1

4

输入样例 #2

2

输出样例 #2

10

输入样例 #3

10

输出样例 #3

244

说明

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

题意翻译

我们在研究罗马数字。罗马数字只有 $4$ 个字符,$\tt{I,V,X,L}$ 分别代表 $1,5,10,50$。一个罗马数字的值为该数字包含的字符代表数字的和,而与字符的顺序无关。例如 $\tt{XXXV}=35$,$\tt{IXI}=12$。 现在求问一个长度为 $n$ 的罗马数字可以有多少种不同的值。($n \leq 10^9$)。 感谢@litble 提供翻译。

加入题单

上一题 下一题 算法标签: