Merging two files with condition

I have two files of the type

111 222 10
112 223 20
113 224 30
114 225 20

and

111 222 9
444 555 8
113 224 32
666 777 25

I want to merge files based on 1 and 2nd column. if 1st and 2nd column are unique in file 1 and 2 keep them, if they 1st and 2nd column are comman in two files then average the values in 3rd column so I need the final result as;

111 222 9.5 <--- 1st and 2nd column in both are same so 3rd is avg.
112 223 20 <--- Unique to file1
113 224 31 <----- 1st and second column are same so 3rd is avg.
114 225 20 <--- Unique to file 1
444 555 8 <----- unique to file 2
666 777 25 <---- unique to file 2

Please help me with awk or any other script.

A possible solution using awk :

$ cat digipak1.txt
111 222 10
112 223 20
113 224 30
114 225 20
$ cat digipak2.txt
111 222 9
444 555 8
113 224 32
666 777 25
$ cat digipak.ksh
nawk '
   NR==FNR {
      Value[$1 " " $2] = $3;
      next;
   }
   {
      key = $1 " " $2;
      if (key in Value) {
         Value[key] = (Value[key] + $3) / 2;
      } else {
         Value[key] = $3;
      }
   }
   END {
      for (key in Value) print key,Value[key];
   }
' digipak1.txt digipak2.txt | \
sort > digipak.txt
$ ./digipak.ksh
$ cat digipak.txt
111 222 9.5
112 223 20
113 224 31
114 225 20
444 555 8
666 777 25
$ 

Jean-Pierre.

awk '{a[$1 FS $2]+=$3; b[$1 FS $2]++}END {for (i in a) print i, a/b|"sort -n"}' file1 file2

Thank a million both of you. Both solutions work for me. God Bless.