Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'lines.': 0.07; 'plenty': 0.07; 'properly.': 0.07; 'width': 0.07; 'subject:question': 0.08; 'compute': 0.09; 'integers': 0.09; 'length)': 0.09; '\xe2\x80\x94': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'question.': 0.13; 'output': 0.15; '(starting': 0.16; '6.0': 0.16; '6000.': 0.16; 'abraham': 0.16; 'correctly,': 0.16; 'freely,': 0.16; 'student,': 0.16; 'wished': 0.16; 'x1,': 0.16; 'x2,': 0.16; 'y1,': 0.16; 'developer': 0.16; 'string': 0.17; 'beginner': 0.18; 'circular': 0.18; 'integer': 0.18; 'subject:need': 0.18; 'solution.': 0.18; 'input': 0.18; 'student': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'trying': 0.22; '(where': 0.23; 'header:In-Reply-To:1': 0.24; 'second': 0.24; 'question': 0.26; 'required.': 0.26; 'figure': 0.27; 'least': 0.27; 'message- id:@mail.gmail.com': 0.28; 'looks': 0.29; '"please': 0.29; '7.0': 0.29; 'asks': 0.29; 'dimensions': 0.29; 'testcase': 0.29; 'themselves': 0.29; 'correct': 0.29; 'class.': 0.31; 'print': 0.31; 'url:mailman': 0.31; 'code': 0.31; 'anybody': 0.32; 'url:python': 0.33; 'class': 0.33; 'problem': 0.33; 'case,': 0.34; 'equal': 0.34; 'file': 0.34; 'received:google.com': 0.34; 'gives': 0.35; 'url:listinfo': 0.35; 'could': 0.35; 'something': 0.35; 'problem.': 0.35; 'but': 0.36; 'being': 0.36; 'url:org': 0.36; 'there': 0.36; 'possible': 0.36; 'cases': 0.36; 'two': 0.37; 'should': 0.37; 'display': 0.37; 'subject:: ': 0.37; '(with': 0.38; 'space': 0.38; 'test': 0.39; 'enough': 0.39; 'area': 0.39; 'submit': 0.39; 'takes': 0.39; 'where': 0.40; 'your': 0.60; 'she': 0.61; 'real': 0.61; '10.': 0.61; 'times': 0.61; 'sample': 0.62; 'more': 0.62; 'reach': 0.62; 'minutes': 0.64; 'total': 0.64; 'stand': 0.64; 'circle': 0.66; 'number:': 0.67; 'finally': 0.70; 'hoping': 0.73; 'training': 0.78; '#1:': 0.84; '#2:': 0.84; '12.0': 0.84; 'circles': 0.84; 'mat': 0.84; 'quicker': 0.84; 'subject:this': 0.85; 'trainer': 0.91; 'students,': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=kHF1osEVpAwbJWP6miQwoYaFnOJqqLHiCovs1lOQrDk=; b=eOJU+zaWCg56OiiOgvrrC8kaiAdOyljkkWRsb2J34uyPcNtvxKV6ZXiVdTlFVXzRRH ICaAlPkiyzR+SwKEnkSj7UJd8vq3b6czaFF2iCyD+9rvX2J90r4ubSSFosVr3P8uaACV nPDD5w1fstVjI17tgKh1aGu7DfHlA/aC0CgmwdSkYpDLdcgBdUYZzU/4i0a62jk2qgs4 5si/qhyZUwpqOwmYcvoWZSBIaVW0HOQKFK6r4RMGOY8HEc2QtISk4TWwwdlgMG/rUFdv awHxzHoQr2ph6KHdpslQRI4giVekSdptcfVeOXr5tMJd55i/4hyeX5ZziiMM6f23ze+S nkBA== MIME-Version: 1.0 X-Received: by 10.194.238.193 with SMTP id vm1mr16108043wjc.57.1434025151651; Thu, 11 Jun 2015 05:19:11 -0700 (PDT) In-Reply-To: <135b6aa8-0761-4cda-b385-10b51d58465f@googlegroups.com> References: <135b6aa8-0761-4cda-b385-10b51d58465f@googlegroups.com> Date: Thu, 11 Jun 2015 14:19:11 +0200 Subject: Re: I just need this question explained. From: David Palao To: Adebayo Abraham Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 93 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434025152 news.xs4all.nl 2952 [2001:888:2000:d::a6]:52827 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92475 2015-06-11 14:03 GMT+02:00 Adebayo Abraham : > I am not requesting for a solution. I just need the question explained. I= am a beginner python developer and i do not know where to start from to so= lve this problem. So anybody, somebody: please explain this question. Am i = to create a testcase or create the code to display a value? > > Challenge: FitFam > > Problem > > The aerobics class begins. The trainer says, "Please position yourselves = on the training mat so that each one of you has enough space to move your a= rms around freely, and not hit anybody else." People start milling around o= n the mat, trying to position themselves properly. Minutes pass, and finall= y the trainer is so annoyed that he asks you to write a program that will p= osition all the people correctly, hoping it will be quicker than letting th= em figure it out for themselves! > > You are given the dimensions (width and length) of the mat on which the c= lass takes place. For every student, there is a circular area she has to ha= ve for herself, with radius equal to the reach of her arms. These circles c= an not intersect, though they can touch; and the center of each circle (whe= re the student stands) has to be on the mat. Note that the arms can reach o= utside the mat. You know that there's plenty of space on the mat =E2=80=94 = the area of the mat is at least five times larger than the total area of th= e circles required by all the people in the class. It will always be possib= le for all the people to position themselves as required. > > Input > > The first line of the input gives the number of test cases, T. T test cas= es follow. Each test case consists of two lines. The first line contains th= ree integers: N, W and L, denoting the number of students, the width of the= mat, and the length of the mat, respectively. The second line contains N i= ntegers ri, denoting the reach of the arms of the ith student. > > Output > > For each test case, output one line containing "Case #n: y", where n is t= he case number (starting from 1) and y is a string containing 2N numbers, e= ach of which can be an integer or a real number: x1, y1, x2, y2, etc., wher= e the pair (xi, yi) is the position where the ith student should stand (wit= h 0 =E2=89=A4 xi =E2=89=A4 W and 0 =E2=89=A4 yi =E2=89=A4 L). > > As there will likely be multiple ways to position the students on the mat= , you may output any correct positioning; but remember that you may not sub= mit an output file more than 200kB in size. > > Limits > > 1 =E2=89=A4 T =E2=89=A4 50. > 1 =E2=89=A4 W, L =E2=89=A4 109. > 1 =E2=89=A4 ri =E2=89=A4 105. > The area of the mat is at least 5 times larger than the total area of the= circles: > 5*=CF=80*(r12 + ... + rN2) =E2=89=A4 W*L. > Small dataset > > 1 =E2=89=A4 N =E2=89=A4 10. > Large dataset > > 1 =E2=89=A4 N =E2=89=A4 103. > The total number of circles in all test cases will be =E2=89=A4 6000. > Sample > > > Input > > Output > > 2 > 2 6 6 > 1 1 > 3 320 2 > 4 3 2 > Case #1: 0.0 0.0 6.0 6.0 > Case #2: 0.0 0.0 7.0 0.0 12.0 0.0 > > -- > https://mail.python.org/mailman/listinfo/python-list Hello again, It looks to me that you have to write the code that is able to read the input described and produce the wished output. You could organize the program like 1) read input 2) compute 3) print out result Perhaps each part being a function. Try something and tell us when you are blocked. Best