Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NOTE: Code using c# The solution already available on chegg for this program is not right and does not work...so please do it again....and make

image text in transcribedimage text in transcribed

NOTE: Code using c#

The solution already available on chegg for this program is not right and does not work...so please do it again....and make sure it works for other inputs as well and not only the sample input...THANK YOU!

Problem S5: Lazy Fox Problem Description You have a pet Fox who loves treats. You have N neighbours at distinct locations described as points on the Cartesian plane) which hand out treats to your pet Fox, and each neighbour has an unlimited number of treats to give out. The origin (which is where the Fox starts) will not be one of these N locations. What does the Fox say, in order to get these treats? That is a good question, but not our concern. The Fox moves from location to location to gather exactly one treat from each location on each visit. He can revisit any previous location, but cannot visit the same location on two consecutive visits. Your Fox is very lazy. The distance your Fox is willing to travel after each treat will strictly decrease. Specifically, the distance from the origin to his first treat location must be larger than the distance from his first treat location to his second treat location, which in turn is larger than the distance between his second treat location and his third treat location, and so on. What is the largest number of treats your Fox gathers? Input Specification The first line contains the integer N (1 SN S 2000). The next N lines each contain X, followed by a space, followed by Y., for i = 1..N (-10000 S X, Y, S 10 000) representing the coordinates of the ith location. The following additional constraints will apply. At least 20% of the marks will be for test cases where N

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions