text: Trick for modular division ( ( x1 * x2 ... . xn ) / b ) mod ( m ) |
code: using System ; class GFG { public static void Main ( ) { long ans = 1 ; long mod = ( long ) 1000000007 * 120 ; for ( int i = 0 ; i < 5 ; i ++ ) ans = ( ans * ( 55555 - i ) ) % mod ; ans = ans / 120 ; Console . Write ( " Answer ▁ using ▁ " + " shortcut : ▁ " + ans ) ; } }