subject

An astronomer is making measurements with his telescope when he notices that his vision field is off by x micronanometers (which we will assume is a measurement that exists) to the right. His telescope can only be moved to the right or to the left, however, and only via his automated, highly-calibrated machinery by certain predetermined fixed integer amounts. If, for example, one of these amounts is 7 micronanometers, then he can move his vision field by any multiple of 7 micronanometers to the left or right. Given a value of x and a set {m1, m2, . . . , mn} of predetermined fixed move- ment amounts, your job will be to advise the astronomer as to which of the movements to choose, how many times the movement should be applied, and the direction of the movement so that he can make his field of vision perfect.
You may assume that x is a standard Java integer, but you may want to use the java. BigInteger class for the mi.
It is guaranteed that a solution exists.
3 Input/Output
The input file (input. txt) in the home directory will consist only of positive integers. The first line will be the value of x. The following lines will hold the values of the mi, one per line.
Your output file (output. txt) should hold a sequence of lines with 2 single- space-separated numbers per line. These will be interpreted as instructions for telescope movement. The line mi ywill mean to move the telescope mi micronanometers y times. (If y is positive, then it will be moved to the right; if y is negative, then it will be moved to the left.)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 24.06.2019 08:30
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
question
Computers and Technology, 24.06.2019 15:30
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Anew author is in the process of negotiating a contract for a new romance novel. the publisher is offering three options. in the first option, the author is paid $5,000 upon delivery of the final manuscript and $20,000 when the novel is published. in the second option, the author is paid 12.5% of the net price of the novel for each copy of the novel sold. in the third option, the author is paid 10% of the net price for the first 4,000 copies sold, and 14% of the net price for the copies sold over 4,000. the author has some idea about the number of copies that will be sold and would like to have an estimate of the royal- ties generated under each option. write a program that prompts the author to enter the net price of each copy of the novel and the estimated number of copies that will be sold. the program then outputs he royalties under each option and the best option the author could choose. (use appropriate named constants to store the special values such as royalty rates and fixed royalties.
Answers: 1
You know the right answer?
An astronomer is making measurements with his telescope when he notices that his vision field is off...
Questions
question
History, 28.04.2021 17:40
question
Social Studies, 28.04.2021 17:40
question
Mathematics, 28.04.2021 17:40
question
Mathematics, 28.04.2021 17:40
question
Mathematics, 28.04.2021 17:40
Questions on the website: 13722363