Duration based on links

Hello! Dmitry is right, using dependencies is not possible…

… but a summary task fulfills your requirement as shown in attachment.
find attached screenshot.