#include<stdio.h> int sum; void f(int *a, int w, int n) { int i = 0, j = 1, temp = 0, t, temp1, s; for (i = 0; i < n; i++) { s = 0, temp1 = 0; for (j = i + 1; j < n; j++) { if (a[i] + a[j] <= w && a[j] > temp1) { t = j; temp1 = a[t]; s = 1; } } if(s == 1) { temp = a[n - 1];...