单点时限: 1.0 sec
内存限制: 512 MB
This is a simple question. This is a simple question.This is a simple question.
You are given four integers $N , A , B$ and $C$.
Now you have a integer $K$ ($K = 0$ initially).
Each time you can choose one of the following operations:
Find the minimun cost to get $N$.
There are multiple test cases in this problem.$(T\leq 10^5+5)$
In each test case,there is only one line contains four integers $N(1\leq N\leq 10^9)$, $A(0\leq A\leq 10^9)$, $B(0\leq B\leq 10^9)$, $C(0\leq C\leq 10^9)$.
For each test case print one line for the minimun cost to get $N$.
1 0 0 0 10 1 10 1 10 1 0 10 10 10 0 1
0 10 2 12