[Help] Finding co-ordinates in 3D space with a twist

Правка en1, от ClosetNarcissist, 2025-04-13 18:04:39

Given n 3D vectors e_i, 1 <= i <= n, and a 3D vector vector v, find the value of the coefficients c_i such that v is described as a linear combination of the n vectors

v = c_0*e_0 + c_1*e_1 + ... + c_n*e_n

but the twist is to calculate c_i such that abs(c_i) <= a_i, where a_i will be given, 1 <= i <= n.

Print the coefficients c_i or print that it's impossible. (If possible print the answer that minimizes the sum of c_i). I have been pondering this question for quite some days and I still have zero idea how to approach this, will it be DP or greedy with some heuristics. I did not add any constraints since I don't really know what the time complexity will be. Any help will be appreciated. Thank you.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ClosetNarcissist 2025-04-13 18:04:39 829 Initial revision (published)