#include
#include<math.h> #include #include
using namespace std;
long long i,k;
void solve(){
long long n,power; cin>>n; vectorv;
for(i=1;i<n;i++){
if(i<=n)
v.push_back(i);
if(i==n-1){v.push_back(i);}
I faced the same problem. The problem is with n=60 and occurs due to approximation by the system. You can check that pow(2,n) and pow(2,n)-2 will yield the same values. TRY PRINTING THEM OUT. It occurs maybe because pow(2,n)-2 is negligibly small from pow(2,n) and so they are virtually treated as the same.
/* Name of the class has to be βMainβ only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner s = new Scanner(System.in);
double tcash,rem,amt;
tcash=120.00;
amt=s.nextInt();
if(amt%5==0 && amt<=tcash){
rem=tcash-amt-0.50;
System.out.println(String.format(β%.2fβ,rem));
}
else{
System.out.println(String.format(β%.2fβ,tcash));
}
}
}