Question: I am trying to solve Sherlock and Square problem in Hackerrank [(link)](https://www.hackerrank.com/challenges/sherlock-and-squares/problem) for finding the perfect square within a range of data. 4 test cases passed but i am getting a timeout error for large numbers. Please suggest something to improve its performance

My code is as follows:

```
#include<iostream>
#include<cmath>

using namespace std;

int squares(int a, int b) {
    long double i;
    long long int count=0;
    for(i=a;i<=b;i++)
    {
        long double b = sqrt(i);
        if(fmod(b,1)==0.000000)
        {
            count++;
        }
    }
    return count;
}

int main()
{
    int q,i,a,b;
    cin>>q;
    for(i=0;i<q;i++)
    {
        cin>>a>>b;
        int result = squares(a, b);
        cout<<result<<"\n";
    }
}

```

Answer: 
Kindly use div into div as you have 2 divs. one is for background and other one for Heading
it will be like 

```
<div class="bg"> 
  <div id="heading">Some stuff</div> 
// All the staff for background will goes here 

 </div>

```

it will work in your case and if you use other divs after this they will not have the background image.
Please first search before ask question

[Use a DIV as a background for another element](https://stackoverflow.com/questions/25970787/use-a-div-as-a-background-for-another-element)

```css
#wrapper{
    position: relative;
    width: 200px;
    height: 200px;
}

.content{
    color: #FFFFFF;
    font-size: 26px;
    font-weight: bold;
    text-shadow: -1px -1px 1px #000, 1px 1px 1px #000;
    position: relative;
    z-index: 100;
}

.background{
    color: #999999;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -100;
}
```