Tính toán với phép mod

View as PDF

Points: 5 (p) Time limit: 1.0s Memory limit: 1G Input: stdin Output: stdout

Cho hai số \(a\)\(b\). Hãy tính \((a+b)\%mod, (a-b)\%mod, (a*b)\%mod\).

Input

  • Một dòng duy nhất chứa hai số \(a\)\(b\). \((-2.10^{18} \leq a,b \leq 2.10^{18})\)
  • Bài toán này sử dụng \(mod=10^9+7\)

Output

  • Dòng duy nhất chứa kết quả \((a+b)\%mod\).
  • Dòng thứ hai chứa kết quả \((a-b)\%mod\).
  • Dòng thứ hai chứa kết quả \((a*b)\%mod\).
Sample
Input
2 3
Output
5
1000000006
6

Comments

Most recent
Loading comments...

There are no comments at the moment.

Contests: