Click Here to go back to the homepage.

Skocimis Solution:


import java.util.Scanner;

public class Kattis {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int solution = b - a > c - b ? b - a - 1 : c - b - 1;
    System.out.println(solution);
  }
}