n,k=map(int,input().split())n-=kprint(n//(k-1),n%(k-1))
5 2
3 0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!