A multiagent algorithm is a knowledge-based distributed algorithm that solves some problem via cooperative work of agents. A BDI agent is an agent with beliefs, desires, and intentions. From the point of view of an individual agent, a multiagent algorithm is an algorithm based on this agent's knowledge and beliefs, aimed at achieving this agent's desires by sequentially acting on its intentions. We consider agents to be reactive, proactive, and rational. This paper proposes and studies two knowledge-based multiagent algorithms. In particular, one of the proposed algorithms solves the following resource renting problem: there is a system of agents that arrive at a resource center one by one, in random order, with the goal to rent some available resource. The available resources are passive and form a cloud. If there is no competition for an available resource, it is lend on demand and is returned to the cloud after use. The agents also form a cloud, but leave the resource center immediately after renting the desired resource. The goal is to design a knowledge-based multiagent algorithm with the following correctness property: each agent that arrives at the resource center eventually rents some desired resource at a moment when there is no competition for that resource.