I have an input file which looks as follows:

```
2 5 8 11 14 17 20 23 26 29 32 35 38 41 44 47 50 53 56 59 62
4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64
6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66
8 11 14 17 20 23 26 29 32 35 38 41 44 47 50 53 56 59 62 65 68
10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70

```

How do I find the average of all these numbers in Spark? 
I have been able to write the code till this point. 

```
val x1 = input.map( (value:String)=> value.split(" ") )

```

(input is the hdfs location of the input textfile containing all the numbers)