Help me in solving TRICOIN problem

My issue

Please explain answer to this question

My code

# cook your dish here
n=int(input())
for i in range(n):
    

Learning course: Binary Search
Problem Link: Coins And Triangle Practice Problem in Binary Search - CodeChef

@divya78094
refer the following code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int n;
	    cin>>n;
	    int count = 0;
	    for(int i=1;i<=n;i++){
	        n-=i;
	        if(n>=0){
	            count++;
	        }
	    }
	    cout<<count<<endl;
	}
	return 0;
}