Advertisement
Guest User

Untitled

a guest
Nov 11th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const int MOD = 1e9+7;
  6.  
  7. typedef long long ll;
  8.  
  9. template<class T> T sum(T x) { return x; }
  10. template<class H, class... T> H sum(H h, T... t) {
  11.     H ans = h+sum(t...);
  12.     if (ans >= MOD) ans -= MOD;
  13.     else if (ans < 0) ans += MOD;
  14.     cout << ans << endl;
  15.     return ans;
  16. }
  17. template<class T> ll mul(T x) { return x; }
  18. template<class H, class... T> ll mul(H h, T... t) {
  19.     return h*ll(mul(t...))%MOD;
  20. }
  21.  
  22. int main() {
  23.     int a, b, c; cin >> a >> b >> c;
  24.     cout << mul(1000000000, 2, sum(a, b, -c)) << endl;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement