There are N egg baskets and the number of eggs in each
basket is a known quantity. Two players take turns to remove
these eggs from the baskets. On each turn, a player must
remove at least one egg, and may remove any number of eggs
provided they all belong to the same basket. The player
picking the last egg(s) wins the game. If you are allowed to
decide who is going to start first, what mathematical
function would you use to decide so that you end up on the
winning side?

Answer Posted / guest

n-1 if n is odd and n+1 if n is even

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to capitalise first letter of each word in a given string?

1421


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

632


What is linear search?

668


Which of these functions is safer to use : fgets(), gets()? Why?

625


hi any body pls give me company name interview conduct "c" language only

1651






What is a built-in function in C?

778


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

905


How many types of sorting are there in c?

596


Explain what does the function toupper() do?

625


What is c++ used for today?

649


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

1107


What is maximum size of array in c?

570


What is c preprocessor mean?

773


Explain the meaning of keyword 'extern' in a function declaration.

707


How do you redirect a standard stream?

613