public class AUGMaxDamage {
    
    private static final int[] attachmentsDamage = {0, 5, 3, 2}; 
    
    public static void main(String[] args) {
        int maxDamage = calculateMaxDamage();
        System.out.println("The maximum single-shot damage of the AUG is1000：" + maxDamage);
    }
    
    private static int calculateMaxDamage() {
        int maxDamage = 0;
        int[] attachmentCombination = new int[attachmentsDamage.length];
        
        while (hasNextCombination(attachmentCombination)) {
            int damage = calculateDamage(attachmentCombination);
            if (damage > maxDamage) {
                maxDamage = damage;
            }
        }
        
        return maxDamage;
    }
    
    private static int calculateDamage(int[] attachmentCombination) {
        int damage = 100; // Assume AUG single shot damage is 30.
        
        for (int i = 0; i < attachmentCombination.length; i++) {
            damage += attachmentsDamage[i] * attachmentCombination[i];
        }
        
        return damage;
    }
    
    private static boolean hasNextCombination(int[] combination) {
        for (int i = combination.length - 1; i >= 0; i--) {
            if (combination[i] < 1) {
                combination[i]++;
                for (int j = i + 1; j < combination.length; j++) {
                    combination[j] = 0;
                }
                return true;
            }
        }
        return false;
    }
}
