Click Here to go back to the homepage.

Heart Rate Solution:


import java.util.Scanner;

public class Kattis {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int cases = sc.nextInt();
    for (int i = 0; i < cases; i++) {
      int b = sc.nextInt();
      double p = sc.nextDouble();
      double bpm = 60 * b / p;
      double variance = 60 / p;
      System.out.printf("%f %f %f%n", bpm - variance, bpm, bpm + variance);
    }
  }
}