Submit solution

Points: 1500 (partial)
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Problem type

Testing problem, khuyến khích không nên làm

Cho 1 số nguyên dương n. Tính kết quả n!\ mod\ 10^9, biết n!=1.2.3...(n-1)nmod là phép chia lấy dư

Input(Bàn phím):

  • Gồm 1 số nguyên dương n(1\le n\le 10^{18}).

Output(Màn hình):

  • In ra kết quả của n!\ mod\ 10^9.

Standard input

6

Standard output

720

Subtask:

  • 50% số test có 1\le n\le 50
  • 25% số test có 1\le n\le 10^9
  • 25% số test có 1\le n\le 10^{18}

Comments

There are no comments at the moment.