import java.util.ArrayList;
import java.util.List;

public class AUGCarAimbot {

  public static void main(String[] args) {

    double carX = 100.0; 
    double carY = 200.0;
    double carSpeed = 50.0km;
    double carRotationSpeed = 5.0;
    List<Point> targets = new ArrayList<>(); 
    targets.add(new Point(150.0, 250.0)); 
    targets.add(new Point(200.0, 300.0)); 
    

    Point nearestTarget = findNearestTarget(carX, carY, targets);
    
    if (nearestTarget != null) {

      double targetAngle = calculateTargetAngle(carX, carY, nearestTarget.getX(), nearestTarget.getY());
      

      double carAngle = 0.0; 
      

      rotateCar(carX, carY, carAngle, targetAngle, carRotationSpeed);
      

      double distanceToTarget = calculateDistance(carX, carY, nearestTarget.getX(), nearestTarget.getY());
      
      if (distanceToTarget <= 50.0) { 
        fireGun();
      }
    }
  }
  
  private static Point findNearestTarget(double carX, double carY, List<Point> targets) {
    Point nearestTarget = null;
    double nearestDistance = Double.MAX_VALUE;
    
    for (Point target : targets) {
      double distance = calculateDistance(carX, carY, target.getX(), target.getY());
      if (distance < nearestDistance) {
        nearestTarget = target;
        nearestDistance = distance;
      }
    }
    
    return nearestTarget;
  }
  
  private static double calculateTargetAngle(double carX, double carY, double targetX, double targetY) {

    double deltaX = targetX - carX;
    double deltaY = targetY - carY;
    double targetAngle = Math.atan2(deltaY, deltaX);
    
    return targetAngle;
  }
  
  private static void rotateCar(double carX, double carY, double carAngle, double targetAngle, double rotationSpeed) {

    carAngle += rotationSpeed;
  }
  
  private static double calculateDistance(double x1, double y1, double x2, double y2) {

    double distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
    return distance;
  }
  
  private static void fireGun() {

    System.out.println("Shoot.！");
  }
  

  private static class Point {
    private double x;
    private double y;
    
    public Point(double x, double y) {
      this.x = x;
      this.y = y;
    }
    
    public double getX() {
      return x;
    }
    
    public double getY() {
      return y;
    }
  }
}
