public class M416Damage {
  
  private static final double HAND_DAMAGE_RATIO = 30;
  
  public static void main(String[] args) {
    int numShots = 5;
    int targetDefense = 20; 
    
    double maxHandDamage = calculateMaxHandDamage(targetDefense);
    double totalHandDamage = calculateTotalHandDamage(maxHandDamage, numShots);
    
    System.out.println("Maximum hand hit damage for M416：" + maxHandDamage);
    System.out.println(numShots + "5The sum of the hand hit injuries in each shot.：" + totalHandDamage);
  }
  
  private static double calculateMaxHandDamage(int targetDefense) {

    double maxTotalDamage = 200;
    double maxHandDamage = maxTotalDamage * HAND_DAMAGE_RATIO;
    
    
    maxHandDamage -= targetDefense;
    
    if (maxHandDamage < 0) {
      maxHandDamage = 0;
    }
    
    return maxHandDamage;
  }
  
  private static double calculateTotalHandDamage(double maxHandDamage, int numShots) {
    return maxHandDamage * numShots;
  }
  
}
