Logo
(追記) (追記ここまで)

3398번 - Stickers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 128 MB2311100.000%

문제

Charles is an auto races fan and he has decided to make his own model’s collection. In the shop it is possible to buy models in closed and covered boxes. In each box there are parts for one model and a set of stickers with images of digits. In every box the set of stickers is the same. Charles decided to label models by consecutive integers starting from 1. For example, to label the 2070-th model four stickers are necessary: one sticker with ”2”, two with ”0” and one with ”7”.

Charles completes every model in the following way: he opens a new box, builds the model and labels it using sticker(s). He can use stickers from current and previously opened boxes, but it is not allowed to open an additional new box to get at missing stickers.

Write a program which for a given set of stickers counts how many models Charles can label in the described way.

입력

In the only line of input ten one-digit integers

i0, i1, i2, i3, i4, i5, i6, i7, i8, i9

are given, where ij is the number of stickers with digit j,(0 ≤ j ≤ 9) in the sticker set of every box. Each two neighbour digits are separated by one space symbol.

출력

The only line of output should contain one integer – number of labeled models.

제한

예제 입력 1

1 1 1 1 1 1 1 1 1 1

예제 출력 1

199990

예제 입력 2

3 4 5 4 3 4 5 4 3 4

예제 출력 2

49999999499999999949999999973

힌트

출처

Olympiad > Baltic Olympiad in Informatics > BOI 2000 5번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /