Algorithm to pick elements in one array that sum to a setpoint, and corresponding elements in other array to average to a setpoint?

Note: The input file is an excel file. However, I am only looking for help with the algorithm as I can then code it in VBA.

I need to scan both columns (shown below) to find any number of column 1 values that when summed match the setpoint (E2) and column 2 values that when averaged match the setpoint (E3). One constraint is that the chosen values in column 1 and column 2 must be from the same row (or same ‘index’, shown in the image highlighted in blue and green).

Explanation of the solution below: What it should do is say ‘A2 and A6 sum to 7 (match cell E2), and the corresponding B2 and B6 average to 3’ (match cell E3). Therefore, these rows should be selected/highlighted in any appropriate way. (note that technically the first solution would be rows 2 and 3 as they fit the sum/average setpoints also).

Example that does not work as a solution: It can’t be A4 and A5 because although they add to 7, B4 and B5 average to 1.5, not the setpoint of 3.

Image of the problem (with a solution highlighted):

enter image description here

A solution for one of the cases (below) works only for the case where there are two rows that will sum/average to the setpoints. It will not work for cases where more than two rows are required. The solution should work for any number of rows required.

Example where three rows would be required (Solution is the first three rows): enter image description here

Reason for this solution: B6:B8 sums to the setpoint of 8 and C6:C8 average to the setpoint of 3
I am looking for help with an algorithm. If the solution is a large number of rows required (>100), how can I iterate through the combinations efficienctly to find a set of rows that both sums/averages to the setpoints?

It may not be possible to find a solution to both setpoints, in this case finding a solution within an error is also ok

Note: If there is a more suitable stack exchange please advise.

Finding an algorithm is NP-Hard, therefore I am also looking for appropriate simplifications to avoid this. An error term may be an example of one simplification.

How to pick up node context in a block to prepopulate entity references in node add link

Let’s say I’m building a genealogy site, where I’m displaying an Individual (node 15), that belongs to an Organic Group instantiated as “My Family Album” (node 8). I want to have a side panel block, specific to Individual content-type, with links to create new stories, events & media for the individual being displayed, in the album(s) it’s part of. To create a new story, I believe the URL path would be /node/add/story?field_album=8&field_individual=10. This is a similar scenario to this post.

Assuming that’s correct, how does the block pick up the context of the album (og_group_ref) and the Individual (nid) in order to embed them in the link path?

Can I ship a laptop to people in Canada and pick it up off them in Ireland?

I’m a Canadian citizen currently studying abroad in the United Kingdom. My laptop recently broke and I need to buy a new one. The specific model I want does not ship to the UK. It is however, easy to have it shipped to my parents in Canada. They’ll be traveling to Ireland in a few weeks where I’ll be meeting them for a short vacation. After that, I’ll be traveling back to the UK for a few months to complete my studies. I want to ship the laptop to my parents and pick it up off them when we meet in Ireland.

Would my parents be required to pay duties on the laptop upon arriving in Ireland? If so, roughly how much would they be required to pay? The laptop costs ~$ 2000 CAD.

What numbers I should not pick.

I have a problem on my hands and I am a little confused on how to solve it. Say you have 50 people and each chooses a number from 0 to 100. Now you take the average of all the numbers and denote it $ X$ , then calculate $ \frac{2}{3}(X+9)$ and the person who chose the number closest to it wins the game. The question is, which numbers should you never pick under no circumstances. The first thing to note is that $ 0\leq X \leq 100$ and so $ 6\leq \frac{2}{3}(X+9)\leq 72.6$ . Now I am not sure what to do at this point. It would seem like a bad move to put in anything outside of this bound (except possibly $ 73$ ). But I am not sure how to formalize this problem mathematically. I tried making it that you have the function $ f(x_1,x_2,x_2.,x_{50})=|2/3(X+9)-x_{50}|$ and try to minimize this or something. This eventually turns into $ |2/3Y-\frac{74}{75}x_{50}+6|$ where $ 0\leq Y=\frac{x_1+x_2…x_{49}}{50}\leq 98$ . I think what confuses me is that what number you pick influences $ X$ hence i tried to divide it up. Any help would be appreciated!

Do car hire companies in the USA generally allow you to pick up cars after hours?

I used a car hire company in New Zealand recently, which had a safe with a code where you could pick up your car key when you arrive after hours. I live in the UK, and don’t have much experience hiring cars.

Does such a thing exist in the USA? Particularly, is there one in Pittsburgh? Will be making a one-way trip to Columbus Ohio… getting the Greyhound if not!

[ Dogs ] Open Question : My girlfriend has a 8 month old puppy. I was at her apartment and was doing some studying. I had to go pick her up from school.?

We were probably gone for 45 minutes. We came back to see that the dog had chewed up a few of my notebooks and a book that i rented that is worth 140 dollars. it was all over her bed. she didnt warn me that the dog would chew up my stuff if i left it on the bed. i think it was the first time the dog chewed stuff on her bed. The dog chewed up her notebook two days later that we left on her bed. the dog usually only chews up stuff that is on the floor. The dog has already peed on her mac laptop(broke it),chewed on the walls, several cords, chewed up several shoes and panties, etc. Also she has had to get another comforter and sheets cuz the dog pisses on the bed more times than i can count. The dog even pissed on my mattress in a different city when they came and stayed with me. I dont even know how the dog peed on my bed. Her room is constantly nasty cuz the dog chews up everything. also she tries to train and discipline the dog but the dog never listens and clearly doesnt respect her. the dog does tricks because i taught the dog a few things while ive been around. also the dog listens to me because she knows that i wont deal with disobedience. My girlfriend wont help me pay for it which is hard for me cuz i am a broke college student as well but i ask her about the problem and she just ignores me. she says it is my fault. It might be a little my fault but i feel like it is mostly hers. Am i wrong?

Can a Warforged Envoy pick a land vehicle as his integrated tool?

I am aware that a Warforged Envoy picking anything but the tools in the PHB on page 154 is probably against RAI and would be an awkward implementation. But is it RAW?

The Warforged Envoy’s Integrated Tool (WGtE, p. 69) feature says:

Choose a tool you’re proficient with. It becomes integrated into your body, and you double your proficiency bonus for any ability checks you make with it. You must have your hands free to use this tool.

Backgrounds such as Sailor and Soldier include “vehicles (land)” and “vehicles (water)” as “Tool Proficiencies” (PHB, p. 139-40). Furthermore, Xanathar’s Guide to Everything includes “Land and Water Vehicles” under the section titled “Tool Proficiencies”. It is organized alphabetically between “Jeweler’s Tools” and “Leatherworker’s Tools” (XGtE, p. 82).

Then it seems that vehicles are tools that you can have a proficiency with, and therefore can have integrated in your warforged envoy.

Is my understanding correct?