Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. import Control.Applicative
  2.  
  3. main :: IO ()
  4. main = do
  5. [n, x] <- map read . words <$> getLine
  6.  
  7. putStrLn $ show $ if x <= (div n 2) then x - 1 else n - x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement