The Qur'an says that the actions of the infidels are futile:

> 
> You hypocrites are like those unbelievers before you. They were much
> stronger than you and were richer and had more children. They enjoyed
> their share in this life. You enjoyed your share, just like them. And
> you are engaged in idle talk, just like them. Their deeds have become
> invalid in this world and in the Hereafter. And they are the "real"
> losers. 9:69
> 
> 
> 

> 
> Polytheists should not maintain the mosques of Allah while they openly
> profess disbelief. Their deeds are futile, and they will be on fire
> forever. 9:17
> 
> 
> 

But it is also said that Allah does not lose the good deeds of people:

> 
> Indeed, Allah never offends anyone — not even by the weight of an
> atom. And if it is a good deed, He will multiply it many times and
> give a great reward according to His grace. 4:40
> 
> 
> 

> 
> So whoever does good by the weight of a speck of dust will see it.
> 99:7
> 
> 
> 

That is, if the actions of the unbelievers are invalid (according to 9:17, 9:69), then how will they double the reward on the Day of Judgment in accordance with 4:40 and 99:7. Just in 99:7, the word "people" is used, that is, people are understood as both infidels and believers. So if the deeds of unbelievers are annulled, then why is it said that each person will not only be credited, but also double the reward for these deeds. So I wanted to ask:
**How do these groups of verses relate?**