@@ -0,0 +1,1044 @@
+// https://codeforces.com/problemset/problem/1271/A%0A%0Aimport java.util.Scanner;%0A%0Apublic class Solution %7B%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner read = new Scanner(System.in);%0A%09%09%0A%09%09int a = read.nextInt(); // tie count%0A%09%09int b = read.nextInt(); // scarf count%0A%09%09int c = read.nextInt(); // vest count%0A%09%09int d = read.nextInt(); // jacket count%0A%09%09%0A%09%09int e = read.nextInt(); // 1st type suit (1 tie + 1 jacket) price%0A%09%09int f = read.nextInt(); // 2nd type suit (1 scarf + 1 vest + 1 jacket) price%0A%09%09%0A%09%09int maxCost = 0;%0A%09%09int numberOfFirstTypeSuits = 0;%0A%09%09int numberOfSecondTypeSuits = 0;%0A%09%09%0A%09%09if (e %3E f) %7B%0A%09%09%09int min = Math.min(a, d);%0A%09%09%09numberOfFirstTypeSuits = min;%0A%09%09%09d -= min;%0A%09%09%09numberOfSecondTypeSuits = Math.min(b, Math.min(c, d));%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09int min = Math.min(b, Math.min(c, d));%0A%09%09%09numberOfSecondTypeSuits = min;%0A%09%09%09d -= min;%0A%09%09%09numberOfFirstTypeSuits = Math.min(a, d);%0A%09%09%7D%0A%09%09%0A%09%09maxCost = numberOfFirstTypeSuits * e + numberOfSecondTypeSuits * f;%0A%09%09System.out.println(maxCost);%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%0A%7D%0A

Create Suits.java