fork download
  1. import kotlin.math.*
  2.  
  3. fun main() {
  4.  
  5. var (n,m) = readLine()!!.split(" ").map {it.toInt()}
  6.  
  7. if(n>m){
  8. var tmp=n
  9. n=m
  10. m=tmp
  11. }
  12.  
  13. println(min(n+m, 2*n+1))
  14.  
  15. }
Success #stdin #stdout 0.12s 41232KB
stdin
5 11
stdout
11