You are viewing a single comment's thread. Return to all comments →
Go Solution
package main import "fmt" func main(){ var n,p,newN,newP int fmt.Scanf("%d",&n) fmt.Scanf("%d",&p) if n%2==0{ newN=n+1 }else{ newN=n } if p%2==0{ newP=p+1 }else{ newP=p } fromFront:=(newP-1)/2 fromBack:=(newN-p)/2 if fromFront<=fromBack{ fmt.Println(fromFront) }else{ fmt.Println(fromBack) } }
Seems like cookies are disabled on this browser, please enable them to open this website
Drawing Book
You are viewing a single comment's thread. Return to all comments →
Go Solution