I hope, you have found the way to do it. Please don't forget, that the players who failed the contract, had a simpler way to do it just they failed because of the bad distribution. Let's see the things about this problem!
When you can play this contract, you are happy. Although the lead was the Queen of spades, you have 10 card fit in clubs, if opponents have 2-1, you take the trumps, you discard your loser diamond to the 3rd heart trick , you duck a spade and you win the contract.
Anyway, the clubs are 3-0, still you have good chance: after cashing the Ace of clubs, you try to discard your loser diamond to the 3rd heatr trick , you duck a spade and you win the contract, ruffing a spade in the dummy before cashing the trumps. Although East still has trumps, you have 2 more trumps in the dummy so you win the contract if East doesn't ruff the 3rd round od hearts. But this was an ugly hand, so East ruffed the 3rd round od hearts, so the contract failed.
It was a great slam, and some of the declarers could make it also live, if they take care of what West had discarded to their 1st round of clubs.
Many West players made the mistake of discarding their 5th heart because it was unnecessary. If we think it trough, it is a sign for the declarer, that West has 5 hearts, so East has only 2 and his plan is not working!
West should discard a spade to the 1st club trick, knowing, that declarer denied 4 card spades, bidding 2 clubs to the 1 heart response.
Even diamond discard costs nothing in this hand, although we all hate discarding the opponent's suits. 🙂
When declarer recognizes, that West has at least 5 hearts, there is a great way to do the contract.
He cashes all his trumps after the Ace of spades, so West will have only 5 cards after it: 4 hearts, and the Ace of diamonds.
(here is the staning before cashing the last trump)
We cash the last trump in hand. West must discard his last spade so he will not have any more spades in his hand.
Now we discard our 4th heart to the last club trick, holding AQx in hearts and KQ in diamonds, and we play a diamond to win the contract.