【BZOJ3239】Discrete Logging