From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1N53mC-0007Sp-DK for garchives@archives.gentoo.org; Mon, 02 Nov 2009 20:45:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 43996E087F; Mon, 2 Nov 2009 20:45:19 +0000 (UTC) Received: from mail-ew0-f222.google.com (mail-ew0-f222.google.com [209.85.219.222]) by pigeon.gentoo.org (Postfix) with ESMTP id 079A8E087F for ; Mon, 2 Nov 2009 20:45:18 +0000 (UTC) Received: by ewy22 with SMTP id 22so916347ewy.14 for ; Mon, 02 Nov 2009 12:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=KE+Fa2zqUSod4ap9Oh2bsPpV+nu+W+TvwAILp3tquqc=; b=FOik+xinGyRUH07/lOdych5ag2JmwPY1+IPgNddjcoUqi27qMh26/HyQttRRnvXuQA tX4eYd6D5Zb1i0QPbpTgrrZbcAKb0Xx/0UtYrxuiq1ZXNDoYbO9DlhWSFWaKQSU32uf3 BWOA/qcVao6MAdswZm2+0lwG954IEE2O64ofk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=DBHRRUq7R97tkOUKE5Pu+gLy8G1u33eRCq/Ac2qSs9gpnWSGJB0XsQdDKtBDDpJJtY v35uwUfl432o2bo65+Ivzzj73gG2drPT0HFyQGJm9yicui7pUfat0Xdow/H5ya682wYs uXIcb/eaxgnkTZNoCL7me5ARacT9mHQZQZ0XE= Received: by 10.216.90.195 with SMTP id e45mr5177452wef.189.1257194718409; Mon, 02 Nov 2009 12:45:18 -0800 (PST) Received: from ?192.168.0.46? (92.44.227.87.static.f.siw.siwnet.net [87.227.44.92]) by mx.google.com with ESMTPS id 7sm5629475eyb.0.2009.11.02.12.45.16 (version=SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 12:45:17 -0800 (PST) Message-ID: <4AEF45C2.20703@gmail.com> Date: Mon, 02 Nov 2009 21:49:06 +0100 From: Erik User-Agent: Thunderbird 2.0.0.23 (X11/20091031) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] program to solve assignment problem? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 8c68d655-b9a2-468d-affb-93ebf062aca1 X-Archives-Hash: 8aad06c438573812273e63e3bf197ae3 Is there some simple little program to solve assignment problems? Suppose that someone bought k meat (160), m fish (30) and n milk (15) for 700. So it should solve the equation k * 160 + m * 30 + n * 15 = 700. (A solution happens to be k = 4, m = 2, n = 0. An additional condition could be that he bought at most 6 items; k + m + n <= 6. That would eliminate solutions like k = 4, m = 0, n = 4.)