Which of Shakespeare’s plays is believed to have been written between 1599 and 1601 and inspired by a personal tragedy

Macbeth
Othello
Hamlet
Romeo and Juliet

Hamlet