n,k = map(int,input().split()) a = (n+k-1)//k if a<30: print(a**2-1) else: b = 30//a c = 30%a print((75497471**b*c**2)%998244353)