n = int(input()) for i in range(1,n+1): x,y = map(int,input().split()) mok = x//y nameoji = x%y print('#{} {} {}'.format(i,mok,nameoji))