The closest integer to the average will be the answer.
2014-05-10 17:44 GMT+08:00 lalit <[email protected]>: > What if we have to find a common integer that minimizes the sum of the > squared distance to a list of integers?So what should be the answer when > average is not an integer? > > On Saturday, May 10, 2014 2:53:37 PM UTC+5:30, Luke Pebody wrote: > > Interestingly, the average minimizes the sum of the squared distance to > a list of integers. > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/e7941508-6bc3-4a24-8514-022832e51621%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CAGDEU-%2B8s8DkoFyC13PErzMajZjUX-Z-4F0OH%3DSM7TQn%2BMz3hQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
