Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Control.Applicative
- main :: IO ()
- main = do
- [n, x] <- map read . words <$> getLine
- putStrLn $ show $ if x <= (div n 2) then x - 1 else n - x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement