চশমা
- আপনার
x,y,z
আকারের কিউবিক 3D স্থান রয়েছেS
পূর্ণসংখ্যার এককগুলির মতো0 <= x,y,z <= S
। - আপনি ডিফল্ট ইনপুট পদ্ধতিগুলি
P
হিসাবে উপস্থাপিত পয়েন্টগুলির একটি অ্যারে পাবেনx,y,z
, কোন যুক্তিসঙ্গত বিন্যাসে পূর্ণসংখ্যা স্থানাঙ্ক আপনি যতবার চাইবেন উদাহরণস্বরূপ:[x1,y1,z1],[x2,y2,z2],[x3,y3,z3] ... [xn,yn,zn]
। - সব
P
মানগুলি উপরে বর্ণিত ঘনক 3 ডি স্পেসে থাকবে0 <= x,y,z <= S
। - সম্ভাব্য মোট সংখ্যা
P
হবে ।1 <= P <= S3
- আপনি বেস পয়েন্ট এবং 3 ডি কিউব আকারের
x,y,z
পূর্ণসংখ্যা স্থানাঙ্ক হিসাবে ইনপুট হিসাবে পাবেনB
S
।
কার্য
আপনার লক্ষ্য আউটপুট হয়, আপনার পছন্দের ফরম্যাটে, পয়েন্ট P
রৈখিক অনুসারে সাজানো (ইউক্লিডিয়) থেকে দূরত্ব বেস বিন্দু B
।
বিধি
- যদি আপনি একাধিক পয়েন্ট খুঁজে
P
পান যাB
আপনার থেকে সামঞ্জস্যপূর্ণ হয় তবে অবশ্যইP
আপনার পছন্দসই ক্রমে সমস্ত সামঞ্জস্যপূর্ণ এর আউটপুট দিতে হবে । - এটি সম্ভব যে কোনও পয়েন্টের
P
সাথে মিলে যায়B
, যাতে তাদের দূরত্ব হয়0
, আপনাকে অবশ্যই সেই বিন্দুটিকে আউটপুট করতে হবে। - এটি একটি কোড-গল্ফ চ্যালেঞ্জ, তাই সংক্ষিপ্ততম কোডটি জয়ী।
- স্ট্যান্ডার্ড লুফোলগুলি নিষিদ্ধ।
- কোড ব্যাখ্যা প্রশংসা করা হয়।
পরীক্ষার মামলা
Input:
S (size), [B (base point x,y,z)], [P1 (x,y,z)], [P2], [P3], [P4], [P5], [...], [Pn]
10, [5,5,5], [0,0,0], [10,10,10], [2,0,8], [10,3,1], [4,4,5], [5,5,5], [5,5,4]
Output:
[5,5,5], [5,5,4], [4,4,5], [2,0,8], [10,3,1], [0,0,0], [10,10,10]
- - -
Input:
5, [2, 3, 3], [3, 0, 4], [5, 0, 3], [0, 2, 4], [0, 3, 5], [4, 2, 1], [2, 2, 2], [3, 1, 2], [3, 1, 0], [1, 3, 2], [2, 3, 1], [3, 1, 5], [4, 0, 0], [4, 3, 1], [0, 5, 5], [1, 5, 1], [3, 1, 4], [2, 2, 2], [0, 2, 5], [3, 3, 5], [3, 3, 0], [5, 4, 5], [4, 1, 3], [5, 1, 1], [3, 5, 3], [1, 5, 3], [0, 5, 2], [4, 3, 3], [2, 1, 1], [3, 3, 0], [5, 0, 4], [1, 5, 2], [4, 2, 3], [4, 2, 1], [2, 5, 5], [3, 4, 0], [3, 0, 2], [2, 3, 2], [3, 5, 1], [5, 1, 0], [2, 4, 3], [1, 0, 5], [0, 2, 5], [3, 4, 4], [2, 4, 0], [0, 1, 5], [0, 5, 4], [1, 5, 1], [2, 1, 0], [1, 3, 4], [2, 2, 2], [4, 2, 4], [5, 5, 4], [4, 4, 0], [0, 4, 1], [2, 0, 3], [3, 1, 5], [4, 4, 0], [2, 5, 1], [1, 2, 4], [4, 3, 1], [0, 2, 4], [4, 5, 2], [2, 0, 1], [0, 0, 2], [4, 1, 0], [5, 4, 3], [2, 5, 2], [5, 4, 4], [4, 4, 3], [5, 5, 1], [4, 0, 2], [1, 3, 5], [4, 2, 0], [0, 3, 1], [2, 2, 0], [0, 4, 5], [3, 2, 0], [0, 2, 1], [1, 2, 2], [2, 5, 3], [5, 5, 2], [5, 2, 4], [4, 5, 5], [2, 1, 2], [5, 4, 3], [4, 5, 4], [2, 3, 1], [4, 4, 4], [3, 0, 0], [2, 4, 5], [4, 3, 3], [3, 5, 3], [4, 0, 0], [1, 1, 1], [3, 1, 3], [2, 5, 5], [0, 0, 5], [2, 0, 2], [1, 0, 3], [3, 1, 4], [1, 2, 5], [4, 1, 3], [1, 4, 5], [3, 1, 4], [3, 5, 1], [5, 1, 4], [1, 0, 4], [2, 2, 0], [5, 2, 1], [0, 5, 3], [2, 1, 1], [0, 3, 0], [4, 5, 5], [3, 4, 2], [5, 3, 3], [3, 1, 1], [4, 0, 1], [5, 0, 5], [5, 0, 4], [1, 4, 3], [5, 4, 2], [5, 4, 0], [5, 1, 0], [0, 0, 1], [5, 3, 0]
Output:
[2, 4, 3], [2, 3, 2], [1, 3, 4], [1, 3, 2], [2, 2, 2], [1, 4, 3], [2, 2, 2], [2, 2, 2], [1, 2, 2], [3, 4, 2], [1, 2, 4], [3, 4, 4], [2, 5, 3], [4, 3, 3], [2, 3, 1], [4, 3, 3], [2, 3, 1], [1, 3, 5], [4, 4, 3], [2, 5, 2], [3, 1, 3], [1, 5, 3], [4, 2, 3], [2, 1, 2], [3, 5, 3], [2, 4, 5], [3, 3, 5], [3, 5, 3], [3, 1, 4], [0, 2, 4], [0, 2, 4], [1, 2, 5], [3, 1, 2], [3, 1, 4], [3, 1, 4], [4, 2, 4], [1, 4, 5], [4, 4, 4], [1, 5, 2], [4, 3, 1], [0, 5, 3], [2, 1, 1], [4, 1, 3], [4, 3, 1], [2, 5, 5], [0, 3, 5], [4, 1, 3], [2, 5, 1], [2, 1, 1], [0, 3, 1], [2, 5, 5], [1, 1, 1], [0, 4, 5], [4, 5, 4], [4, 5, 2], [0, 2, 1], [1, 5, 1], [5, 3, 3], [0, 5, 2], [3, 5, 1], [3, 5, 1], [0, 2, 5], [1, 5, 1], [4, 2, 1], [3, 1, 5], [3, 1, 1], [0, 2, 5], [4, 2, 1], [0, 5, 4], [0, 4, 1], [2, 0, 3], [3, 1, 5], [2, 4, 0], [2, 2, 0], [2, 0, 2], [3, 3, 0], [3, 3, 0], [5, 4, 3], [1, 0, 3], [5, 4, 3], [2, 2, 0], [3, 0, 2], [5, 4, 4], [5, 4, 2], [1, 0, 4], [3, 0, 4], [5, 2, 4], [3, 2, 0], [3, 4, 0], [0, 1, 5], [0, 5, 5], [4, 5, 5], [4, 5, 5], [0, 3, 0], [2, 0, 1], [2, 1, 0], [4, 4, 0], [5, 1, 4], [5, 5, 4], [5, 2, 1], [3, 1, 0], [5, 4, 5], [4, 4, 0], [1, 0, 5], [4, 2, 0], [0, 0, 2], [4, 0, 2], [5, 5, 2], [4, 1, 0], [5, 5, 1], [0, 0, 1], [5, 1, 1], [4, 0, 1], [0, 0, 5], [5, 0, 3], [5, 3, 0], [5, 4, 0], [3, 0, 0], [5, 0, 4], [5, 0, 4], [5, 1, 0], [4, 0, 0], [4, 0, 0], [5, 0, 5], [5, 1, 0]
- - -
Input:
10, [1, 9, 4], [4, 6, 2], [7, 5, 3], [10, 5, 2], [9, 8, 9], [10, 5, 10], [1, 5, 4], [8, 1, 1], [8, 6, 9], [10, 4, 1], [3, 4, 10], [4, 7, 0], [7, 10, 9], [5, 7, 3], [6, 7, 9], [5, 1, 4], [4, 3, 8], [4, 4, 9], [6, 9, 3], [8, 2, 6], [3, 5, 1], [0, 9, 0], [8, 4, 3], [0, 1, 1], [6, 7, 6], [4, 6, 10], [3, 9, 10], [8, 3, 1], [10, 1, 1], [9, 10, 6], [2, 3, 9], [10, 5, 0], [3, 2, 1], [10, 2, 7], [8, 4, 9], [5, 2, 4], [0, 8, 9], [10, 1, 6], [0, 8, 10], [5, 10, 1], [7, 4, 5], [4, 5, 2], [0, 2, 0], [8, 3, 3], [6, 6, 6], [3, 0, 2], [0, 1, 1], [10, 10, 8], [6, 2, 8], [8, 8, 6], [5, 4, 7], [10, 7, 4], [0, 9, 2], [1, 6, 6], [8, 5, 9], [3, 7, 4], [5, 6, 6], [3, 1, 1], [10, 4, 5], [1, 5, 7], [8, 6, 6], [4, 3, 7], [2, 1, 0], [6, 4, 2], [0, 7, 8], [8, 3, 6], [9, 2, 0], [1, 3, 8], [4, 4, 6], [5, 8, 9], [9, 4, 4], [0, 7, 3], [8, 3, 4], [6, 7, 9], [8, 7, 0], [0, 7, 7], [8, 10, 10], [10, 2, 5], [6, 9, 5], [6, 2, 7], [0, 9, 6], [1, 4, 1], [4, 3, 1], [5, 7, 3], [9, 6, 8], [4, 1, 7], [4, 0, 8], [3, 4, 7], [2, 3, 6], [0, 0, 7], [5, 3, 6], [7, 3, 4], [6, 7, 8], [3, 7, 9], [1, 9, 10], [2, 1, 2], [2, 8, 2], [0, 3, 0], [1, 1, 9], [3, 5, 2], [10, 5, 3], [5, 2, 9], [6, 9, 0], [9, 5, 0], [7, 1, 10], [3, 3, 8], [2, 5, 1], [3, 10, 10], [6, 2, 2], [10, 7, 2], [4, 3, 1], [4, 2, 1], [4, 2, 8], [6, 8, 5], [3, 10, 0], [1, 1, 7], [6, 9, 6], [6, 2, 4], [5, 5, 7], [5, 4, 5], [9, 8, 1], [9, 8, 1], [0, 10, 6], [1, 1, 9], [3, 8, 8], [3, 1, 5], [5, 7, 4], [4, 3, 6], [5, 4, 7], [6, 0, 8], [7, 8, 1], [9, 8, 4], [2, 10, 0], [3, 4, 5], [9, 3, 10], [7, 4, 1], [2, 1, 9], [10, 8, 1], [10, 3, 7], [2, 0, 6], [3, 8, 4], [10, 0, 2], [9, 9, 10], [8, 9, 5], [4, 10, 2], [8, 3, 4], [4, 2, 10], [9, 1, 6], [6, 1, 3], [4, 1, 3], [2, 9, 0], [5, 6, 5], [8, 8, 3], [5, 5, 0], [7, 6, 9], [1, 1, 5], [3, 0, 4], [1, 10, 6], [8, 0, 2], [0, 7, 3], [8, 9, 8], [2, 1, 8], [3, 1, 10], [4, 5, 9], [7, 6, 10], [3, 6, 10], [5, 9, 8], [9, 3, 3], [2, 2, 3], [9, 9, 0], [7, 2, 2], [0, 0, 9], [8, 7, 4], [9, 2, 9], [0, 6, 4], [9, 4, 3], [10, 1, 3], [5, 9, 10], [5, 10, 6], [6, 3, 10],
Output:
[1, 10, 6], [3, 8, 4], [0, 9, 6], [0, 9, 2], [2, 8, 2], [0, 7, 3], [0, 7, 3], [0, 10, 6], [3, 7, 4], [0, 6, 4], [1, 6, 6], [0, 7, 7], [4, 10, 2], [1, 5, 4], [0, 9, 0], [2, 9, 0], [2, 10, 0], [5, 7, 4], [5, 7, 3], [5, 10, 6], [5, 7, 3], [0, 7, 8], [3, 10, 0], [3, 8, 8], [4, 6, 2], [3, 5, 2], [1, 5, 7], [5, 10, 1], [6, 9, 3], [6, 9, 5], [5, 6, 5], [2, 5, 1], [0, 8, 9], [6, 8, 5], [5, 6, 6], [6, 9, 6], [4, 5, 2], [4, 7, 0], [3, 5, 1], [3, 4, 5], [5, 9, 8], [6, 7, 6], [3, 7, 9], [1, 4, 1], [1, 9, 10], [4, 4, 6], [0, 8, 10], [6, 6, 6], [3, 4, 7], [3, 9, 10], [5, 5, 7], [3, 10, 10], [2, 3, 6], [6, 9, 0], [5, 8, 9], [5, 4, 5], [6, 7, 8], [7, 8, 1], [5, 5, 0], [4, 3, 6], [3, 6, 10], [8, 9, 5], [5, 4, 7], [4, 5, 9], [5, 4, 7], [2, 2, 3], [8, 8, 3], [1, 3, 8], [5, 9, 10], [0, 3, 0], [7, 5, 3], [8, 7, 4], [4, 3, 1], [8, 8, 6], [6, 4, 2], [4, 3, 7], [6, 7, 9], [4, 6, 10], [4, 3, 1], [6, 7, 9], [3, 3, 8], [5, 3, 6], [4, 4, 9], [4, 3, 8], [8, 6, 6], [3, 2, 1], [7, 4, 5], [7, 10, 9], [2, 3, 9], [5, 2, 4], [1, 1, 5], [3, 4, 10], [8, 9, 8], [9, 8, 4], [0, 2, 0], [4, 2, 1], [3, 1, 5], [2, 1, 2], [8, 7, 0], [9, 10, 6], [7, 4, 1], [7, 6, 9], [7, 3, 4], [1, 1, 7], [0, 1, 1], [4, 2, 8], [9, 8, 1], [0, 1, 1], [4, 1, 3], [6, 2, 4], [9, 8, 1], [8, 4, 3], [3, 1, 1], [6, 2, 2], [5, 1, 4], [9, 9, 0], [7, 6, 10], [2, 1, 0], [2, 1, 8], [4, 1, 7], [8, 6, 9], [6, 2, 7], [8, 3, 4], [8, 3, 4], [10, 7, 4], [3, 0, 4], [8, 3, 3], [8, 10, 10], [2, 0, 6], [9, 6, 8], [10, 7, 2], [1, 1, 9], [8, 3, 6], [1, 1, 9], [7, 2, 2], [3, 0, 2], [9, 4, 4], [8, 5, 9], [2, 1, 9], [6, 1, 3], [6, 2, 8], [5, 2, 9], [9, 4, 3], [9, 8, 9], [0, 0, 7], [10, 8, 1], [4, 2, 10], [8, 3, 1], [9, 5, 0], [6, 3, 10], [10, 10, 8], [10, 5, 3], [8, 4, 9], [9, 9, 10], [10, 5, 2], [9, 3, 3], [8, 2, 6], [3, 1, 10], [4, 0, 8], [0, 0, 9], [10, 4, 5], [10, 5, 0], [10, 4, 1], [8, 1, 1], [6, 0, 8], [10, 3, 7], [9, 2, 0], [10, 2, 5], [9, 1, 6], [10, 5, 10], [8, 0, 2], [9, 3, 10], [7, 1, 10], [9, 2, 9], [10, 2, 7], [10, 1, 3], [10, 1, 6], [10, 1, 1], [10, 0, 2]
- - -
Input:
10000, [8452, 3160, 6109], [7172, 5052, 4795], [9789, 4033, 2952], [8242, 213, 3835], [177, 7083, 908], [3788, 3129, 3018], [9060, 464, 2701], [6537, 8698, 291], [9048, 3860, 6099], [4600, 2696, 4854], [2319, 3278, 9825]
Output:
[9048, 3860, 6099], [7172, 5052, 4795], [9789, 4033, 2952], [8242, 213, 3835], [4600, 2696, 4854], [9060, 464, 2701], [3788, 3129, 3018], [2319, 3278, 9825], [6537, 8698, 291], [177, 7083, 908]
S
প্যারামিটার হিসাবে গ্রহণ করা কি সত্যই প্রয়োজন ?