Sharp Martingale and Semimartingale Inequalities