Finding 3 variables a,b,c. 31a+30b+28c=365 well, I have this question:
Find positive integers $a,b,c$ that solve
$$31a+30b+28c=365.$$

Well, it was easy to find them, since i noticed that it actually asks for the months in a year. As, how many months have 31 day each? Which is $a$, and how many have 30? Which is $b$, and $c$ is the ones with 28.
It turns to be that $a=7, b=4$, and $c=1$.

My question is that if there's any mathematical way to do it, rather than counting months.

Also, for ANY $a,b,c$ (positive integer) that the statement ($31a+30b+28c=365$) is correct, prove that
$$a+b+c=12$$ must be correct.

How can i do it? (Not just adding $7+4+1=12$; it must be generalized)

Thank you!
To show that in any solution the sum $a+b+c$ must equal $12$:

Write $31a+30b+28c=28(a+b+c)+3a+2b$.  

If $a+b+c&gt;12$, then $28(a+b+c)+3a+2b\ge28\cdot 13+3a+2b=364+3a+2b$.  So with positive integer values of $a,b,c$ the sum will exceed $365$ if $a+b+c$ exceeds $12$.

If $a+b+c&lt;12$, then $31a+30b+28c \le 31\cdot 11=341$.  Too small.
Since $31a+30b+28c=365$ and $a,b,c$ are positive integers then:

Roughly:

$a\leq \dfrac{365}{31}$ i.e $0 \leq a \leq 11$

$b\leq\dfrac{365}{30}$ i.e $0 \leq b \leq 12$

A program can easily find  the solutions:

$(5,7,0);(9,1,2);(7,4,1)$

Notice that all solutions are such that: $a+b+c=12$

NB:
Since $31a=365-2(15b+14c)$ and $31$ is odd then $a$ is odd.

PS:
A complete solution without computer:

since $0\leq a\leq 11$ is odd, $a$ belongs to $\{1,3,5,7,9,11\}$

The solutions of the equation $15x+14y=t$ ,with $t&gt;0,x,y$ integers, are $(t+14k,-t-15k)$,$k$ integer.

$t+14k$ and $-t-15k$ are positive integers if only if $k \in \Big[-\dfrac{t}{14};-\dfrac{t}{15}\Big]$

if $a=1$ then $(b,c)$ are solutions of $167=15x+14y$ but there is no integer in 
$\Big[-\dfrac{167}{14};-\dfrac{167}{15}\Big]$

if $a=3$ then $(b,c)$ are solutions of $136=15x+14y$ but there is no integer in 
$\Big[-\dfrac{136}{14};-\dfrac{136}{15}\Big]$

if $a=5$ then $(b,c)$ are solutions of $105=15x+14y$ but there is only one integer in $\Big[-\dfrac{105}{14};-\dfrac{105}{15}\Big]$, $-7$.

Therefore $(a,b,c)=(5,7,0)$

if $a=7$ then $(b,c)$ are solutions of $74=15x+14y$ but there is only one integer in $\Big[-\dfrac{74}{14};-\dfrac{74}{15}\Big]$, $-5$.

Therefore $(a,b,c)=(7,4,1)$

if $a=9$ then $(b,c)$ are solutions of $43=15x+14y$ but there is only one integer in $\Big[-\dfrac{43}{14};-\dfrac{43}{15}\Big]$, $-3$.

Therefore $(a,b,c)=(9,1,2)$

if $a=11$ then $(b,c)$ are solutions of $12=15x+14y$ but there is no integer in $\Big[-\dfrac{12}{14};-\dfrac{12}{15}\Big]$