Rat Poison III

Fix a positive integer kk . You have rr very loyal rats that are willing to taste cups of wine for you! Exactly one of the nn cups has poison in it at random, which kills rats that drink it one hour after sipping. Otherwise, the rat drinks wine and feels a little tipsy, but it powers through and is fine. The rats are less busy now, so they can drink cups for up to pp hours. Find the maximum value of nn such that the poisonous cup can be identified with probability at least 1/k1/k when r=3,k=4,r = 3, k = 4, and p=3p = 3 . Assume the sipping process is instantaneous, and that rats can sip cups exactly at time pp hours, if needed.

Answer format: enter an integer.