Million Dollar Man
All submissions for this problem are available.Ronny is an industrialist running a firm DISCO. His total earning on $i$$th$ day is equal to sum of thrice the total earning made by the firm DISCO on previous day and four times the total earning made by the firm DISCO two days back. Your task is to compute total earning made by Ronny on $N$$th$ day. You are given $A$ and $B$ where $A$ denotes total earning made by Ronny on first day and $B$ denotes total earning made by Ronny on second day. Since answer can be very large output Total Earning modulo $10$$9$$+ 7$. ###Input: - First line will contain single integer $N$, number of days. - Second line contain two space separated integer $A$ and $B$ as mentioned above ###Output: Output a single integer denoting total earning made by Ronny on $N$$th$ day. ###Constraints - $1 \leq N \leq 10^9$ - $1 \leq A,B \leq 10^9$ ###Sample Input: 3 1 2 ###Sample Output: 10 ###Explanation: Total Earning $=$ $3 * (Total Earning on Day 2) + 4 * (Total Earning on Day 1)$ Prepared by : [Shrey](https://www.codechef.com/users/shreyk5) and [Himanshu](https://www.codechef.com/users/himanshushkl69)
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.