The film begins with a Broadway-style number "So Long, and Thanks for All the Fish", sung by the dolphins of the world, who are aware of the Earth's impending doom. At the end, they all jump out of the oceans and into space, leaving Earth for good.One Thursday morning, Arthur Dent discovers that his house is to be immediately demolished to make way for a bypass. He tries delaying the bulldozers by lying down in front of them. Ford Prefect, a friend of Arthur's, convinces him to go to a pub with him. Over a pint of beer (as "muscle relaxant"), Ford explains that he is an alien from a planet in the vicinity of Betelgeuse, and a journalist working on the Hitchhiker's Guide to the Galaxy, a universal guide book, and that the Earth is to be demolished later that day by a race called Vogons, to make way for a hyperspace bypass. Suddenly, a Vogon Constructor Fleet appears in the sky and destroys the planet. Ford saves himself and Arthur by stowing away on a Vogon ship. When discovered, they are thrown out of an airlock, but are picked up by the starship Heart of Gold. They find Ford's "semi-cousin" Zaphod Beeblebrox, the President of the Galaxy. He has stolen the ship along with Tricia "Trillian" McMillan, an Earth woman whom Arthur had met previously, and Marvin the Paranoid Android, a clinically depressed robot that constantly complains about life.Zaphod explains that he is seeking the planet Magrathea, where he believes he can discover the Question of Life, the Universe, and Everything to match with the answer "42" given by the supercomputer Deep Thought. Zaphod stole the Heart of Gold to use its improbability drive to get to Magrathea through trial and error.During one of these attempts, they end up on the planet Viltvodle VI. Zaphod decides to visit Humma Kavula, his opponent from the election. Upon learning of Zaphod's plan, Kavula announces that he has the coordinates to Magrathea. He takes one of Zaphod's two heads hostage and demands they bring him the Point-of-view gun created by Deep Thought, which allows the target to understand the shooter's point of view. As they are leaving the planet, Trillian is captured by Vogons. The others travel to rescue her from the Vogon home world bureaucracy, facing long lines and frustrating form processing. Trillian learns of the Earth's destruction, and is outraged to learn that Zaphod signed the authorisation for the destruction of Earth thinking it was a request for an autograph.The Heart of Gold is chased by the Vogons, led by Galactic Vice-President Questular Rontok, who is attempting to rescue Zaphod from himself, after an incident in which Zaphod kidnapped himself in order to forgo presidential duties. The Heart of Gold arrives at Magrathea, narrowly avoiding the planet's automated missile defence systems.On the planet, Zaphod, Ford, and Trillian take a portal to Deep Thought, but Arthur hesitates, and the portal closes before he and Marvin can use it. The trio encounter the computer and ask it whether it has calculated the ultimate question, it reveals that it designed another supercomputer to do soâEarth. When the trio finds the Point-of-View gun, Trillian shoots Zaphod, making him understand how she feels about the destruction of Earth, as well as how much she loves Arthur. Meanwhile, a Magrathean called Slartibartfast, appears and takes Arthur on a tour of the factory construction floor where Earth Mark II is being built.Slartibartfast takes Arthur a recreation of his home on the new Earth, where the others are enjoying a feast provided the pan-dimensional beings who commissioned Arthur's original Earth, and who resemble a pair of mice. The mice, who constructed Deep Thought, used the supercomputer to build an even larger supercomputer, the planet Earth, to determine the Ultimate Question. Believing Arthur, the last remaining supercomputer component, may hold the Ultimate Question, the mice restrain Arthur in order remove his brain. Initially panicking, a resigned Arthur tells them to take it, admits that the only question that ever mattered to him was whether Trillian was "the one", the answer to which Arthur realises is "yes". But as the mice continue, Arthur breaks free of his restraints and squashes the mice under a teapot.Outside the house, the group is then confronted by Vogons, who open fire. As the group takes shelter, Marvin is left outside and, despite being shot in the back of the head, recovers and uses the Point-of-View gun on the Vogons, causing them to become depressed and unable to fight. As the Vogons are taken away and Questular rejoins with Zaphod, Arthur chooses to explore the galaxy with Trillian and lets Slartibartfast finalise the new Earth without him. The Heart of Gold crew decide to visit the Restaurant at the End of the Universe.
Output: Question: Who authorized Earth's destruction?, Answer: Zaphod