An adverb is a word or set of words that modify verbs, adjectives, or other adverbs.
They answer questions such as how, when, where, why, how often, how much etc.In the given sentence, the verb is 'said'. The sentence talks about a universal truth that 'if we do not take pains, we gain nothing'.
Therefore, we can use the adverb 'rightly' which explains the truth in the sentence.
Option A) cleverly is the adverb form of 'clever' and is used when there is a defined subject such as a person mentioned in the sentence. Therefore, option A) is incorrect.
Option B) hardly is incorrect in the given context of the sentence.
Option C) heavily is also incorrect in the given context of the statement.
Therefore, the correct adverb to be used in the given sentence is option D) rightly.