int ans;
void dfs (BinaryTreeNode<int> *node, int x){
if(!node)return;
if(node->data == x){
ans=node->data;
return;
}
if (node->data >= x) {
dfs(node->left, x);
}
else{
ans=node->data;
dfs(node->right, x);
}
}
int Floor(BinaryTreeNode<int> *node, int input)
{
/*Write your code here.
*Don't write main().
*Don't take input, it is passed as function argument.
*Don't print output.
*Taking input and printing output is handled automatically.
*/
ans=-1;
dfs(node,input);
return ans;
}