Find all sets of positive integers $A=\big\{ a_1,a_2,...a_{19}\big\}$ which satisfy the following: $1\big) a_1+a_2+...+a_{19}=2017;$ $2\big) S(a_1)=S(a_2)=...=S(a_{19})$ where $S\big(n\big)$ denotes digit sum of number $n$.
Source: EGMO 2018 Moldova TST
Tags: number theory
Find all sets of positive integers $A=\big\{ a_1,a_2,...a_{19}\big\}$ which satisfy the following: $1\big) a_1+a_2+...+a_{19}=2017;$ $2\big) S(a_1)=S(a_2)=...=S(a_{19})$ where $S\big(n\big)$ denotes digit sum of number $n$.