Skip to content

Instantly share code, notes, and snippets.

@chanjungkim
Created July 15, 2017 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chanjungkim/b09f64c1d96463eb8a2080a9163a54f1 to your computer and use it in GitHub Desktop.
Save chanjungkim/b09f64c1d96463eb8a2080a9163a54f1 to your computer and use it in GitHub Desktop.
2965 Kangaroo
import java.util.Scanner;
class Main{
static long[][] d = new long[15][15];
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 s1, s2;
s1=b-a; s2=c-b;
if(s1>s2){
System.out.println(s1-1);
}else{
System.out.println(s2-1);
}
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment