Minimum number of pigs required to find the poisonous bucket | C # program for the above approach ; Function to find the minimum number of pigs required to find the poisonous bucket ; Print the result ; Driver Code
using System ; class GFG { static void poorPigs ( int buckets , int minutesToDie , int minutesToTest ) { Console . WriteLine ( ( int ) Math . Ceiling ( Math . Log ( buckets ) / Math . Log ( ( minutesToTest / minutesToDie ) + 1 ) ) ) ; } static public void Main ( ) { int N = 1000 , M = 15 , P = 60 ; poorPigs ( N , M , P ) ; } }