Let A be the number of calories that contains candy bar A and let B be the number of calories that contains candy bar B. Then, given the information on the problem, we have the following system of equations:
![\begin{gathered} A+2B=780 \\ 2A+B=783 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/90upie2mjdq8dmzv2hd2kpn0jrsckv81x9.png)
solving the first equation for A, we get:
![A=780-2B](https://img.qammunity.org/2023/formulas/mathematics/college/a2b55aa4ss1vy83yqkxljewcwsxhe6d3su.png)
substituing this expression on the second equation, we get the following:
![\begin{gathered} 2(780-2B)+B=783 \\ \Rightarrow1560-4B+B=783 \\ \Rightarrow-3B=7833-1560=-777 \\ \Rightarrow B=(-777)/(-3)=259 \\ B=259 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/t8f6gvfignzqsw3otzbnzfmlnb4ickb10z.png)
now that we have that B = 259, we can find the value of A using the first equation:
![\begin{gathered} A=780-2(259)=780-518=262 \\ \Rightarrow A=262 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/kru3bgrcq5i30dd41pv5krge6n9200a4jd.png)
therefore, candy bar A contains 262 calories and candy bar B contains 259 calories