IMO 1995 Shortlist problem C5 
IMO 1995 Shortlist problem C5
At a meeting of $12k$ people, each person exchanged greetings with exactly $3k+6$ people. For any two people, the number who exchange greetings  with both is always the same. How many people are there at the party?

A solution can be found here.
But I am interested in knowing what's wrong with the following argument.
Firstly, we define the codegree of two vertices of a graph. The codegree of two vertices is defined to be the number of vertices that are adjacent to both of them.
Set up a graph with the vertices as people and join two vertices if they exchanged greetings. Given that the codegree of any two vertices is constant, we can call this codegree $c$.
Denote the codegree of vertices $x$ and $y$ by $C(x,y)$.
Then, summing up all codegrees(and ignoring the order of $x$ and $y$),
$\sum C(x,y) = \dbinom{12k}{2}c$
since for every pair of vertices, the codegree is $c$. We can also count it in a different way. For any vertex, there are $\dbinom{3k+6}{2}$ pairs of vertices that are both adjacent to that vertex. Stated another way, there are $\dbinom{3k+6}{2}$ pairs of vertices that both know that vertex(call it $v$). Hence, $v$ is counted exactly once in the codegree of each pair. Summing up for $3k+6$ vertices,
$\sum C(x,y)=\dbinom{3k+6}{2}(3k+6)$
So, $\sum C(x,y)=\dbinom{3k+6}{2}(3k+6)=\dbinom{12k}{2}c$
But it appears that  this is wrong, since $k=3$ (which is true since I know the final answer) doesn't satisfy the above solution (returns non integer values of $c$).
So, what am I doing wrong?
 A: The problem is in the part
$\sum C(x,y)=\dbinom{3k+6}{2}(3k+6)$
It should be 
$\sum C(x,y)=\dbinom{3k+6}{2}(12k)$
Having this you would instead get:
$\dbinom{12k}{2}c=\dbinom{3k+6}{2}12k$
So $12k(12k-1)=(3k+6)(3k+5)12k\implies (12k-1)c=(3k+6)(3k+5)\implies c=\frac{(3k+6)(3k+5)}{12k-1}$ of course the greatest common factor of $12k-1$ with $3k+6$ is $5$ or $25$ since the difference between $4(3k+6)$ and $12k-1$ is $25$, the greatest common factor of $12k-1$ and $3k+5$ is a divisor of $21$, so $1$ or $7$ since $12k-1$ is not a multiple of $3$.
Hence $12k-1$ can be $1,5,25,7,35$ or $175$. The only one that is actually of the form $12k-1$ is $35=12(3)-1$. So we try with $k=3$, it passes the divisibility, giving us $c=\frac{15\cdot14}{35}=6$. So the only possiblity is $k=3$ and we must have $36$ people.
I make a lot dumb mistakes when counting two ways. I make drawings to make sure sometimes I don't do them, although this does not always work. Hope this helps. Very nice ideas by the way.
A: A Solution using Linear Algebra:
Let $1,2,\ldots,12k$ be the $12k$ persons who attended this party.  Let $[n]:=\{1,2,\ldots,n\}$ for every $n\in\mathbb{N}$.  For $i,j\in[12k]$, define $a_{i,j}$ to be $1$ if $i$ and $j$ exchanged greetings, and $0$ otherwise.  Denote by $\mathbf{A}$ the $12k$-by-$12k$ matrix $\left[a_{i,j}\right]_{i,j\in[12k]}$ (also known as the adjacency matrix).
Observe that $\mathbf{A}=\mathbf{A}^\top$, so the $(i,j)$-entry of $\mathbf{A}^2=\mathbf{A}\,\mathbf{A}^\top$ is the number of people who exchanged greetings with both $i$ and $j$ for $i,j\in[12k]$.  Let $d$ be the number of people who exchanged greetings with both $i$ and $j$, where $i,j\in[12k]$ are such that $i\neq j$.  (Note that $d$ does not depend on the choice of $(i,j)$.)  Each entry along the main diagonal of $\mathbf{A}^2$ is $3k+6$.  That is, $\mathbf{A}^2=(3k+6-d)\,\mathbf{I}+d\,\mathbf{J}$, where $\mathbf{I}$ is the $12k$-by-$12k$ identity matrix, and $\mathbf{J}$ is the $12k$-by-$12k$ matrix all of whose entries are $1$.
Let $\mathbf{1}$ be the $12k$-by-$1$ matrix whose entries are $1$.  Clearly, $\mathbf{A}\,\mathbf{1}=(3k+6)\,\mathbf{1}$.  Thus, $$(3k+6)^2\,\mathbf{1}=\mathbf{A}^2\,\mathbf{1}=\big((3k+6-d)\,\mathbf{I}+d\,\mathbf{J}\big)\,\mathbf{1}=(3k+6-d)\,\mathbf{1}+d(12k)\,\mathbf{1}\,.$$  Therefore, $(3k+6)^2=(3k+6)+(12k-1)d$.  That is, $(12k-1)d=(3k+6)(3k+5)$.  
Now, $$4^2(3k+6)(3k+5)=(12k+24)(12k+20)\equiv 25\cdot 21=525\,\big(\text{mod } (12k-1)\big)\,.$$  Since $(12k-1)\mid4^2(3k+6)(3k+5)$, we have $(12k-1)\mid 525$.  All positive divisors of $525$ are $$1,3,5,7,15,21,25,35,75,105,175,525\,.$$ The only possible divisor in the form $12k-1$ is $35$.  Thus, $k=3$, so $12k=36$ is the number of people in the party.  (Ergo, each person greeted $3k+6=15$ other people, and the number of people who greeted both of two arbitrarily chosen distinct persons is $d=\dfrac{(3k+6)(3k+5)}{12k-1}=6$.). From http://www.designtheory.org/library/preprints/srg.pdf, there are $32548$ possible configurations up to permuting the party attendances.
