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\) và \(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\) và \(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
Contests:
- Ngày 19/11/2024 (19 Nov., 2024)
Comments