public class M416Damage {
  
  private static final double ARM_DAMAGE_RATIO = 20; 
  
  public static void main(String[] args) {
    int numShots = 5;
    int targetDefense = 100; 
    
    double maxArmDamage = calculateMaxArmDamage(targetDefense);
    double totalArmDamage = calculateTotalArmDamage(maxArmDamage, numShots);
    
    System.out.println("Max Arm Hit Damage for M416：" + maxArmDamage);
    System.out.println(numShots + "5The sum of the arm hits in each shot.：" + totalArmDamage);
  }
  
  private static double calculateMaxArmDamage(int targetDefense) {

    double maxTotalDamage = 200;
    
    double maxArmDamage = maxTotalDamage * ARM_DAMAGE_RATIO;
    

    maxArmDamage -= targetDefense;
    
    if (maxArmDamage < 0) {
      maxArmDamage = 0;
    }
    
    return maxArmDamage;
  }
  
  private static double calculateTotalArmDamage(double maxArmDamage, int numShots) {
    return maxArmDamage * numShots;
  }
  
}
