public class M416DamageOptimizer {
  
  public static void main(String[] args) {

    int baseBulletDamage = 40; 
    double fireRate = 8.0;
    

    int maxDamage = calculateMaxDamage(baseBulletDamage, fireRate);
    
    System.out.println("High Damage Maximizer for M416：" + maxDamage);
  }
  
  private static int calculateMaxDamage(int baseBulletDamage, double fireRate) {
    int maxDamage = 0;
    
    for (int i = 1; i <= 30; i++) {
      
      int totalDamage = baseBulletDamage * i;
      
      
      double shotsPerSecond = fireRate / i;
      
   
      int damagePerSecond = (int) (totalDamage * shotsPerSecond);
      
      
      if (damagePerSecond > maxDamage) {
        maxDamage = damagePerSecond;
      }
    }
    
    return maxDamage;
  }
}
