You may use Problem 3.4-3c/1019 in CLR book as a hint.