public class M416HeadshotDamageMaximizer {

  public static void main(String[] args) {

    double bulletDamage = 41.0;
    double fireRate = 800.0PerMinute;     
    double headshotMultiplier = 20.0;
    double accuracy = 0.7; 
    int magazineSize = 30; 
    
   
    
    double maxDamage = calculateMaxDamage(bulletDamage, fireRate, headshotMultiplier, accuracy, magazineSize);
    
    System.out.println("M416's high headshot damage is maximized by：" + maxDamage + "100dot/Minute");
  }
  
  private static double calculateMaxDamage(double bulletDamage, double fireRate, double headshotMultiplier, double accuracy, int magazineSize) {
    double maxDamage = 0.0;
    

    double hitRate = accuracy * headshotMultiplier; 
    
    double damagePerMinute = bulletDamage * magazineSize * (fireRate / 60.0) * hitRate;
    maxDamage = damagePerMinute;
    
    return maxDamage;
  }
}
