Find the Kth number which is not divisible by N | C # implementation to find the K 'th non-divisible number of N ; Function to find the Kth not divisible by N ; Driver Code ; Function Call
using System ; class GFG { static int kthNonDivisible ( int N , int K ) { return ( int ) ( K + Math . Floor ( ( double ) ( K - 1 ) / ( N - 1 ) ) ) ; } public static void Main ( String [ ] args ) { int N = 3 ; int K = 6 ; Console . Write ( kthNonDivisible ( N , K ) ) ; } }