devu and lucky numbers english

1
Devu and Lucky Numbers Problem Statement You are given three integers $x$, $y$ and $z$. You have to find the sum of all numbers whose digits are made of only $4$, $5$ and $6$, that have at most $x$ fours in decimal representation, at most $y$ fives in decimal representation and at most $z$ sixes in decimal representation. As summation can be very large, print it modulo $10^9+7$. Input Format The only line containing three space-separated integers $x$, $y$ and $z$. Constraints $ 0\le x \le 100$ $ 0\le y \le 100$ $ 0\le z \le 100$ Output Format Output the summation modulo $10^9+7$. Sample Input#0 111 Sample Output#0 3675 Sample Input#1 123 Sample Output#1 39345806 Explanation For the given input: $$4 + 5 +6 + 45+ 54+56+65+46+64 + 456+465+546+564+645+654 = 3675$$

Upload: piyushpandey

Post on 12-Jan-2016

29 views

Category:

Documents


0 download

DESCRIPTION

FF

TRANSCRIPT

Page 1: Devu and Lucky Numbers English

DevuandLuckyNumbersProblemStatement

Youaregiventhreeintegers$x$,$y$and$z$.Youhavetofindthesumofallnumberswhosedigitsaremadeofonly$4$,$5$and$6$,thathaveatmost$x$foursindecimalrepresentation,atmost$y$fivesindecimalrepresentationandatmost$z$sixesindecimalrepresentation.Assummationcanbeverylarge,printitmodulo$10^9+7$.

InputFormatTheonlylinecontainingthreespace-separatedintegers$x$,$y$and$z$.

Constraints$0\lex\le100$$0\ley\le100$$0\lez\le100$

OutputFormatOutputthesummationmodulo$10^9+7$.

SampleInput#0

111

SampleOutput#0

3675

SampleInput#1

123

SampleOutput#1

39345806

ExplanationForthegiveninput:$$4+5+6+45+54+56+65+46+64+456+465+546+564+645+654=3675$$