Find the player who will win by choosing a number in range [ 1 , K ] with sum total N | C # program for the above approach ; Function to predict the winner ; Driver Code ; Given Input ; Function call
using System ; public class GFG { static void predictTheWinner ( int K , int N ) { if ( N % ( K + 1 ) == 0 ) Console . WriteLine ( " Bob " ) ; else Console . WriteLine ( " Alice " ) ; } public static void Main ( string [ ] args ) { int K = 7 , N = 50 ; predictTheWinner ( K , N ) ; } }