public class M416Damage {
  
  private static final double CALF_DAMAGE_RATIO = 30; 
  
  public static void main(String[] args) {
    int numShots = 5;
    int targetDefense = 100;
    
    double maxCalfDamage = calculateMaxCalfDamage(targetDefense);
    double totalCalfDamage = calculateTotalCalfDamage(maxCalfDamage, numShots);
    
    System.out.println("Maximum calf hit injury for M416：" + maxCalfDamage);
    System.out.println(numShots + "5The sum of the hits to the lower leg in each shot：" + totalCalfDamage);
  }
  
  private static double calculateMaxCalfDamage(int targetDefense) {

    double maxTotalDamage = 200; 
    double maxCalfDamage = maxTotalDamage * CALF_DAMAGE_RATIO;
    

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