Let S represent Sunaina's age.
Let T represent Tanish's age.
So 2S - T/2 = 40, 4S - T = 80.
Either S - T = 2 or T - S = 2. Let's try both cases.
Either 3S = 78 or 3S = 82.
Since 82 is not a multiple of 3, S = 26.
So Sunaina is 26 years old and Tanish is 24 years old.