qnli question: Who was the king of Prussia from 1740 to 1786? sentence: Voltaire, who had been imprisoned and maltreated by the French government, was eager to accept Frederick's invitation to live at his palace.