CPP code to find the bucket to choose for picking flowers out of it
#include <bits/stdc++.h> NEW_LINE using namespace std ; int findBucketNo ( int p ) { return ceil ( ( sqrt ( 8 * p + 1 ) - 1 ) / 2 ) ; }