For example, I have 3 accounts with balances:
1 account - 5 ether
2 account - 15 ether
3 account - 7 ether
I want to send 20 ether, so it will be used 1 and 2 account. I understand, how to make through just simple transactions, but for this will need to pay fee for every transaction. And for every transaction, before send, I need to unlock account. Contract can't unlock account, so I don't understand how will ether withdraw from this accounts and how it could have a permission to do this. Please help.