import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
class ArmorPiece {
    protected int maxDurability;
    protected int currentDurability;
    
    public ArmorPiece(int durability) {
        this.maxDurability = durability;
        this.currentDurability = durability;
    }
    public double getDamageBoostRatio() {
        return 1.0 - (double)currentDurability / maxDurability;
    }
    public void degrade(int amount) {
        currentDurability = Math.max(0, currentDurability - amount);
    }
    
    public int getCurrentDurability() {
        return currentDurability;
    }
}
class BerserkerWarrior {
    private ArmorPiece chestplate;
    private ArmorPiece helmet;
    private int baseAttack;
    private int chestplateDegradeAmount; 
    private int helmetDegradeAmount;  
    
    public BerserkerWarrior(int chestplateDurability, int helmetDurability, int baseAttack, 
                            int chestplateDegradeAmount, int helmetDegradeAmount) {
        this.chestplate = new ArmorPiece(chestplateDurability);
        this.helmet = new ArmorPiece(helmetDurability);
        this.baseAttack = baseAttack;
        this.chestplateDegradeAmount = chestplateDegradeAmount;
        this.helmetDegradeAmount = helmetDegradeAmount;
    }
    
    public int performAttack() {
        double totalBoost = chestplate.getDamageBoostRatio() 
                          + helmet.getDamageBoostRatio();
        int finalDamage = (int)(baseAttack * (1 + totalBoost));
        
        chestplate.degrade(chestplateDegradeAmount);
        helmet.degrade(helmetDegradeAmount);
        
        return finalDamage;
    }
public class HighRiskCombat {
    public static void main(String[] args) {
        Properties config = new Properties();
        try (FileInputStream fis = new FileInputStream("dconfig.ini")) {
            config.load(fis);
        }
        
        int chestplateDurability = Integer.parseInt(config.getProperty("ChestplateDurability"));
        int helmetDurability = Integer.parseInt(config.getProperty("HelmetDurability"));
        int baseAttack = Integer.parseInt(config.getProperty("BaseAttack"));
        int chestplateDegradeAmount = Integer.parseInt(config.getProperty("ChestplateDegradeAmount"));
        int helmetDegradeAmount = Integer.parseInt(config.getProperty("HelmetDegradeAmount"));
        
        BerserkerWarrior warrior = new BerserkerWarrior(
            chestplateDurability, helmetDurability, baseAttack, 
            chestplateDegradeAmount, helmetDegradeAmount
        );
        while(warrior.hasArmorLeft()) {
            warrior.displayStatus();
        }
    }
