fork download
  1. #include <iostream>
  2. using namespace std;
  3. int mod = 1000000007;
  4. long long exp(int b, int e){
  5. long long a = 1;
  6. long long x = b;
  7. while(e){
  8. if(e%2) a = (a*x)%mod;
  9. x = (x*x)%mod;
  10. e = e/2;
  11. }
  12. return a;
  13. }
  14. long long inv(int n){
  15. return exp(n,mod-2);
  16. }
  17. int main() {
  18. cout<<inv(12);
  19. return 0;
  20. }
Success #stdin #stdout 0s 4184KB
stdin
Standard input is empty
stdout
83333334