Jump it up
All submissions for this problem are available.
Three dinos go on a camping trip. There they decide to play a game. They mark distances of 1 km each on the ground up to 100 km i.e. 1, 2, 3...100. They can sit only on these 100 spots, with each one at a different spot. In one move, one of the outer dinos can hop into a spot between the other two.
Help them maximise their duration of play.
Three numbers(integers), l, m and n (0 < l < m < n < 100), the starting spots of the dinosaurs.
Output the largest number of jumps the dinosaurs can make in all.
Input 4 5 7 Output 1 Input 5 6 11 Output 4
|Time Limit:||0.436508 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.