C++ Math + Binary Search solution
\n\nclass Solution {\npublic:\n    int poorPigs(int buckets, int die, int test) {\n        int x = test / die + 1;\n        int l = 0, r = 1000;\n        while 
\n```\nclass Solution {\npublic:\n    int poorPigs(int buckets, int die, int test) {\n        int x = test / die + 1;\n        int l = 0, r = 1000;\n        while (l < r) {\n            int m = l + (r - l) / 2;\n            if (pow(x, m) < buckets) l = m + 1;\n            else r = m;\n        }\n        return l;\n    }\n};\n```
['Math', 'Binary Tree']