My issue
My code
// Update the code below to solve this problem
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int X, Y;
cin>>X>>Y;
cout<<(Y/X)-1<<endl;
}
return 0;
}
Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone
@sasikiranjetti
Your logic is not right u have to take ceiling division of x and y and print their absolute difference.
This is my code i hope u will get it.
// Update the code below to solve this problem
include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int x, y;
cin>>x>>y;
x=ceil(x1.0/101.0);
y=ceil(y1.0/101.0);
cout<<abs(x-y)<<endl;
}
return 0;
}