Who was the king of Prussia from 1740 to 1786