git reimport

This commit is contained in:
2019-03-15 13:47:54 +04:00
commit 3b461f73de
489 changed files with 1631603 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package chelper;
import static misc.Stuff.min;
import io.InputReader;
import io.OutputWriter;
import misc.SimpleSavingChelperSolution;
public class A extends SimpleSavingChelperSolution {
public void solve(int testNumber, InputReader in, OutputWriter out) {
wrapSolve(testNumber, in, out);
}
@Override
public void solve(int testNumber) {
int n = in.nextInt() - 1;
int a = in.nextInt();
int b = in.nextInt();
int c = in.nextInt();
long ans = min(a * n, b * n);
if (n >= 1) {
ans = min(ans, a + c * (n - 1), b + c * (n - 1));
}
out.println(ans);
}
}